From 5dc68b4f4b7f891226949f991635eaf1d6ef1271 Mon Sep 17 00:00:00 2001 From: Etienne Brosse Date: Fri, 14 Oct 2022 10:31:52 +0200 Subject: [PATCH] Camel Designer 1.0.12 Adds rules. Fixes import, export. --- pom.xml | 23 +- src/main/conf/module.xml | 273 +++- .../res/generated/patterns/framework.umlt | Bin 5949 -> 5952 bytes .../classifier/FeatureClassifier.java | 2 +- .../enumeration/GeographicalRegion.java | 22 +- .../cameldesigner/audit/CheckerPlan.java | 174 +++ .../audit/rule/constraint/Rule1301.java | 21 +- .../audit/rule/constraint/Rule1302.java | 47 + .../audit/rule/constraint/Rule1303.java | 38 + .../audit/rule/constraint/Rule1304.java | 38 + .../audit/rule/constraint/Rule1305.java | 39 + .../audit/rule/constraint/Rule1306.java | 37 + .../audit/rule/constraint/Rule1307.java | 37 + .../audit/rule/constraint/Rule1308.java | 48 + .../audit/rule/constraint/Rule1309.java | 38 + .../audit/rule/core/Rule0000.java | 37 - .../audit/rule/core/Rule0102.java | 44 + .../audit/rule/data/Rule1401.java | 6 +- .../audit/rule/data/Rule1402.java | 37 + .../audit/rule/data/Rule1403.java | 37 + .../audit/rule/deployment/Rule0302.java | 35 +- .../audit/rule/deployment/Rule0303.java | 9 +- .../audit/rule/deployment/Rule0304.java | 11 +- .../audit/rule/deployment/Rule0305.java | 11 +- .../audit/rule/deployment/Rule0306.java | 37 +- .../audit/rule/deployment/Rule0307.java | 6 +- .../audit/rule/deployment/Rule0308.java | 10 +- .../audit/rule/deployment/Rule0309.java | 21 +- .../audit/rule/deployment/Rule0310.java | 6 +- .../audit/rule/deployment/Rule0311.java | 37 +- .../audit/rule/deployment/Rule0312.java | 6 +- .../audit/rule/deployment/Rule0313.java | 37 +- .../audit/rule/deployment/Rule0314.java | 6 +- .../audit/rule/deployment/Rule0315.java | 21 +- .../audit/rule/location/Rule0501.java | 11 +- .../audit/rule/metric/Rule0601.java | 10 +- .../audit/rule/metric/Rule0602.java | 43 + .../audit/rule/metric/Rule0603.java | 47 + .../audit/rule/metric/Rule0604.java | 37 + .../audit/rule/metric/Rule0605.java | 44 + .../audit/rule/metric/Rule0606.java | 38 + .../audit/rule/metric/Rule0607.java | 43 + .../audit/rule/metric/Rule0608.java | 42 + .../audit/rule/metric/Rule0609.java | 42 + .../audit/rule/metric/Rule0610.java | 37 + .../audit/rule/metric/Rule0611.java | 37 + .../audit/rule/metric/Rule0612.java | 38 + .../audit/rule/metric/Rule0613.java | 38 + .../audit/rule/metric/Rule0614.java | 42 + .../audit/rule/metric/Rule0615.java | 37 + .../audit/rule/metric/Rule0616.java | 38 + .../audit/rule/metric/Rule0617.java | 38 + .../audit/rule/metric/Rule0618.java | 38 + .../audit/rule/metric/Rule0619.java | 38 + .../audit/rule/metric/Rule0620.java | 37 + .../audit/rule/metric/Rule0621.java | 37 + .../audit/rule/metric/Rule0622.java | 37 + .../audit/rule/metric/Rule0623.java | 38 + .../audit/rule/metric/Rule0624.java | 37 + .../audit/rule/metric/Rule0625.java | 37 + .../audit/rule/metric/Rule0626.java | 38 + .../audit/rule/metric/Rule0627.java | 37 + .../audit/rule/metric/Rule0628.java | 37 + .../audit/rule/requirement/Rule0801.java | 11 +- .../audit/rule/requirement/Rule0802.java | 37 + .../audit/rule/requirement/Rule0803.java | 37 + .../audit/rule/requirement/Rule0804.java | 37 + .../audit/rule/requirement/Rule0805.java | 38 + .../audit/rule/requirement/Rule0806.java | 38 + .../audit/rule/requirement/Rule0807.java | 43 + .../audit/rule/requirement/Rule0808.java | 42 + .../audit/rule/requirement/Rule0809.java | 42 + .../audit/rule/requirement/Rule0810.java | 42 + .../audit/rule/requirement/Rule0811.java | 38 + .../audit/rule/requirement/Rule0812.java | 42 + .../audit/rule/requirement/Rule0813.java | 42 + .../deployment/HostingPortExporter.java | 17 - .../deployment/RequiredHostExporter.java | 6 +- .../exchange/importer/CamelContainment.java | 1249 +++------------ .../importer/DefaultCamelVisitor.java | 1371 +++++++++++++++++ .../importer/ICamelImporterVisitor.java | 81 +- .../exchange/importer/ICamelVisitor.java | 192 --- .../importer/IDefaultCamelVisitor.java | 350 ----- .../exchange/importer/ImporterFactory.java | 223 +-- .../AttributeConstraintImporter.java | 1 - .../constraint/ConstraintModelImporter.java | 32 + .../constraint/IfThenConstraintImporter.java | 6 + .../constraint/LogicalConstraintImporter.java | 6 + .../constraint/MetricConstraintImporter.java | 6 + .../MetricVariableConstraintImporter.java | 6 + .../importer/core/AttributeImporter.java | 75 +- .../importer/core/CamelElementImporter.java | 3 +- .../importer/core/FeatureImporter.java | 2 +- .../core/MeasurableAttributeImporter.java | 22 +- .../importer/core/NamedElementImporter.java | 28 +- .../importer/data/DataTypeModelImporter.java | 7 +- .../ClusterConfigurationImporter.java | 7 +- .../deployment/CommunicationImporter.java | 54 +- .../deployment/CommunicationPortImporter.java | 25 +- ...ntImporter.java => ComponentImporter.java} | 10 +- .../deployment/ConfigurationImporter.java | 29 +- .../deployment/ContainerImporter.java | 2 +- .../DeploymentTypeModelImporter.java | 6 +- .../importer/deployment/HostingImporter.java | 65 +- .../deployment/LocationCouplingImporter.java | 28 +- .../deployment/PaaSConfigurationImporter.java | 9 +- .../importer/deployment/PaaSImporter.java | 2 +- .../ProvidedCommunicationImporter.java | 21 +- .../deployment/ProvidedHostImporter.java | 6 +- .../RequiredCommunicationImporter.java | 19 +- .../deployment/RequiredHostImporter.java | 5 +- ...orter.java => RequirementSetImporter.java} | 29 +- .../ScriptConfiguationImporter.java | 17 +- .../ServerlessConfigurationImporter.java | 11 +- .../deployment/SoftwareComponentImporter.java | 13 +- .../importer/deployment/VMImporter.java | 2 +- .../CommunicationInstanceImporter.java | 27 + .../CommunicationPortInstanceImporter.java | 41 + .../ComponentInstanceImporter.java | 17 + .../ComponentRelationInstanceImporter.java | 28 + .../ContainerInstanceImporter.java | 32 + .../DeploymentInstanceModelImporter.java | 33 + .../HostingInstanceImporter.java | 39 + .../HostingPortInstanceImporter.java | 28 + .../PaaSInstanceImporter.java | 32 + ...ProvidedCommunicationInstanceImporter.java | 40 + .../ProvidedHostInstanceImporter.java | 32 + ...RequiredCommunicationInstanceImporter.java | 38 + .../RequiredHostInstanceImporter.java | 31 + .../SoftwareComponentInstanceImporter.java | 16 + .../VMInstanceImporter.java | 15 + .../execution/RuleTriggerImporter.java | 7 +- .../execution/SLOViolationImporter.java | 7 +- .../location/CloudLocationImporter.java | 31 +- .../location/GeographicalRegionImporter.java | 29 +- .../importer/location/LocationImporter.java | 17 +- .../importer/metadata/MmsObjectImporter.java | 8 +- .../metadata/MmsPropertyImporter.java | 1 - .../metric/MetricContextImporter.java | 4 +- .../importer/metric/MetricImporter.java | 4 +- .../metric/MetricTemplateImporter.java | 10 +- .../organisation/OrganisationImporter.java | 38 + .../OrganisationModelImporter.java | 20 + .../PlatformCredentialsImporter.java | 17 + .../organisation/UserGroupImporter.java | 23 + .../importer/organisation/UserImporter.java | 118 ++ .../requirement/HardRequirementImporter.java | 2 +- .../requirement/ImageRequirementImporter.java | 10 + .../requirement/RequirementImporter.java | 8 + .../ResourceRequirementImporter.java | 2 - .../ServiceLevelObjectiveImporter.java | 10 + .../UnaryEventPatternImporter.java | 6 +- .../importer/type/BooleanValueImporter.java | 7 + .../type/BooleanValueTypeImporter.java | 8 + .../importer/type/DoubleValueImporter.java | 7 + .../importer/type/FloatValueImporter.java | 7 + .../importer/type/IntValueImporter.java | 7 + .../exchange/importer/type/LimitImporter.java | 7 + .../exchange/importer/type/ListImporter.java | 7 + .../importer/type/NumericValueImporter.java | 7 + .../exchange/importer/type/RangeImporter.java | 7 + .../importer/type/RangeUnionImporter.java | 7 + .../importer/type/StringValueImporter.java | 7 + .../type/StringValueTypeImporter.java | 8 + .../importer/type/TypeModelImporter.java | 7 + .../exchange/importer/type/ValueImporter.java | 12 + .../importer/type/ValueTypeImporter.java | 24 + .../importer/unit/SingleUnitImporter.java | 6 +- .../core/CamelElementPropertyPage.java | 29 +- .../location/CloudLocationPropertyPage.java | 26 +- .../GeographicalRegionPropertyPage.java | 41 +- .../metadata/MmsObjectPropertyPage.java | 22 +- .../MmsPropertyInstancePropertyPage.java | 25 +- .../metadata/MmsPropertyPropertyPage.java | 33 +- .../metric/FunctionPropertyPage.java | 30 +- .../ProviderRequirementPropertyPage.java | 34 +- .../cameldesigner/ui/WizardImport.java | 64 +- .../cameldesigner/utils/StringUtils.java | 18 +- 178 files changed, 5881 insertions(+), 2253 deletions(-) create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1302.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1303.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1304.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1305.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1306.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1307.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1308.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1309.java delete mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0000.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0102.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1402.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1403.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0602.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0603.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0604.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0605.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0606.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0607.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0608.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0609.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0610.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0611.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0612.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0613.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0614.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0615.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0616.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0617.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0618.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0619.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0620.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0621.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0622.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0623.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0624.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0625.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0626.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0627.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0628.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0802.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0803.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0804.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0805.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0806.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0807.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0808.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0809.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0810.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0811.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0812.java create mode 100644 src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0813.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/DefaultCamelVisitor.java delete mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelVisitor.java delete mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/IDefaultCamelVisitor.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/ConstraintModelImporter.java rename src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/{CamelComponentImporter.java => ComponentImporter.java} (57%) rename src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/{RequiredSetImporter.java => RequirementSetImporter.java} (95%) create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationPortInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentRelationInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ContainerInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/DeploymentInstanceModelImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingPortInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/PaaSInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedCommunicationInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedHostInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredCommunicationInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredHostInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/SoftwareComponentInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/VMInstanceImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueTypeImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/DoubleValueImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/FloatValueImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/IntValueImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/LimitImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ListImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/NumericValueImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeUnionImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueTypeImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/TypeModelImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueImporter.java create mode 100644 src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueTypeImporter.java diff --git a/pom.xml b/pom.xml index 3b6f7b11..5db9ef5f 100644 --- a/pom.xml +++ b/pom.xml @@ -35,14 +35,14 @@ pom provided - + org.eclipse.equinox registry @@ -63,14 +63,14 @@ 1.0.0 jar - + org.eclipse.ocl.xtext oclstdlib @@ -151,14 +151,14 @@ net4j 4.1.500 - + org.eclipse.equinox app @@ -538,4 +538,13 @@ Modelio Module for designing the Cloud Application Modelling and Execution Language (CAMEL). For more information about CAMEL see http://camel-dsl.org/ - + + + + com.google + inject + 3.0.0 + + + + diff --git a/src/main/conf/module.xml b/src/main/conf/module.xml index 7d8c2b8e..73c2388d 100644 --- a/src/main/conf/module.xml +++ b/src/main/conf/module.xml @@ -7,11 +7,258 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -24,7 +271,6 @@ - @@ -1288,7 +1534,7 @@ - + @@ -1365,6 +1611,10 @@ + + + + @@ -1382,6 +1632,10 @@ + + + + @@ -1885,7 +2139,7 @@ - + @@ -1926,7 +2180,7 @@ - + @@ -2858,8 +3112,6 @@ - - @@ -3031,7 +3283,10 @@ - + + + + diff --git a/src/main/conf/res/generated/patterns/framework.umlt b/src/main/conf/res/generated/patterns/framework.umlt index 019cadc399cd124210d894bfac5d7e7722278f61..777548d9e003f9fc41bee9342fb485814b92b835 100644 GIT binary patch delta 3813 zcmVjF2F7gP)h>@6aWYa2ms-UEwK$K0R!QQEt5C_9)DF_6OPx$0Z~dp5JtC@ zl!OwFRLX(WV5HJ895Ke|6dd6|V08C{(I7EEK}Lswbo@|8OE)U;_xE`(-v4{~KIh_` z=bX=Tb*{b!pc~|jB$SktBtK%rO-TMrq9o)b9$wCpZXOPfFsO&5r>(cQqnA5E66)sZ z;q`ZvH29y5gnvEE7J;}LAR%ctqq5>yM_zwkO?UM5=H(9zo=*}}Ri|MfBdrrtogN6Q zArVQcBy{c8pl1f_TX|p?u`8e$1h>!lggfGc7VVRdw1otpxgPkpW8FE~;b1H>>+xpd z{ML1rb?Qxk+4vRp=inpGz4pD}z1)ihT%I47YEj#81b=-{M+DvSQ|j!p4yix6%%9(@ z7!;|1i|7Im=!3v|Dy2VI>44{9nLykRB9~ad?v-}sY6x(6Y=x68GJ^jBIeSp#}ZRhSBSG+_hnIMv)eC>lQgv3K14J#`ur?i>RaQR);OC7 z?tkx_sGjfm0R=vYJY(UM+DT_U(29#(-TOzyZ|HWZcA=vJ^%mApq@us}=$HbZ0~K3H zE8u}^Oz5(jL)n?{=Mff>K*t`&sQc#4-^R3EfwqFqvDRT-s=koV>Lw0O1axLCV}Ch5 zp0x<2l2gZb~$*lOtq1b8GMQ91vm7_1T@j zb4UCeq|vdIo*!^}RswUa6!#E#@5cH_Q9XX}XrrE4Sf3!ij=~+DDiRYZp)$WbM4J;^ z(pb@EF~ys7vpqAV2`aE2kv65>JrmuWA`nbQ*i26Hl(epxKyMtg)yHpUO&%H*Xn&`S zr8d`0r#_+Zak>>4XV#}s8kEIUZ#3UufM4SY#$(8z6HSMrHRs< z)v)|vA5OYVDrBhZP*#%=C4|{+(_j5X!A->$>CJ1IAXTc?Vo67GEqR0kSSpVBQHu@+ znF*FTdbml+b$xvot4#q`hmglC>c$t$)G+i>EU!Rvt3p zh+NsDaPHmd0}`$YI0M!j7#W2GzR^NH>$I}S32m`TI+mF}u+SV}J2)HHN7t0`$43fU zBB6<<)^iS75^^*-q1K5Kg@fXCPitfoZWHj6w-qJ2nXziq<9Q=0DB7Qru z9c;@ptDLSoE5?CtQmq@5MSo>?l43*rXf1SJkH(sn!S%@S+ZfB1`6r`eOdAu$Ao!M( zjT72Zs(5_aY=Mh69&csgSdU6w`!#IIX1T?l$=)RU$dITM3sdlQDC~X->stE2~OZ5W}V6F0R$a>hYUc^&m%jOC<$Tv_7pr64j$g(==>*57Yn;!V- z-C}%um0_Dcn-40iBY(>}At21l`5wnpHq}jlTBAGzq)D>(x49dM_5*LdsRs8ODy`m3 z66|zxL__KyA5hd4%sS5%nT}dva@LwhK~9pJ;VfZ%s^!Y$~Sj~@?GdQ z4)fbyreUN@2Sxm~F;PhWXIzsjQr0g9Ya~1pfJ}HsYUYXVU5I1dnkQ%IpoC@_#B5@uhKDR z@DWNW&KRTo)^L&Gw#$p-D#nRN9?ph8I0S-)Qwi}{D1u)NU8HSDoxfu!DaF|QM11S0*n ze28mNx$2(tbxqZG(t7QQzz0RihM}<8h851lW^mGfajzG%L1LC-u#wk^xBDcfz%vevTO~HIpCsrzklX zL_aW6gv+>84lw3bkzAPrVKF1x-Ns4=XA{#AjkB>YpJ|I>=S~xWckSC*q`{9pM3?cH z^&y`~$L%HcR_R6KUcWH4e~hz*81tSy2E<>qF@I#dqL>3z^jyrK!LANY0kHHl!k1Uc z6Qb5H;kzIqurKe1nZYjwnxIsQ43Fz2_;+y`s!)rwQEONqBO>V+2R&M=2tX%Fqq(dT zFvTDkED)}DOHhdz`{xE?ryi5N2D4b(NMs(%FK^n@Rp+NU-9#RNr#LG4j5gX#^~U-# zjDIGxE&(Ry);u!Jl~#F;u5(uo*QLs`wCw#{M}7krRb5+VYzVIIKXn6Ij^+JDoGu+e*o-ZQa!KBsLKI@4E5Tk}NO?dU|d z*m=V!k8$pps7w1sX@l{lpQFCr7cVPy>n`MYh#I={rm3bPPEKFjS?nESCa{x~i+%n( zI!$G*`riE)3dE@Wnxi1{_lM@1*}a~b`**V2 z=>#}PwO)UH>MGfRq!n;Bw6Ofm@m$D2Q2yQF_OpAs9hIgJTqVCC&Vg;t1&HRzt`g_k z3eyq07BW%B4`7=TvNR={6aSUCNPqSp0t;bA6ZRr(o=lGmXtQdW;x-6?ZH;^QG4u^9 zg-8JPrMw1G#1M3v7+Z)BQHOh9l|O*czYL*;WJl~JScoY^iM}G3_;*oR4JUgJlUE@N z4)HY2A!KsNHp&a^%;Bv8^v$mU;jL4hIrjc!a`3iYvU27XV~j$*j~d~Gm49%D*&wY8 zDcc4|p+H!cWPp5sUQsSh?Whhy$3!Lk7IH~1{_nTlb5)CIMot0DYaji-$&QZ?tkKK_ zkcy{N-g6P{{Bk^BI`#yT&X@VqUGA&Aci`!$r4xrD^JV;IRO$+CPHf(ync58M0qp4$ zcPHxEcp*5Aas+1``ObJGEr07XEZPF)1vpMp+R5`QW<=#9a;LmrWmNy+IL%Sha(_pPLIy2cuGDd* z(NiykEGD-E6X$sk9U#GTG|n{@ACLL)w7;K!E&Bb|*)X2R*qxE|`1`|qc57v_7v#BL z_Pj!p@CHY2&0+5*q6RbEdZoWyMz%KtnxsISHl|zrQzQx;%i9mH-zNlwooi_aQk1>_ zZrse7*KOFAGI0x-=6~nif@*^LwW54o{IDorsGnS92RqNq;F5sFH)|4+D6^0lqm(s! z5>B?<{k5T)l;L0cUVpgSr1ZVdrf&P4P98N{rhvltCDs$WMWscF{d1~BKw(jeSbN6?vE5JI_Mu&Hb;Nz zGTAMUJ!)?MSTO=At?OmY#s|!8`qo@iD(!F}j;{~XUr*FkZ!5H!hEK10JhgsnB0E3r`ZqQB-Tw;_T>_I z^0I~DtUpfd#{i;As~a~&$rb|Y`W^DN2DRjK$)J|Dw=P^X4K!4{q4E}6FYxESqZqNi zi)zqD?#9F9M;`jtQ_XTyj&84=#FX!wh0^{IGTapnUVj@Zsh%*U&5Jle6Q6CJLZrPI zo#W0ddT-g$SVmXExaVdRg{jgCR;JC$e)tN1&wQ28*KK1&*y|NgR*KiZqOLAn4ka-F zQBXQ4^Y-BGkdRREk^J?fWQ-*LOM?G>`)#mZ-?IMODQW+8{{c`- z2M8*!^%kaH4gdgq4gdg9O9KQH00;;O0O5%(v&;{=1_R-VEt82BHwod1EmbP7^`>5v b$rdmJ;fXDi{1zJl!jl*m9|nCE00000fvj`5 delta 3810 zcmV<84ju8pF1;=dP)h>@6aWYa2mnTV7_ki~0Ru*R7?U^w9)DLn8;;k;QEIi65_{LG zRjX)YwpK%}5VN%jF(dXYjnPoV-aEBtji9AskJ{Uhid}nai+_Kg_u~D(m+x~f&Uw!H zJXh!Hs|&hAOh-UQMn<3(z-UPDUlJl9CUEm~5OZ;}wSz(3#N4gCyzD$(;bKr1cQ?V&GyD_;r>n7s%>w21u#yTTEfHazu+q#xXbpj2 zVkNF?zXmlsSl`MCyNX!@MZ-C~$0uFkpVXbU}!9)$b49x(R|G={g_iNo~gl*EvmUqaJj0m|ahmqgU)&2f~J&-n6 zpEU=vLULcs--BLZuZJVxi2u?+MgiXmx~wn_oQqY2cleUH>GLhQxmL zz`HG7zJFtR>xDl6UIqkeb}2R=*~#4KiC@KV-;}YuJz4#EiDX#Dowx>qx|-xKslJqV zTr6IG!Ol=GUgoph7X8Rw^6icdIa+;t#3Ocd|F%j^(HqbI<`3!3#EZ_`!4J1RI`o(6 z$lQPj9b!^{^t-C%w`hG;aqG#ng6kgo8_Awybbs#7`uXR;4BvLf2kj~;eflIRf;Hx0 z^z5ga#RX=ix?<%kUZq5XQw?P*M*ZvTEh>Qxapv2}th=uZJDXj8q3tE0-8R8O8Bv!PY2p)&?^~R zB7c9i=L_WhB>0k%O?)qn=}0{`V*TJBMc<)&B^m{GauholJ;93p+LKdKY&KMQF*Tpl zLv>P%$pp&6@F*9zgaF$0&_zBnX`UFoD^iCg-u?2BRWPr5-hJV6D zEsf%g)Z6}UK&)|}TuERieZBrde?E4DGYE?&euXz0+SODi)oxv8M7gU{&zB@fuvNqI zg1p(NGsqDkPD7bZ{A3UYmu)|l*ZCyRS|qk_B?FbnTZ_c(h}C7`wqWsC2I&?}G$I2m zdGchNjQ#fZ0Y-xqtO6m9)p){||9^$}{*)>U>Mj$PJSc`wdMF8nt4XIgE$-p5?@43B z%cB@O|Jj-QHpI4z-h4#Q6Qc0-skRez>x=I^RYt2wFS&m#-3y6EJ+?f&c-FLSyC_T1 z>(toQ84m`S_6`CXul+1hW4q3TS$eJjgqHfLVFRwIQ}P@YN8;bn8<+*eu75qDFUPZI zje2nG&m0l3PkPW|ynqpr2;e()#LG@|)9jEI^TbohnIluR0p_ENaUE1mDNkGkpBVz0 zU}Q0Gn<*+onH^%0AX+deQum@pD*hg>?^#NnM9xeVDAG&9F%qSbc#@6XOPJcp7urHOVrt@fwajAzk5q1}C*0S(?bc}v$vIyj{V{d7X zG7~QvUo~E2=ZeFco7&YQQ#O7Ln=za1uw<|_NlEMB?bhr|2bnDO1n;hvVVk+Va^f~m>|U( z=vwEwzAsIaj~J)BMNPA5!bh;Ws;Qs zYXM4C%9z^Kx*5%JR%oiGsnxnHfnnywQV%uSiE{ja!i9>Ld1Jm?cnkWzL*rPI#)++YV zny5Xi1x#}%F|lC+EnY^#Zu__yN0JH1J@oQJx0#@uwvLVF)WRc& zxOmvCT>U9@D5p0hvrxoSOg%1C*Cy-w!;&WoAYbKiSY|R$g~*p*HK*D_itjeAqSFJd zHM_PUi8o5OlYd&ea@~ST%J-f&!H^$5n@=wh&kU<3Y}-I-s>>j+r@@!y<(pNSCbZuC z$wld7WD^Z1@gs9UH*;2!1trAkE}!Wr7H`#TYG<4+6C_0+oVY$ zi#HzoAbzk9*OsyFFFDG<6w-9J+hvax5lQk8(~D6HSRWlc@fRx%O1%(3Ekvods_8#X z%NN8OrhS)B9v}1P4t%d3owWfo-PlTC7|SbbI?z(#p*-J4oPeiUE4lTz+KjZv`qK5M zGJmfDh9(xAlFgOoxs6WqH@3GW3Q|-o{p=^c16NgDJI2g#zEnd7Ev_Bw);(E+!wqZE z6vF}b1&w=VoiM~+6vl?@%tCxHKh4eD`GX4G;S>RFo&m~)tC(AFueS#JJ~9~tCM6od zlouhIwih8*Wg0QhIn3+%P7E1tsxTTebbqkXhY4P@G1}heZKj$tH}X3Rc&Xi}1m>6p zy-2rlj_Am1n??!U@#UYRKHXPuDz)maWH|AvS_?)gMuPVC-`g2&?4l?=PIhIuKO64tl0$zgb`L>+;EdINp8vP^+WT=&_U7H~1y6%^@G&9MM(mP+MU% zV%crAvAA-sUTV52l1xDa*;xBafW_fL-A`3%Ut3OS%Ga#&Wx-;9xk4VO&ZJ(%&Va)(7SMRNiJ7dD#XMfO5?LtVk zc_5J>3}X^Nwm-Kphq8856Rv5f79m z#atY}2c<$dTOIMv$K-71N{WkMft9L^JuOcZf%3yE$*2DXu!D_}KfYh03amx4xbn2X3n1yIV z$}49kgF#o0hh#!w)u+6yXUXlvxu&y1vf(+?o^R8u|FE8CE33OAgnuA|W-T`=xItn*mMYAT~>*9iC|dIo8$PC$}Ht{X;L+H3CRWKdu-w zv*mW{wIxs91*ZCXwSOR+puVk0A4gvd(g*4*6VbuKIXk$_YdT>;AQ)*J9Ic&w=F~@Reu^IvBYya3K4@Lc+LB24Mk@N8l}hk1qpmMo+kaL1Sw#npbY*kYmoCHo zvY3SDqx!w^JMSvAx%`p+0;~n35iOEK<1V#i z95$t~HEC)`%71{fk2OU)?wfWgr((6ALQ;9J=~GTPtiZ%Jt3A!W9!g?|jdtJJ&8hscV=>(t<`%Hj5HGgf!xb%mQz)Hs3_`YsSecVAWuY!D>&J9I%!DZ@V_MZ-?x8B@c-)n$%VQglDq%L2>+JF-%dvLulo;BO9u$$ zji1n44if+Xdkz2qP)h>@6aWYa2mnTV7_-k0x&{MAdl-|97B>k-dl*&aji1n4lgt({ Y14erolm8YQ0l$+Q7as getSubFeatures() { if (OptimisationRequirement.canInstantiate(mObj)) results.add((OptimisationRequirement)CamelDesignerProxyFactory.instantiate(mObj, OptimisationRequirement.STEREOTYPE_NAME)); } - return Collections.unmodifiableList(results); + return (results); } @objid ("9a96fc7d-4040-4ea0-8b72-c6e6e3e7fea2") diff --git a/src/main/java/fr/softeam/cameldesigner/api/locationmodel/standard/enumeration/GeographicalRegion.java b/src/main/java/fr/softeam/cameldesigner/api/locationmodel/standard/enumeration/GeographicalRegion.java index a7f1f287..940522e1 100644 --- a/src/main/java/fr/softeam/cameldesigner/api/locationmodel/standard/enumeration/GeographicalRegion.java +++ b/src/main/java/fr/softeam/cameldesigner/api/locationmodel/standard/enumeration/GeographicalRegion.java @@ -11,23 +11,19 @@ import java.util.List; import java.util.Objects; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.CamelDesignerProxyFactory; -import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule; -import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.impl.CamelDesignerModule; import org.modelio.api.modelio.model.IModelingSession; -import org.modelio.api.modelio.model.PropertyConverter; import org.modelio.api.module.context.IModuleContext; -import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException; import org.modelio.metamodel.uml.infrastructure.Dependency; import org.modelio.metamodel.uml.infrastructure.ModelElement; import org.modelio.metamodel.uml.infrastructure.Stereotype; import org.modelio.metamodel.uml.infrastructure.TagType; -import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition; -import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition; import org.modelio.metamodel.uml.statik.Enumeration; import org.modelio.metamodel.uml.statik.EnumerationLiteral; import org.modelio.vcore.smkernel.mapi.MObject; +import fr.softeam.cameldesigner.api.CamelDesignerProxyFactory; +import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.impl.CamelDesignerModule; /** * Proxy class to handle a {@link Enumeration} with << GeographicalRegion >> stereotype. @@ -43,7 +39,7 @@ public class GeographicalRegion extends Location { * Tells whether a {@link GeographicalRegion proxy} can be instantiated from a {@link MObject} checking it is a {@link Enumeration} stereotyped << GeographicalRegion >>. *

* The method returns false if the instantiation cannot be carried out. - * + * * @param elt a model object * @return true if the instantiation can be carried out else false. */ @@ -54,7 +50,7 @@ public static boolean canInstantiate(final MObject elt) { /** * Create a new {@link Enumeration} stereotyped << GeographicalRegion >> then instantiate a {@link GeographicalRegion} proxy. - * + * * @return a {@link GeographicalRegion} proxy on the created {@link Enumeration}. */ @objid ("35865ac2-47bd-40b3-8f8a-16ba3b74f46d") @@ -68,7 +64,7 @@ public static GeographicalRegion create() { * Tries to instantiate a {@link GeographicalRegion} proxy from a {@link Enumeration} stereotyped << GeographicalRegion >> checking its metaclass and its stereotype. *

* The method returns null if the instantiation cannot be carried out. - * + * * @param obj a Enumeration * @return a {@link GeographicalRegion} proxy or null. */ @@ -81,7 +77,7 @@ public static GeographicalRegion instantiate(final Enumeration obj) { * Tries to instantiate a {@link GeographicalRegion} proxy from a {@link Enumeration} stereotyped << GeographicalRegion >> checking its metaclass and its stereotype. *

* The method throws an {@link IllegalArgumentException} if the instantiation cannot be carried out. - * + * * @param obj a {@link Enumeration} * @return a {@link GeographicalRegion} proxy. * @throws java.lang.IllegalArgumentException if the instantiation cannot be carried out. @@ -127,7 +123,7 @@ public boolean equals(final Object obj) { /** * Get the underlying {@link Enumeration}. - * + * * @return the Enumeration represented by this proxy, never null. */ @objid ("a423e5ed-fdb7-41d0-906c-c0782f9a3052") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/CheckerPlan.java b/src/main/java/fr/softeam/cameldesigner/audit/CheckerPlan.java index 5d3f9ca8..850fab32 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/CheckerPlan.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/CheckerPlan.java @@ -7,9 +7,85 @@ import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.audit.rule.IRule; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1301; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1302; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1303; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1304; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1305; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1306; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1307; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1308; +import fr.softeam.cameldesigner.audit.rule.constraint.Rule1309; import fr.softeam.cameldesigner.audit.rule.core.Rule0101; +import fr.softeam.cameldesigner.audit.rule.core.Rule0102; +import fr.softeam.cameldesigner.audit.rule.data.Rule1401; +import fr.softeam.cameldesigner.audit.rule.data.Rule1402; +import fr.softeam.cameldesigner.audit.rule.data.Rule1403; import fr.softeam.cameldesigner.audit.rule.deployment.Rule0301; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0302; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0303; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0304; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0305; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0306; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0307; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0308; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0309; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0310; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0311; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0312; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0313; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0314; +import fr.softeam.cameldesigner.audit.rule.deployment.Rule0315; +import fr.softeam.cameldesigner.audit.rule.location.Rule0501; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0601; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0602; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0603; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0604; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0605; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0606; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0607; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0608; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0609; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0610; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0611; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0612; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0613; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0614; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0615; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0616; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0617; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0618; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0619; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0620; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0621; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0622; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0623; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0624; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0625; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0626; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0627; +import fr.softeam.cameldesigner.audit.rule.metric.Rule0628; import fr.softeam.cameldesigner.audit.rule.mms.Rule0201; +import fr.softeam.cameldesigner.audit.rule.mms.Rule0202; +import fr.softeam.cameldesigner.audit.rule.mms.Rule0203; +import fr.softeam.cameldesigner.audit.rule.mms.Rule0204; +import fr.softeam.cameldesigner.audit.rule.mms.Rule0205; +import fr.softeam.cameldesigner.audit.rule.mms.Rule0206; +import fr.softeam.cameldesigner.audit.rule.mms.Rule0207; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0801; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0802; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0803; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0804; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0805; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0806; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0807; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0808; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0809; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0810; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0811; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0812; +import fr.softeam.cameldesigner.audit.rule.requirement.Rule0813; +import fr.softeam.cameldesigner.audit.rule.unit.Rule1201; import fr.softeam.cameldesigner.impl.CamelDesignerModule; import org.modelio.metamodel.uml.infrastructure.Stereotype; @@ -20,9 +96,107 @@ public class CheckerPlan { @objid ("b24979d2-4590-48da-b62e-1ea155d79f31") public CheckerPlan() { + //Core new Rule0101<>().registerRule(this); + new Rule0102<>().registerRule(this); + + //mms new Rule0201<>().registerRule(this); + new Rule0202<>().registerRule(this); + new Rule0203<>().registerRule(this); + new Rule0204<>().registerRule(this); + new Rule0205<>().registerRule(this); + new Rule0206<>().registerRule(this); + new Rule0207<>().registerRule(this); + + + + //Deployment new Rule0301<>().registerRule(this); + new Rule0302<>().registerRule(this); + new Rule0303<>().registerRule(this); + new Rule0304<>().registerRule(this); + new Rule0305<>().registerRule(this); + new Rule0306<>().registerRule(this); + new Rule0307<>().registerRule(this); + new Rule0308<>().registerRule(this); + new Rule0309<>().registerRule(this); + new Rule0310<>().registerRule(this); + new Rule0311<>().registerRule(this); + new Rule0312<>().registerRule(this); + new Rule0313<>().registerRule(this); + new Rule0314<>().registerRule(this); + new Rule0315<>().registerRule(this); + + + //Location + new Rule0501<>().registerRule(this); + + + //Metric + new Rule0601<>().registerRule(this); + new Rule0602<>().registerRule(this); + new Rule0603<>().registerRule(this); + new Rule0604<>().registerRule(this); + new Rule0605<>().registerRule(this); + new Rule0606<>().registerRule(this); + new Rule0607<>().registerRule(this); + new Rule0608<>().registerRule(this); + new Rule0609<>().registerRule(this); + new Rule0610<>().registerRule(this); + new Rule0611<>().registerRule(this); + new Rule0612<>().registerRule(this); + new Rule0613<>().registerRule(this); + new Rule0614<>().registerRule(this); + new Rule0615<>().registerRule(this); + new Rule0616<>().registerRule(this); + new Rule0617<>().registerRule(this); + new Rule0618<>().registerRule(this); + new Rule0619<>().registerRule(this); + new Rule0620<>().registerRule(this); + new Rule0621<>().registerRule(this); + new Rule0622<>().registerRule(this); + new Rule0623<>().registerRule(this); + new Rule0624<>().registerRule(this); + new Rule0625<>().registerRule(this); + new Rule0626<>().registerRule(this); + new Rule0627<>().registerRule(this); + new Rule0628<>().registerRule(this); + + //Requirement + new Rule0801<>().registerRule(this); + new Rule0802<>().registerRule(this); + new Rule0803<>().registerRule(this); + new Rule0804<>().registerRule(this); + new Rule0805<>().registerRule(this); + new Rule0806<>().registerRule(this); + new Rule0807<>().registerRule(this); + new Rule0808<>().registerRule(this); + new Rule0809<>().registerRule(this); + new Rule0810<>().registerRule(this); + new Rule0811<>().registerRule(this); + new Rule0812<>().registerRule(this); + new Rule0813<>().registerRule(this); + + //Unit + new Rule1201<>().registerRule(this); + + //Constraint + new Rule1301<>().registerRule(this); + new Rule1302<>().registerRule(this); + new Rule1303<>().registerRule(this); + new Rule1304<>().registerRule(this); + new Rule1305<>().registerRule(this); + new Rule1306<>().registerRule(this); + new Rule1307<>().registerRule(this); + new Rule1308<>().registerRule(this); + new Rule1309<>().registerRule(this); + + + //Data + new Rule1401<>().registerRule(this); + new Rule1402<>().registerRule(this); + new Rule1403<>().registerRule(this); } @objid ("1436be35-7866-4bd2-9f0c-1923493700b7") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1301.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1301.java index a9d4672b..86b3f237 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1301.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1301.java @@ -1,25 +1,36 @@ package fr.softeam.cameldesigner.audit.rule.constraint; +import camel.constraint.ComparisonOperatorType; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.UnaryConstraint; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("295c6494-24a8-4479-99a9-17b63e2dbaef") -public class Rule1301 extends AbstractRule { +public class Rule1301 extends AbstractRule { @objid ("eb51ef03-33af-4216-8c54-ea5a53cee54b") - private static final String RULEID = "R0301"; + private static final String RULEID = "R1301"; @objid ("60916abb-ccee-4255-bb10-c481d17f061c") @Override public boolean isViolated(T context) { - return (context.getType() == null); + String operator = context.getComparisonOperator(); + if ((operator == null) ||(operator.equals(""))){ + return true; + }else { + try { + ComparisonOperatorType.valueOf(operator); + }catch(@SuppressWarnings ("unused") Exception e) { + return true; + } + } + return false; } @objid ("ce02a125-33f7-485f-ab2e-1f51ec219fa8") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return "Comparison Operator of " + elt.getName() + " is not valid."; } @objid ("cd75f47d-0ade-48ed-8713-270b5cef46e3") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1302.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1302.java new file mode 100644 index 00000000..b1c81033 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1302.java @@ -0,0 +1,47 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.UnaryConstraint; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("bde30041-df9c-4d04-a631-2cfe6a0f7d10") +public class Rule1302 extends AbstractRule { + @objid ("7a6bc9e4-bc45-4ce6-a3a1-36a15c0d3fd1") + private static final String RULEID = "R1302"; + + @objid ("3b06bad0-1da4-454b-a3b5-89c7896f2b10") + @Override + public boolean isViolated(T context) { + String operator = context.getThreshold(); + if ((operator == null) ||(operator.equals(""))){ + return true; + }else { + try { + Double.valueOf(operator); + }catch(@SuppressWarnings ("unused") Exception e) { + return true; + } + } + return false; + } + + @objid ("ee93cdbb-d19e-415d-a9a0-6fb462c3d554") + @Override + public String getDescription(T elt) { + return "Threshold value of " + elt.getName() + " is not valid."; + } + + @objid ("aad00a09-c8cb-438e-a573-d59e73d808c7") + @Override + public String getRuleId() { + return Rule1302.RULEID; + } + + @objid ("b6f8fac2-03db-4034-a70b-4e7480d5f96e") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1303.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1303.java new file mode 100644 index 00000000..526ccb63 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1303.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.MetricConstraint; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricContext; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("080a5c3a-5231-490a-b7c9-ab9ec4309beb") +public class Rule1303 extends AbstractRule { + @objid ("f66a9802-b52a-4fb9-a700-f7b013701849") + private static final String RULEID = "R1303"; + + @objid ("c020cd4a-a8d0-46e5-aadc-d6b3448c9287") + @Override + public boolean isViolated(T context) { + return (!(MetricContext.canInstantiate(context.getElement().getCompositionOwner()))); + } + + @objid ("c3f727bc-176d-4103-9ab0-69a8a6bcd9b5") + @Override + public String getDescription(T elt) { + return elt.getName() + " is not related to a MetricContext."; + } + + @objid ("f210fea7-a095-4832-b22e-587e34ec20e0") + @Override + public String getRuleId() { + return Rule1303.RULEID; + } + + @objid ("46caa987-727b-4156-bbed-0d5e4935a34f") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1304.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1304.java new file mode 100644 index 00000000..3ac7b04d --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1304.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.AttributeConstraint; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.AttributeContext; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("d19f3cae-2bf5-411d-87df-d65b04b36000") +public class Rule1304 extends AbstractRule { + @objid ("3454a330-0794-4492-9bad-b8506abdc23f") + private static final String RULEID = "R1304"; + + @objid ("01734a39-f4bd-4161-821c-b92259df614e") + @Override + public boolean isViolated(T context) { + return (!(AttributeContext.canInstantiate(context.getElement().getCompositionOwner()))); + } + + @objid ("b60f6aca-a15c-435d-8a8c-9dd9941d20b3") + @Override + public String getDescription(T elt) { + return elt.getName() + " is not related to an AttributeContext."; + } + + @objid ("03c8075d-8398-43e2-8d00-d6d04bb566ef") + @Override + public String getRuleId() { + return Rule1304.RULEID; + } + + @objid ("799be777-bf3a-46c8-aea1-757eb4ecbde0") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1305.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1305.java new file mode 100644 index 00000000..7f4fcd97 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1305.java @@ -0,0 +1,39 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.CamelConstraint; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.IfThenConstraint; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("cbaf950c-f5b7-4d8b-b5e3-a236d5e3432f") +public class Rule1305 extends AbstractRule { + @objid ("e4f81520-ae6b-4b8a-8381-bed4e80e79cd") + private static final String RULEID = "R1305"; + + @objid ("21c45d63-0b8e-44ae-8fed-9c08b2265170") + @Override + public boolean isViolated(T context) { + CamelConstraint ifConstraint = context.getIf(); + return (ifConstraint == null); + } + + @objid ("13bfcae0-a105-4a8c-bbac-6ae44e4a7673") + @Override + public String getDescription(T elt) { + return elt.getName() + " is not related to an IfConstraint."; + } + + @objid ("f821730d-b5f8-41b2-8e08-2562ee63f56d") + @Override + public String getRuleId() { + return Rule1305.RULEID; + } + + @objid ("b17c7f30-ed64-4328-aca4-2a3debc3dea8") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1306.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1306.java new file mode 100644 index 00000000..3683d38c --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1306.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.IfThenConstraint; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("c79c85f5-0be2-4598-993a-22d669ea364d") +public class Rule1306 extends AbstractRule { + @objid ("af6e72cf-269e-48b9-b475-d48f0f0011f4") + private static final String RULEID = "R1306"; + + @objid ("55f2407f-8f14-4642-9158-509379b04999") + @Override + public boolean isViolated(T context) { + return (context.getThen() == null); + } + + @objid ("4a62b6c8-177f-4a51-872a-e24d0efc7e25") + @Override + public String getDescription(T elt) { + return elt.getName() + " is not related to a ThenConstraint."; + } + + @objid ("e38b58de-58d0-46d7-91e7-38f6fb7f7208") + @Override + public String getRuleId() { + return Rule1306.RULEID; + } + + @objid ("691d1a45-c54c-4536-b432-5d049a172e4a") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1307.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1307.java new file mode 100644 index 00000000..8f5be70f --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1307.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.MetricVariableConstraint; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("cd00ca50-1db3-44bc-ba40-d43811a12496") +public class Rule1307 extends AbstractRule { + @objid ("f62e720c-396e-4e9c-af4b-67480224f9a5") + private static final String RULEID = "R1307"; + + @objid ("eea47956-8faf-4dcd-9aca-1de1c1891b1d") + @Override + public boolean isViolated(T context) { + return (context.getMetricVariable() == null); + } + + @objid ("c8ac4af2-a98d-4aeb-87f6-41b5ce489ae0") + @Override + public String getDescription(T elt) { + return elt.getName() + " is not related to a MetricVariable."; + } + + @objid ("3b4da574-132f-4f6a-81fc-0ff50b44b726") + @Override + public String getRuleId() { + return Rule1307.RULEID; + } + + @objid ("121799cb-7cdb-4821-9b09-04eaca7283a8") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1308.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1308.java new file mode 100644 index 00000000..cee4d7b7 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1308.java @@ -0,0 +1,48 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import camel.constraint.LogicalOperatorType; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.LogicalConstraint; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("da683b83-5592-41b9-89c2-09e68ceec153") +public class Rule1308 extends AbstractRule { + @objid ("9413444d-8e11-4f99-8849-ed9dff34dbe3") + private static final String RULEID = "R1308"; + + @objid ("1d154b19-35d8-4ba0-b307-24c49a604237") + @Override + public boolean isViolated(T context) { + String op = context.getLogicalOperator(); + if (op == null) + return true; + else { + try { + LogicalOperatorType.valueOf(op); + }catch(@SuppressWarnings ("unused") Exception e) { + return true; + } + } + return false; + } + + @objid ("395926b4-28fb-4695-90f6-02b2e9a0aace") + @Override + public String getDescription(T elt) { + return "Logical Operator of " + elt.getName() + " is not valid."; + } + + @objid ("b9cffb5b-76a0-4ba0-af6a-612f3dbb779e") + @Override + public String getRuleId() { + return Rule1308.RULEID; + } + + @objid ("764b2e51-e25e-4347-a9c3-40d5e4477689") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1309.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1309.java new file mode 100644 index 00000000..a354fdf3 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/constraint/Rule1309.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.constraint; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.CamelConstraint; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.LogicalConstraint; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("9ec08afe-49c3-487a-aada-6028e88be2e0") +public class Rule1309 extends AbstractRule { + @objid ("79c6c63a-c9f3-4e76-8458-bf9c70bd5354") + private static final String RULEID = "R1309"; + + @objid ("410621e5-277c-4866-ad20-5eee70ba9bbc") + @Override + public boolean isViolated(T context) { + return CamelConstraint.canInstantiate(context.getElement().getCompositionOwner()); + } + + @objid ("a24e97cd-abaa-41db-87b9-6f47a48bb674") + @Override + public String getDescription(T elt) { + return elt.getName() + " must be related to a Constraint"; + } + + @objid ("844bc5b3-c375-4670-bc32-68af310c40e8") + @Override + public String getRuleId() { + return Rule1309.RULEID; + } + + @objid ("b4e91aeb-422c-41cb-bc18-e0292b554c7f") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0000.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0000.java deleted file mode 100644 index 16a91734..00000000 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0000.java +++ /dev/null @@ -1,37 +0,0 @@ -package fr.softeam.cameldesigner.audit.rule.core; - -import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.audit.CheckerPlan; -import fr.softeam.cameldesigner.audit.rule.AbstractRule; - -@objid ("e7413f50-2cb6-4848-be62-da817ac929c8") -public class Rule0000 extends AbstractRule { - @objid ("f5f24d18-8b0f-4d81-b198-b5d39414c25f") - private static final String RULEID = "R0000"; - - @objid ("b5d32728-7a22-4d46-ac74-ba9711d2cf2f") - @Override - public boolean isViolated(T context) { - return true; - } - - @objid ("e52c4b1b-35f5-45ca-aa37-b5ab2f0f231b") - @Override - public String getDescription(T elt) { - return "Description test pour l'initialisation du report"; - } - - @objid ("785669ce-54ce-477b-84fc-6ced86e298cd") - @Override - public String getRuleId() { - return Rule0000.RULEID; - } - - @objid ("c17ed5f9-c504-4443-91f0-f031e7c52639") - @Override - public void registerRule(CheckerPlan plan) { - plan.registerRule(T.STEREOTYPE_NAME, this); - } - -} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0102.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0102.java new file mode 100644 index 00000000..c59fae8a --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/core/Rule0102.java @@ -0,0 +1,44 @@ +package fr.softeam.cameldesigner.audit.rule.core; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.camelcore.standard.package_.CamelModel; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("27e66079-e9b1-4974-bcae-80eba9cf69c8") +public class Rule0102 extends AbstractRule { + @objid ("8f901f97-271c-4050-a935-ea9549a3671c") + private static final String RULEID = "R0102"; + + @objid ("d7fee5e3-1713-469e-b992-8012b8c70863") + @Override + public boolean isViolated(T context) { + String appName = context.getApplicationName(); + String appVersion = context.getApplicationVersion(); + if ((appName != null) && (appVersion != null)) { + return ((appVersion.equals("") && (!(appName.equals("")))) + || (appName.equals("") && (!(appVersion.equals(""))))); + }else { + return false; + } + } + + @objid ("2cb0833f-a67a-4de3-a810-97281c05b7c2") + @Override + public String getDescription(T elt) { + return "Both application name and version must be set"; + } + + @objid ("8bcc9ee0-a99c-4343-890d-7c24743d9d8a") + @Override + public String getRuleId() { + return Rule0102.RULEID; + } + + @objid ("c5f3bf78-a3d9-438b-a6d7-32e9f9dbb721") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1401.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1401.java index f14e9553..ede78e35 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1401.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1401.java @@ -1,14 +1,14 @@ package fr.softeam.cameldesigner.audit.rule.data; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.datamodel.standard.instance.DataInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("32026d8b-5b1c-41f9-9cba-8d09798a7bee") -public class Rule1401 extends AbstractRule { +public class Rule1401 extends AbstractRule { @objid ("f15cf11f-ff90-42c8-b183-54846f4abd1d") - private static final String RULEID = "R0301"; + private static final String RULEID = "R1401"; @objid ("d8521654-0009-40d0-9f71-a0641a3ec181") @Override diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1402.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1402.java new file mode 100644 index 00000000..ee3c44e4 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1402.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.data; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.datamodel.standard.package_.DataInstanceModel; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("ddf05d0b-1ded-429c-b069-49508fbccecd") +public class Rule1402 extends AbstractRule { + @objid ("a123fd92-70c8-4df4-ac7a-67848f92adfb") + private static final String RULEID = "R1402"; + + @objid ("482d4484-af13-4544-8a74-53daf0c74c6e") + @Override + public boolean isViolated(T context) { + return (context.getType() == null); + } + + @objid ("a762331b-4941-4fee-94ec-19faa483a7a4") + @Override + public String getDescription(T elt) { + return "Type of " + elt.getName() + " has not been defined."; + } + + @objid ("78aadb67-b92c-4b9d-bced-dbaeaa56a69a") + @Override + public String getRuleId() { + return Rule1402.RULEID; + } + + @objid ("b70dba1f-5d96-4b5c-bda4-53a8c66a2836") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1403.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1403.java new file mode 100644 index 00000000..f22107f3 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/data/Rule1403.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.data; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.datamodel.standard.instance.DataSourceInstance; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("4895dd5a-4426-4627-a48c-b28a7bb68364") +public class Rule1403 extends AbstractRule { + @objid ("f9108389-ab18-4246-8d28-f7d9ef5b1f73") + private static final String RULEID = "R1402"; + + @objid ("767157a3-4aa5-4dfb-930d-87acc13c0b5c") + @Override + public boolean isViolated(T context) { + return (context.getType() == null); + } + + @objid ("bef62cdb-c443-421a-adb8-d8d1c353366f") + @Override + public String getDescription(T elt) { + return "Type of " + elt.getName() + " has not been defined."; + } + + @objid ("9d6e1cc9-247a-42d8-81ef-3d85956476f1") + @Override + public String getRuleId() { + return Rule1403.RULEID; + } + + @objid ("6c58d5a9-df2c-4c90-b0a8-6f7d7f33b425") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0302.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0302.java index 8c1f4688..eb0bd52a 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0302.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0302.java @@ -1,25 +1,52 @@ package fr.softeam.cameldesigner.audit.rule.deployment; +import java.util.ArrayList; +import java.util.List; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.Communication; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import org.modelio.metamodel.uml.statik.Connector; +import org.modelio.metamodel.uml.statik.Instance; +import org.modelio.metamodel.uml.statik.LinkEnd; +import org.modelio.metamodel.uml.statik.Port; +import org.modelio.metamodel.uml.statik.PortOrientation; @objid ("3d1c4aab-eca7-41ab-ac6f-9dfe56081f1c") -public class Rule0302 extends AbstractRule { +public class Rule0302 extends AbstractRule { @objid ("58646d1e-30ae-43a6-9b1a-5e6780458f24") private static final String RULEID = "R0302"; @objid ("a425f098-bdc7-4cd0-8361-c55e457a2756") @Override public boolean isViolated(T context) { - return (context.getType() == null); + Connector connector = context.getElement(); + + List orientation = new ArrayList<>(); + orientation.add(PortOrientation.IN); + orientation.add(PortOrientation.OUT); + + for (LinkEnd end : connector.getLinkEnd()) { + Instance owner = end.getSource(); + if (owner == null) { + owner = end.getOppositeOwner().getSource(); + } + + if (CommunicationPort.canInstantiate(owner)) { + orientation.remove(((Port) owner).getDirection()); + }else { + return true; + } + + } + return (!(orientation.isEmpty())); } @objid ("a4c19f10-9ca6-4f2f-ba7f-9e18736930e0") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " Communication must be created between a providedCommunication and a requiredCommunication"; } @objid ("aee3def3-419e-4b23-8283-dc260c9b8bc3") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0303.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0303.java index c38b23d6..cf15de9a 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0303.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0303.java @@ -1,25 +1,26 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; @objid ("25911e10-feb6-4c2d-9a83-a6349751af85") -public class Rule0303 extends AbstractRule { +public class Rule0303 extends AbstractRule { @objid ("8f0a0798-bafa-44f3-b225-981926cd802e") private static final String RULEID = "R0303"; @objid ("36d1753d-b2a3-4675-bb72-60f3b28dc58b") @Override public boolean isViolated(T context) { - return (context.getType() == null); + return StringUtils.isInteger(context.getName()); } @objid ("218c6d64-8895-4c98-bb1b-3bcc7f83f2d9") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " CommunicationPort must have a valid port number"; } @objid ("1b8524b4-2c6d-46b4-a40d-8d86b1a11104") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0304.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0304.java index 3873bb0c..50db0bc7 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0304.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0304.java @@ -1,25 +1,26 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; @objid ("9cc6a0b6-9398-4e6d-a291-1d64723af512") -public class Rule0304 extends AbstractRule { +public class Rule0304 extends AbstractRule { @objid ("60b9d64c-5d6e-4653-ba08-623b7fd029b0") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0304"; @objid ("06b672f6-bb5a-45b1-9c19-915ec84e5f26") @Override public boolean isViolated(T context) { - return (context.getType() == null); + return StringUtils.isInteger(context.getLowPortNumber()); } @objid ("785c4fee-0928-4f3a-a3c2-54fe7dc08550") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " CommunicationPort must have a valid low port number"; } @objid ("1d584c17-6921-4b7e-b442-08085cc002e0") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0305.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0305.java index 04acc1ba..8eb63114 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0305.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0305.java @@ -1,25 +1,26 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; @objid ("93983c2e-8462-4593-8d83-7b2704c87a38") -public class Rule0305 extends AbstractRule { +public class Rule0305 extends AbstractRule { @objid ("d1dfe966-2e55-470a-8d52-fb18e1f2e625") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0305"; @objid ("3e291a9b-3fce-4937-956d-280f88bc63fc") @Override public boolean isViolated(T context) { - return (context.getType() == null); + return StringUtils.isInteger(context.getHighPortNumber()); } @objid ("b2bb6871-791f-4803-bd24-09ff743957b9") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " CommunicationPort must have a valid high port number"; } @objid ("f8561bb0-bd62-40af-94fb-c3a71d46a6cf") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0306.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0306.java index 317fa95a..879eafd9 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0306.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0306.java @@ -1,25 +1,52 @@ package fr.softeam.cameldesigner.audit.rule.deployment; +import java.util.ArrayList; +import java.util.List; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.Hosting; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import org.modelio.metamodel.uml.statik.Connector; +import org.modelio.metamodel.uml.statik.Instance; +import org.modelio.metamodel.uml.statik.LinkEnd; +import org.modelio.metamodel.uml.statik.Port; +import org.modelio.metamodel.uml.statik.PortOrientation; @objid ("4d7c0d3d-bb4c-4080-9c20-2a59e7fca19f") -public class Rule0306 extends AbstractRule { +public class Rule0306 extends AbstractRule { @objid ("1653c16d-dad8-4bfb-82b9-a4a200f08d97") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0306"; @objid ("025593be-1584-48dc-8006-53b67bb64acb") @Override public boolean isViolated(T context) { - return (context.getType() == null); + Connector connector = context.getElement(); + + List orientation = new ArrayList<>(); + orientation.add(PortOrientation.IN); + orientation.add(PortOrientation.OUT); + + for (LinkEnd end : connector.getLinkEnd()) { + Instance owner = end.getSource(); + if (owner == null) { + owner = end.getOppositeOwner().getSource(); + } + + if (HostingPort.canInstantiate(owner)) { + orientation.remove(((Port) owner).getDirection()); + }else { + return true; + } + + } + return (!(orientation.isEmpty())); } @objid ("0d63f569-efa5-4704-a767-0cf42c8b77a4") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " Hosting must be created between a providedHostn and a requiredHost"; } @objid ("43e0acee-002e-4a9c-8703-19ab4b5493b5") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0307.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0307.java index 11422c04..896917b1 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0307.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0307.java @@ -1,14 +1,14 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.instance.ComponentInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("85cd39a6-ad84-4e2b-8b89-5d997df3a1e3") -public class Rule0307 extends AbstractRule { +public class Rule0307 extends AbstractRule { @objid ("0ee8c167-b294-44da-8f72-aa70995e10b9") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0307"; @objid ("74af2802-ac20-4aa4-969d-01de2588d50f") @Override diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0308.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0308.java index 1cf9084c..1b38fc78 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0308.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0308.java @@ -1,25 +1,25 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.instance.VMInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("078e958b-19ee-4806-abf9-c81a03662e44") -public class Rule0308 extends AbstractRule { +public class Rule0308 extends AbstractRule { @objid ("06c3e0ba-09f4-4ab1-adc7-385bf37c809a") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0308"; @objid ("29f21bca-c4b4-41c3-bd20-2e1ef7067f31") @Override public boolean isViolated(T context) { - return (context.getType() == null); + return (context.getLocation() == null); } @objid ("9edcea11-cbac-481c-b0c0-1cdc8d0b0371") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return "Location of " + elt.getName() + " has not been defined."; } @objid ("49c87319-02ac-479f-8696-305227da4718") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0309.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0309.java index 79804a16..44f54146 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0309.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0309.java @@ -1,25 +1,38 @@ package fr.softeam.cameldesigner.audit.rule.deployment; +import java.sql.Date; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.instance.VMInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("d33ab5e7-a5d7-4560-99a3-c612141466f4") -public class Rule0309 extends AbstractRule { +public class Rule0309 extends AbstractRule { @objid ("6688c0a5-bd57-4935-baf5-1c36b2afbd61") private static final String RULEID = "R0301"; @objid ("250a038c-bced-470c-88dd-a68f75749e93") @Override public boolean isViolated(T context) { - return (context.getType() == null); + try { + java.util.Date createdOn = Date.valueOf(context.getInstantiatedOn()); + java.util.Date destroyedOn = Date.valueOf(context.getDestroyedOn()); + if ((createdOn == null) + || (destroyedOn == null) + || (createdOn.before(destroyedOn))) { + return true; + } + + }catch(@SuppressWarnings ("unused") Exception e ) { + return true; + } + return false; } @objid ("0a8a8e23-f90e-48e6-bbe6-e96b510b0223") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return "Dates are not compatibles."; } @objid ("4ada77d9-8c1f-4778-a76d-b93fdce4f69d") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0310.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0310.java index 7a815f94..2a189052 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0310.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0310.java @@ -1,14 +1,14 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.connector.CommunicationInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("3263f5f7-1eec-4bee-866d-67b0fc5edced") -public class Rule0310 extends AbstractRule { +public class Rule0310 extends AbstractRule { @objid ("4186bc1a-e53b-4933-abf6-2c44cec2552c") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0310"; @objid ("ed1215f8-e625-4c70-950f-f5a25d77109f") @Override diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0311.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0311.java index 162393c9..5e3d2af2 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0311.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0311.java @@ -1,25 +1,52 @@ package fr.softeam.cameldesigner.audit.rule.deployment; +import java.util.ArrayList; +import java.util.List; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.connector.CommunicationInstance; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.port.CommunicationPortInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import org.modelio.metamodel.uml.statik.Connector; +import org.modelio.metamodel.uml.statik.Instance; +import org.modelio.metamodel.uml.statik.LinkEnd; +import org.modelio.metamodel.uml.statik.Port; +import org.modelio.metamodel.uml.statik.PortOrientation; @objid ("6881c177-cd5e-493b-809e-7e9c114ac333") -public class Rule0311 extends AbstractRule { +public class Rule0311 extends AbstractRule { @objid ("1cb30a8a-86e7-40d6-b26b-dabc9c59af5e") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0311"; @objid ("518aaa06-6e9a-44d8-b812-a053ae0b14b7") @Override public boolean isViolated(T context) { - return (context.getType() == null); + Connector connector = context.getElement(); + + List orientation = new ArrayList<>(); + orientation.add(PortOrientation.IN); + orientation.add(PortOrientation.OUT); + + for (LinkEnd end : connector.getLinkEnd()) { + Instance owner = end.getSource(); + if (owner == null) { + owner = end.getOppositeOwner().getSource(); + } + + if (CommunicationPortInstance.canInstantiate(owner)) { + orientation.remove(((Port) owner).getDirection()); + }else { + return true; + } + + } + return (!(orientation.isEmpty())); } @objid ("6e7d9218-6e82-4dbc-9d88-2335f9a2f3a0") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " CommunicationInstance must be created between a providedCommunicationInstance and a requiredCommunicationInstance"; } @objid ("a336a7d0-2037-4a17-83d7-bd634ce46d8d") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0312.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0312.java index 637cfaae..1d9650df 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0312.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0312.java @@ -1,14 +1,14 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.connector.HostingInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("66c09c28-51d7-433e-b354-07becef651cc") -public class Rule0312 extends AbstractRule { +public class Rule0312 extends AbstractRule { @objid ("4cfdf8e3-34fa-4920-8c72-4b09e14730a7") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0312"; @objid ("2239081d-db9c-4fad-9f61-301e7f372b6a") @Override diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0313.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0313.java index 96d0a09e..797015a4 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0313.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0313.java @@ -1,25 +1,52 @@ package fr.softeam.cameldesigner.audit.rule.deployment; +import java.util.ArrayList; +import java.util.List; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.connector.HostingInstance; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.port.HostingPortInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import org.modelio.metamodel.uml.statik.Connector; +import org.modelio.metamodel.uml.statik.Instance; +import org.modelio.metamodel.uml.statik.LinkEnd; +import org.modelio.metamodel.uml.statik.Port; +import org.modelio.metamodel.uml.statik.PortOrientation; @objid ("8b7b8b47-c15c-4595-ac0c-2850520c09c8") -public class Rule0313 extends AbstractRule { +public class Rule0313 extends AbstractRule { @objid ("2de6f69c-d61d-4ef5-aaf3-d48721bd5b16") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0313"; @objid ("1aa41395-72ab-45c6-9a87-d95e0e299e5f") @Override public boolean isViolated(T context) { - return (context.getType() == null); + Connector connector = context.getElement(); + + List orientation = new ArrayList<>(); + orientation.add(PortOrientation.IN); + orientation.add(PortOrientation.OUT); + + for (LinkEnd end : connector.getLinkEnd()) { + Instance owner = end.getSource(); + if (owner == null) { + owner = end.getOppositeOwner().getSource(); + } + + if (HostingPortInstance.canInstantiate(owner)) { + orientation.remove(((Port) owner).getDirection()); + }else { + return true; + } + + } + return (!(orientation.isEmpty())); } @objid ("ca851702-9817-4447-a600-02601f86bbde") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " HostingInstance must be created between a providedHostingInstance and a requiredHostingInstance"; } @objid ("2841e95d-c8b2-489d-9747-d54c127375a1") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0314.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0314.java index d520c4b6..0c880ac9 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0314.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0314.java @@ -1,14 +1,14 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.port.HostingPortInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("b21ce8b3-9c4d-4be8-8a03-6da991fa0dde") -public class Rule0314 extends AbstractRule { +public class Rule0314 extends AbstractRule { @objid ("6a2434e0-d854-4649-9e67-a16ee71bf26c") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0314"; @objid ("709a380c-6150-45fe-8e02-daf36a5aa8bd") @Override diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0315.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0315.java index c8ffeee4..9bb7764c 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0315.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/deployment/Rule0315.java @@ -1,25 +1,36 @@ package fr.softeam.cameldesigner.audit.rule.deployment; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.LocationCoupling; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("bc921a29-120c-47ff-8d85-f49d4c1baf7b") -public class Rule0315 extends AbstractRule { +public class Rule0315 extends AbstractRule { @objid ("2bf41e0b-e837-4819-bf51-d460d11fbeeb") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0315"; @objid ("64a20db2-80ff-465b-8391-3de4c904477f") @Override public boolean isViolated(T context) { - return (context.getType() == null); + String couplingType = context.getCouplingType(); + + if (couplingType == null) + return true; + else { + try { + couplingType.valueOf(couplingType); + }catch(Exception e) { + return true; + } + } + return false; } @objid ("c9434922-f571-4d2b-8436-d3a51f56f5c1") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return "CouplingType has not been defined."; } @objid ("7276f602-7ac7-40ec-ba80-11d38dac1565") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/location/Rule0501.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/location/Rule0501.java index 3f56f563..de9335c2 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/location/Rule0501.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/location/Rule0501.java @@ -1,25 +1,26 @@ package fr.softeam.cameldesigner.audit.rule.location; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.Location; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("5d07a628-3c45-40c8-b104-26f2c3c9a980") -public class Rule0501 extends AbstractRule { +public class Rule0501 extends AbstractRule { @objid ("8353502b-f6b7-4042-9daf-ee9498ebcd18") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0501"; @objid ("addb1e31-f32b-4fcf-a784-4c285110ad88") @Override public boolean isViolated(T context) { - return (context.getType() == null); + String id = context.getId(); + return ((id == null) || (id.equals(""))); } @objid ("e51a7947-27f5-4870-afef-66555a68d85f") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return elt.getName() + " Location must have an ID."; } @objid ("34094b3d-9686-4cfe-9edc-4aa0c1caf28f") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0601.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0601.java index 71dab062..5f2355b4 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0601.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0601.java @@ -1,25 +1,25 @@ package fr.softeam.cameldesigner.audit.rule.metric; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.metricmodel.standard.instance.MetricInstance; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; @objid ("bd11a2c7-c864-4595-b52e-11c5b37a33d8") -public class Rule0601 extends AbstractRule { +public class Rule0601 extends AbstractRule { @objid ("6b05b81a-0c3b-4b0d-8898-9226fb280e87") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0601"; @objid ("153527fe-4f5e-4ff9-bf94-83d025f2857c") @Override public boolean isViolated(T context) { - return (context.getType() == null); + return (context.getObjectBinding() == null); } @objid ("97746b8e-165a-4409-8d97-e071b9a50699") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return "MetricInstance must have a related MetricObjectBinding"; } @objid ("bc20cc76-78a2-475e-acdd-f96b497e378f") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0602.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0602.java new file mode 100644 index 00000000..9477a29d --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0602.java @@ -0,0 +1,43 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.instance.MetricInstance; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("d85ae442-c6b3-4c13-964f-3d174a4a1366") +public class Rule0602 extends AbstractRule { + @objid ("d271994b-2045-4d86-b42f-328ed56cda3b") + private static final String RULEID = "R0602"; + + @objid ("aaddab7e-a8e6-4e86-b2a0-75a2f8a658fb") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'Instance: ' + self.name + ' of composite metric:' + self.metricContext.metric.name + 'should have the same execution model as the one of all of its component metric instances', + // status : Boolean = + // asError(metricContext.metric.oclIsTypeOf(CompositeMetric) + // implies self.composingMetricInstances->forAll(p | p.objectBinding.executionModel = self.objectBinding.executionModel)) + // }.status + return false; + } + + @objid ("215da604-fe1a-4a53-aad0-eee0f8954f4a") + @Override + public String getDescription(T elt) { + return ""; + } + + @objid ("d077baef-df2a-4f81-8af8-0dd44af6732c") + @Override + public String getRuleId() { + return Rule0602.RULEID; + } + + @objid ("5bc72b9b-28f7-4164-bff8-16a300a22547") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0603.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0603.java new file mode 100644 index 00000000..4f8f63f5 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0603.java @@ -0,0 +1,47 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.instance.MetricInstance; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("065924f6-1169-4472-8c94-1a2b8750e856") +public class Rule0603 extends AbstractRule { + @objid ("2e2f1468-7860-468a-9daf-d232273000c5") + private static final String RULEID = "R0603"; + + @objid ("471ba9e9-6c15-435c-801d-5b9112b07447") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'CompositeMetricInstance: ' + self.name + ' should have component metric instances which map to the component metrics referenced by the composite instance\'s metric', + // status : Boolean = + // asError(metricContext.metric.oclIsTypeOf(CompositeMetric) + // implies self.metricContext.metric.oclAsType(CompositeMetric).componentMetrics + // ->forAll(p | self.composingMetricInstances + // ->exists(q | q.metricContext.metric = p)) + // and + // self.composingMetricInstances->forAll(inst | self.metricContext.metric.oclAsType(CompositeMetric).componentMetrics->exists(comp | comp = inst.metricContext.metric))) + // }.status + return false; + } + + @objid ("37dbd44e-df6c-4ac2-8c77-d46dd0b1f68f") + @Override + public String getDescription(T elt) { + return ""; + } + + @objid ("a199572c-ecca-454d-89ae-d9f6319124b9") + @Override + public String getRuleId() { + return Rule0603.RULEID; + } + + @objid ("e02418e6-5292-4da4-ac1d-9c6e15df70bd") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0604.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0604.java new file mode 100644 index 00000000..e82e0f90 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0604.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Metric; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("9ea36551-bae0-49c8-b0d0-1b7811a56ba1") +public class Rule0604 extends AbstractRule { + @objid ("0f942797-27b0-4e9b-8398-2b0c0bee7438") + private static final String RULEID = "R0604"; + + @objid ("86c1ce9d-9c74-4adf-aae0-b2a6e4537527") + @Override + public boolean isViolated(T context) { + return (context.getMetricTemplate() == null); + } + + @objid ("5b99ffa8-4abe-4cf9-815a-c678ecd98973") + @Override + public String getDescription(T elt) { + return elt.getName() + " Metric must ba associated to a MetricTemplate."; + } + + @objid ("183413f1-60a5-4746-bb12-4c78bfbcc7c8") + @Override + public String getRuleId() { + return Rule0604.RULEID; + } + + @objid ("09b2c308-bb54-4ed7-8e57-7787f4a10146") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0605.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0605.java new file mode 100644 index 00000000..9c8a21f7 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0605.java @@ -0,0 +1,44 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Metric; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("b58cd53d-ea65-4e81-9ee7-a4c0b868aecc") +public class Rule0605 extends AbstractRule { + @objid ("5c23ff02-1560-41cd-a7f0-d2d686532de1") + private static final String RULEID = "R0605"; + + @objid ("f817df2f-2199-457c-bc97-97354636a611") + @Override + public boolean isViolated(T context) { + // System.out.println("Checking recursiveness for Metric: " + mt1.getName()); + // camel.metric.CompositeMetric m1 = (camel.metric.CompositeMetric)mt1; + // for (camel.metric.Metric mt: m1.getComponentMetrics()){ + // if (mt.getName().equals(mt2.getName())) return Boolean.TRUE; + // if (mt instanceof camel.metric.CompositeMetric && checkRecursiveness(mt,mt2)) return Boolean.TRUE; + // } + // return Boolean.FALSE; + return false; + } + + @objid ("18d4027e-605c-4082-b756-d3024f1e44d6") + @Override + public String getDescription(T elt) { + return ""; + } + + @objid ("cb17bc49-c8ab-4baf-91ff-70f2093c62d9") + @Override + public String getRuleId() { + return Rule0605.RULEID; + } + + @objid ("e195c860-943d-4a4b-b340-affd47e1a603") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0606.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0606.java new file mode 100644 index 00000000..037fcbbe --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0606.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetric; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("88b19bcf-efc1-4f40-bef8-c60c4d0d1c46") +public class Rule0606 extends AbstractRule { + @objid ("273f387d-5096-406c-9e4f-10d35b828be4") + private static final String RULEID = "R0606"; + + @objid ("29a0f317-0c24-4fe5-b505-e6398bd541c5") + @Override + public boolean isViolated(T context) { + String formula = context.getFormula(); + return ((formula == null) || (formula.equals(""))) ; + } + + @objid ("173b3cfe-ba72-4945-a747-32d626fecfc5") + @Override + public String getDescription(T elt) { + return elt.getName() + " CompositeMetric must have a formula."; + } + + @objid ("f70e3ba1-dbba-4d67-b4f8-138a3ff72a88") + @Override + public String getRuleId() { + return Rule0606.RULEID; + } + + @objid ("4c782f77-efb4-4c4f-9a1c-24a86fc52e1e") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0607.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0607.java new file mode 100644 index 00000000..7f88b17d --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0607.java @@ -0,0 +1,43 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetric; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Metric; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("d4673439-96a9-4180-818b-86e6e8f9f5a3") +public class Rule0607 extends AbstractRule { + @objid ("c22764dd-65f2-42ff-a3d5-c7e890f0c903") + private static final String RULEID = "R0607"; + + @objid ("b806c642-8dac-4001-bef9-ddaa75edcd6b") + @Override + public boolean isViolated(T context) { + org.modelio.metamodel.uml.statik.Class self = context.getElement(); + for (Metric comp : context.getComponentMetrics()) { + if (comp.getElement().equals(self)) + return true; + } + return false; + } + + @objid ("cde52103-b386-40b4-aa3d-ef8956d5e4c6") + @Override + public String getDescription(T elt) { + return "CompositeMetric: " + elt.getName() + " should not contain itself recursively."; + } + + @objid ("28be3d10-8f88-4911-8b40-fe18b2897345") + @Override + public String getRuleId() { + return Rule0607.RULEID; + } + + @objid ("7816090d-9de7-452e-bfe8-5d9b164170f6") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0608.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0608.java new file mode 100644 index 00000000..6e26c71f --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0608.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricVariable; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("8d7ed2c7-0ca0-4037-b88d-dd2f4bf1aadf") +public class Rule0608 extends AbstractRule { + @objid ("13dc05f7-3517-48d0-86a7-76703749ffe1") + private static final String RULEID = "R0608"; + + @objid ("a0fd3a5b-0310-42d0-8046-b53a3a6f3403") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'MetricVariable: ' + self.name + ' cannot span both the current configuration and the node candidates', + // status : Boolean = + // asError(currentConfiguration = false or onNodeCandidates = false) + // }.status + return false; + } + + @objid ("d268c311-7899-4472-9d0b-c0a94cf6aa72") + @Override + public String getDescription(T elt) { + return ""; + } + + @objid ("695b733f-ba4c-416e-abfb-275e86f83175") + @Override + public String getRuleId() { + return Rule0608.RULEID; + } + + @objid ("469f3415-0c6f-4301-966d-5176fb4485ab") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0609.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0609.java new file mode 100644 index 00000000..8ea35d3d --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0609.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricVariable; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("a03afcb9-031d-4b2b-b468-fb1ec4f47941") +public class Rule0609 extends AbstractRule { + @objid ("43dadf5c-9c9b-4fb7-91e5-e901da6aed5f") + private static final String RULEID = "R0610"; + + @objid ("f8dea46c-66ca-4493-a4bf-03a14dc37a39") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'MetricVariable: ' + self.name + ' should not contain recursively itself' + // , + // status : Boolean = asError(not self.containsMetric(self)) + // }.status + return false; + } + + @objid ("5f4d347a-de2a-4573-ab68-8deee3aeaf1a") + @Override + public String getDescription(T elt) { + return ""; + } + + @objid ("bb9006b7-7d8c-41e2-b2fe-7817eef15f89") + @Override + public String getRuleId() { + return Rule0609.RULEID; + } + + @objid ("1ca37cb7-8e11-4fa0-9307-77e084ffe564") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0610.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0610.java new file mode 100644 index 00000000..bb3bfd26 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0610.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricObjectBinding; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("c0e665dd-48bc-4668-ab7e-8165ddb414db") +public class Rule0610 extends AbstractRule { + @objid ("b95e8ce4-4e40-41e6-8bb4-c48fa417b5c9") + private static final String RULEID = "R0610"; + + @objid ("c43f36cf-4496-43eb-ba86-567858c0d7ee") + @Override + public boolean isViolated(T context) { + return (context.getExecutionModel() == null); + } + + @objid ("d67fe2a1-60f8-4b07-86c4-2e51c674ddc4") + @Override + public String getDescription(T elt) { + return "MetricObjectBinding " + elt.getName() + " must be related to one ExecutionModel"; + } + + @objid ("cdccddba-6a6d-46b5-af03-c1850dbc3701") + @Override + public String getRuleId() { + return Rule0610.RULEID; + } + + @objid ("38673b82-2a2b-4ca3-b5ba-b316e0c2bfb9") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0611.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0611.java new file mode 100644 index 00000000..106858b2 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0611.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("348bfd54-2d52-4a40-a334-1cfa693d54eb") +public class Rule0611 extends AbstractRule { + @objid ("52e72552-94fe-4c17-936d-8de84fd6d198") + private static final String RULEID = "R0611"; + + @objid ("78489a88-ce79-4407-a3c4-c55071d65236") + @Override + public boolean isViolated(T context) { + return (context.getTimeUnit() == null); + } + + @objid ("07af3779-0157-409b-9537-ea45d0c3fc8a") + @Override + public String getDescription(T elt) { + return "Schedule : " + elt.getName() + " must have a related TimeUnit"; + } + + @objid ("880fc4d1-71ae-49aa-bc0d-5eadd6c7c7c9") + @Override + public String getRuleId() { + return Rule0611.RULEID; + } + + @objid ("2a8b40a3-dbf9-43ee-bdbe-ffc4822184cd") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0612.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0612.java new file mode 100644 index 00000000..cb49412f --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0612.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("bf897d24-6fc6-460f-95c6-6028f9eef7cd") +public class Rule0612 extends AbstractRule { + @objid ("30fd5cc3-15cd-4027-99f4-d5be0ff41ae0") + private static final String RULEID = "R0612"; + + @objid ("74ed9f7a-650f-42e9-ba61-9d56ce8d067e") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getRepetitions()); + } + + @objid ("78ef0f20-fad5-45eb-9c59-74c304b21334") + @Override + public String getDescription(T elt) { + return "Schedule : " + elt.getName() + " must have a repetition value"; + } + + @objid ("8b627288-b415-478c-a0f7-af1fc89cc782") + @Override + public String getRuleId() { + return Rule0612.RULEID; + } + + @objid ("5fe701b6-cad4-4d98-92da-b8b9c38de555") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0613.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0613.java new file mode 100644 index 00000000..83aa3467 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0613.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("56de93a7-22d0-4d3b-bb21-e9a66bac8cc2") +public class Rule0613 extends AbstractRule { + @objid ("09c531ce-8b0a-4fa6-bc2a-7eb1739e81ff") + private static final String RULEID = "R0613"; + + @objid ("452289d0-34b0-4ef5-9be2-a87f54f2cc86") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getInterval()); + } + + @objid ("9d44c310-cddd-407d-98cc-4067ac37eb5b") + @Override + public String getDescription(T elt) { + return "Schedule : " + elt.getName() + " must have an interval value"; + } + + @objid ("1432b179-9097-462c-b8a6-d57aa4f8936c") + @Override + public String getRuleId() { + return Rule0613.RULEID; + } + + @objid ("f472edf4-8dc3-437e-a39e-34d7a2647b69") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0614.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0614.java new file mode 100644 index 00000000..203e4484 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0614.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("dacbe6b4-ebdf-4ac7-bb6f-d478e0433ea4") +public class Rule0614 extends AbstractRule { + @objid ("a37d9a81-5e17-46a9-9e5f-13e674ba488c") + private static final String RULEID = "R0614"; + + @objid ("c574fd61-5c60-4c90-acd6-dc945f4b1d84") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'Schedule: ' + self.name + ' should have a correct interval', + // status : Boolean = + // asError(interval >0) + // }.status + return false; + } + + @objid ("a64e256c-a2a8-4018-9cfe-337ff09de1d0") + @Override + public String getDescription(T elt) { + return "Schedule : " + elt.getName() + " must have a correct interval"; + } + + @objid ("ccdf698c-8436-4b21-9b3c-eaba3929c4e7") + @Override + public String getRuleId() { + return Rule0614.RULEID; + } + + @objid ("27ffa53f-a535-4aa0-99fa-be0f90497c7b") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0615.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0615.java new file mode 100644 index 00000000..9e1955ce --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0615.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("86a02f1a-4ed0-44ed-85e0-656ebe33a8b3") +public class Rule0615 extends AbstractRule { + @objid ("28ae2699-3c02-47e6-aefa-3794ea080302") + private static final String RULEID = "R0615"; + + @objid ("8de5df14-ff59-41ee-9971-3634fe704fe3") + @Override + public boolean isViolated(T context) { + return (context.getTimeUnit() == null); + } + + @objid ("c49c6ecb-c4ce-4fe0-9008-a22b0536c26a") + @Override + public String getDescription(T elt) { + return "Window : " + elt.getName() + " must have a specified TimeUnit"; + } + + @objid ("c46d809a-b73f-4862-97b7-bfa90e0b6873") + @Override + public String getRuleId() { + return Rule0615.RULEID; + } + + @objid ("4db7b3dd-6b83-4aec-8fed-85e515a6a557") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0616.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0616.java new file mode 100644 index 00000000..d6425696 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0616.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("f8b26b87-ac48-44e4-a2f6-cfeb41a8f8f8") +public class Rule0616 extends AbstractRule { + @objid ("57d5f779-81c5-4142-983c-ffcb8a6316a6") + private static final String RULEID = "R0616"; + + @objid ("9fea0378-e304-41cd-8395-b079ec957c57") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getWindowType()); + } + + @objid ("01e815e0-b89d-4169-bdad-8dc5b56b5d8e") + @Override + public String getDescription(T elt) { + return "Window : " + elt.getName() + " must have a specified Window type"; + } + + @objid ("67c76cf1-d6de-43e2-9e40-057f49f0243b") + @Override + public String getRuleId() { + return Rule0616.RULEID; + } + + @objid ("fdb49fd2-26d7-4319-95c6-6d3c7f351231") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0617.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0617.java new file mode 100644 index 00000000..70932a71 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0617.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("26f7edc6-bebd-4511-a7ab-36327312d7e0") +public class Rule0617 extends AbstractRule { + @objid ("868631fe-caea-4cd3-b612-61a5aa65eeb9") + private static final String RULEID = "R0617"; + + @objid ("f4c7e7e1-bb1e-44a0-83a0-1f1865825f08") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getSizeType()); + } + + @objid ("a0ac7c31-ca48-478c-bfde-2f4902403eed") + @Override + public String getDescription(T elt) { + return "Window : " + elt.getName() + " must have a specified size type"; + } + + @objid ("c33051a5-6412-45ca-844d-8c02a9ef22c3") + @Override + public String getRuleId() { + return Rule0617.RULEID; + } + + @objid ("86a6cbfd-dd6f-4b3b-98f2-66057ea21013") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0618.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0618.java new file mode 100644 index 00000000..901abac3 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0618.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("7becaf30-65b8-499f-9011-f7ee6b8cfac9") +public class Rule0618 extends AbstractRule { + @objid ("500199b5-d4b0-41b7-a351-2065df14efaa") + private static final String RULEID = "R0618"; + + @objid ("22795ff0-7040-414d-b98c-3cb87ed604a5") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getMeasurementSize()); + } + + @objid ("21e0443a-e76b-4ea3-acaa-a57d7af3f3b9") + @Override + public String getDescription(T elt) { + return "Window : " + elt.getName() + " must have a specified measurement size."; + } + + @objid ("711173f4-4da7-4a0e-b923-d7ea561b2dcf") + @Override + public String getRuleId() { + return Rule0618.RULEID; + } + + @objid ("ce1b5b3f-413b-4c76-ab78-e5a520c906dc") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0619.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0619.java new file mode 100644 index 00000000..752e1aa1 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0619.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("dbd4b6fd-fd32-40a5-a96a-4d893a8327af") +public class Rule0619 extends AbstractRule { + @objid ("280c7561-91e3-4279-a16a-b5c296c9a9d8") + private static final String RULEID = "R0619"; + + @objid ("32df242c-0533-405d-bf90-411bd094e193") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getTimeSize()); + } + + @objid ("cd94aa19-73e0-4008-a80a-6aef0dd1fd51") + @Override + public String getDescription(T elt) { + return "Window : " + elt.getName() + " must have a specified time size."; + } + + @objid ("9f07f40a-a3fe-444e-9b9a-5a8460d23da0") + @Override + public String getRuleId() { + return Rule0619.RULEID; + } + + @objid ("49ce46d5-4794-46d5-a9e6-37d56c358df6") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0620.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0620.java new file mode 100644 index 00000000..5456b73a --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0620.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricContext; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("5f086c76-1300-4cb1-abe1-b95b8c5b1a6b") +public class Rule0620 extends AbstractRule { + @objid ("fb6fb80d-d4b8-4bae-bfa4-5fc3e10c0ec0") + private static final String RULEID = "R0620"; + + @objid ("d1a7a6c9-72cc-41f7-9f6f-5e05d94c5a94") + @Override + public boolean isViolated(T context) { + return (context.getMetric() == null); + } + + @objid ("f60e2b2f-a7f1-4aec-aa84-952ba442dfdd") + @Override + public String getDescription(T elt) { + return "MetricContext : " + elt.getName() + " must have a related Metric."; + } + + @objid ("7faf8d96-80bf-4276-9eaa-63b920c69555") + @Override + public String getRuleId() { + return Rule0620.RULEID; + } + + @objid ("ec226acb-5eab-452d-9ecf-73c5abb3fbbd") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0621.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0621.java new file mode 100644 index 00000000..de9611ea --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0621.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.RawMetricContext; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("0ffd863b-b662-41ac-9145-6913a530eeb9") +public class Rule0621 extends AbstractRule { + @objid ("bd7f13cd-fc96-45c1-9ff5-d1a08d6c4204") + private static final String RULEID = "R0621"; + + @objid ("c28b1456-d968-4634-a6c6-9b5d0936ee76") + @Override + public boolean isViolated(T context) { + return (context.getSensor() == null); + } + + @objid ("66b60a74-d7af-40c4-93b1-578dc556dcfb") + @Override + public String getDescription(T elt) { + return "RawMetricContext : " + elt.getName() + " must have a related Sensor."; + } + + @objid ("0c0626ef-2969-40ff-aa2a-55cdac734383") + @Override + public String getRuleId() { + return Rule0621.RULEID; + } + + @objid ("9d529f63-4129-443b-9587-dd716136eb30") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0622.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0622.java new file mode 100644 index 00000000..f8b337ab --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0622.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.AttributeContext; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("acbca515-a20c-4097-97ed-44c1af372f30") +public class Rule0622 extends AbstractRule { + @objid ("3a2daa28-5435-45bf-8cda-d3590cb3ea3f") + private static final String RULEID = "R0622"; + + @objid ("db405b72-5da6-4e78-90a3-e4fd535cfafc") + @Override + public boolean isViolated(T context) { + return (context.getAttribute() == null); + } + + @objid ("c3bf0718-6a4a-453c-8159-3af2e8e0cb26") + @Override + public String getDescription(T elt) { + return "AttributeContext : " + elt.getName() + " must have a related Attribute."; + } + + @objid ("fc17ef21-4de2-4f76-8785-68389dd0fb8e") + @Override + public String getRuleId() { + return Rule0622.RULEID; + } + + @objid ("9cb7adca-9ebc-4eac-9474-73cd72cd0cb0") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0623.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0623.java new file mode 100644 index 00000000..183105f6 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0623.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Function; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("35d9c9c5-53b0-4b94-97ac-31da639a8956") +public class Rule0623 extends AbstractRule { + @objid ("05512337-0619-4d03-aaeb-4c6c7e18da99") + private static final String RULEID = "R0623"; + + @objid ("2dac1708-188e-44c9-a583-f7b67b7baaa8") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getExpression()); + } + + @objid ("5fbd6b0f-7763-43ad-99e5-eb679cda1e5d") + @Override + public String getDescription(T elt) { + return "Function : " + elt.getName() + " must have an expression."; + } + + @objid ("0a1f371d-112e-445f-a913-52e4b71bfd1b") + @Override + public String getRuleId() { + return Rule0623.RULEID; + } + + @objid ("6876c3ce-e25e-4508-9463-2ee4551ba631") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0624.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0624.java new file mode 100644 index 00000000..feb90f9a --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0624.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Function; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("b666a537-814e-4104-9a25-df00c1c952d7") +public class Rule0624 extends AbstractRule { + @objid ("a01a9910-5638-470f-8804-fe71bc8f0928") + private static final String RULEID = "R0624"; + + @objid ("9ce741d9-0b13-4558-ae29-c97c1934d209") + @Override + public boolean isViolated(T context) { + return context.getArguments().size() == 0; + } + + @objid ("e227efce-8cbb-4467-89d8-263b252e78d6") + @Override + public String getDescription(T elt) { + return "Function : " + elt.getName() + " must have at least one arguments."; + } + + @objid ("5af10dcc-5319-4b0c-89fb-87cbab9b7773") + @Override + public String getRuleId() { + return Rule0624.RULEID; + } + + @objid ("d3e59ba9-11ec-43be-8a26-2ac629ba0987") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0625.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0625.java new file mode 100644 index 00000000..db25526a --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0625.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricTemplate; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("9e7324a5-280f-4fa7-b604-9ff5398f6593") +public class Rule0625 extends AbstractRule { + @objid ("1bdb04db-a884-48bf-a4d1-4c13bd87a395") + private static final String RULEID = "R0625"; + + @objid ("67124aa3-249c-4e42-b39a-1b5e1a179bcb") + @Override + public boolean isViolated(T context) { + return (context.getUnit() == null); + } + + @objid ("227d32f8-047d-485d-837e-f71bc6ae7424") + @Override + public String getDescription(T elt) { + return "MetricTemplate : " + elt.getName() + " must have a Unit."; + } + + @objid ("df81c018-6ca1-4b88-94d1-043e890dac86") + @Override + public String getRuleId() { + return Rule0625.RULEID; + } + + @objid ("fdcf4aaa-239f-487e-9ed6-a8b5a75da8e4") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0626.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0626.java new file mode 100644 index 00000000..5d4514f1 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0626.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricTemplate; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("6f8ca272-c0d1-4b12-88cc-26d70a33892a") +public class Rule0626 extends AbstractRule { + @objid ("66b3da4f-589c-4882-a756-8397f07dd036") + private static final String RULEID = "R0626"; + + @objid ("687e0069-001a-40e6-92dc-cf700ae17a74") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getValueDirection()); + } + + @objid ("4d91e3de-eee9-4fcc-86ad-db8dbea6dccf") + @Override + public String getDescription(T elt) { + return "MetricTemplate : " + elt.getName() + " must have a ValueDirection."; + } + + @objid ("e2effe39-4a42-4e62-9d35-525d5e998bd8") + @Override + public String getRuleId() { + return Rule0626.RULEID; + } + + @objid ("74b96df4-9109-42e8-b377-a590bf86ad60") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0627.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0627.java new file mode 100644 index 00000000..c3d22f3f --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0627.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricTemplate; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("d330ab7d-3faa-4f48-a7c8-72ac2d658625") +public class Rule0627 extends AbstractRule { + @objid ("d837af9a-5225-488e-a049-9075fee67118") + private static final String RULEID = "R0627"; + + @objid ("47e3560e-c3fa-4fbc-a616-fa2b182cdf26") + @Override + public boolean isViolated(T context) { + return (context.getAttribute() == null); + } + + @objid ("a0068a64-b16b-4279-a48a-f231401f0ba8") + @Override + public String getDescription(T elt) { + return "MetricTemplate : " + elt.getName() + " must have a related MeasurableAttribute."; + } + + @objid ("90deb4bb-90ff-4b08-acf2-3a87ec1b39bc") + @Override + public String getRuleId() { + return Rule0627.RULEID; + } + + @objid ("cde3851b-a416-4357-967e-89a6e7fa10c5") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0628.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0628.java new file mode 100644 index 00000000..47fd367e --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/metric/Rule0628.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.metric; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.metricmodel.standard.package_.MetricInstanceModel; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("70f9254b-af15-4d71-8c50-d4b37d06611b") +public class Rule0628 extends AbstractRule { + @objid ("1738da95-a2a7-42d7-8eda-c154fa5e109a") + private static final String RULEID = "R0628"; + + @objid ("87b9b2d3-c310-4749-baac-d284443fcb38") + @Override + public boolean isViolated(T context) { + return (context.getType() == null); + } + + @objid ("658c9f77-d6e2-40f3-9541-b669f394872d") + @Override + public String getDescription(T elt) { + return "MetricInstanceModel : " + elt.getName() + " must be typed."; + } + + @objid ("edb5bd91-3b8f-44ee-80d3-4faa450eb8f4") + @Override + public String getRuleId() { + return Rule0628.RULEID; + } + + @objid ("b118efe9-2a16-4af0-85ce-eb0b81e3473b") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0801.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0801.java index 93ccf2fc..12b9cb0e 100644 --- a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0801.java +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0801.java @@ -1,25 +1,26 @@ package fr.softeam.cameldesigner.audit.rule.requirement; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.OSRequirement; import fr.softeam.cameldesigner.audit.CheckerPlan; import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; @objid ("c56fa63d-a4ac-434a-ace0-ef2f4cb27b25") -public class Rule0801 extends AbstractRule { +public class Rule0801 extends AbstractRule { @objid ("53bf269a-aa2b-4e79-8ae7-cccf7617ba49") - private static final String RULEID = "R0301"; + private static final String RULEID = "R0801"; @objid ("61049f6d-25eb-4780-8d02-3e288dd9d865") @Override public boolean isViolated(T context) { - return (context.getType() == null); + return StringUtils.isNullOrEmpty(context.getOs()); } @objid ("04f87a08-b7cd-48a8-9531-c63e3314361c") @Override public String getDescription(T elt) { - return "Type of " + elt.getName() + " has not been defined."; + return "OSRequirement : " + elt.getName() + " must have a specified OS."; } @objid ("ec0ae2c3-2758-4ec4-bd0b-740dba2ec24f") diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0802.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0802.java new file mode 100644 index 00000000..bb193d48 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0802.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.SecurityRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("fa7f8302-c7a5-4eb7-b0e8-62f87540d4e2") +public class Rule0802 extends AbstractRule { + @objid ("2afd9211-b8f6-454e-a8b5-00def711d2ee") + private static final String RULEID = "R0802"; + + @objid ("dd0f8a7e-ce9d-4b36-8533-b82ba75bf2b9") + @Override + public boolean isViolated(T context) { + return (context.getSecurityControls().size() == 0); + } + + @objid ("0e5962a5-988d-4b22-b72d-8bdaafcf2663") + @Override + public String getDescription(T elt) { + return "SecurityRequirement : " + elt.getName() + " must be related to at least one SecurityControl."; + } + + @objid ("d58a0b0e-a00b-412e-9461-179c474451c5") + @Override + public String getRuleId() { + return Rule0802.RULEID; + } + + @objid ("9d4c4ea6-c6f9-4749-b3b9-cb2a6fe0bd92") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0803.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0803.java new file mode 100644 index 00000000..d961e716 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0803.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.LocationRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("9aee32e0-5659-4db4-ac4f-f1246340d511") +public class Rule0803 extends AbstractRule { + @objid ("bf3ea42d-1aaf-4f9e-8723-b8f7d4198753") + private static final String RULEID = "R0803"; + + @objid ("c6563166-ccf0-4375-a6c4-f658b56f6e51") + @Override + public boolean isViolated(T context) { + return (context.getLocations().size() == 0); + } + + @objid ("b14cbad1-f2ac-4655-909e-33bd2dab4f1e") + @Override + public String getDescription(T elt) { + return "LocationRequirement : " + elt.getName() + " must be related to at least one Location."; + } + + @objid ("3988e08a-08f1-46bf-966c-cd54aa0b4280") + @Override + public String getRuleId() { + return Rule0803.RULEID; + } + + @objid ("693a410d-b2e7-4032-ace4-43d29626a3cb") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0804.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0804.java new file mode 100644 index 00000000..f00cdf00 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0804.java @@ -0,0 +1,37 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.enumeration.ImageRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("604830d8-62a8-4c4a-9a15-cc17dfe67bd7") +public class Rule0804 extends AbstractRule { + @objid ("1e1e5485-addb-454b-906d-9442cc85e432") + private static final String RULEID = "R0804"; + + @objid ("e6340109-e806-44a3-8f58-2e54cd103041") + @Override + public boolean isViolated(T context) { + return (context.getImages().size() == 0); + } + + @objid ("1b369848-d174-495b-8c30-3ffff60e12c2") + @Override + public String getDescription(T elt) { + return "ImageRequirement : " + elt.getName() + " must be related to at least one Image."; + } + + @objid ("36716878-005f-4359-96c9-ac7961c73d75") + @Override + public String getRuleId() { + return Rule0804.RULEID; + } + + @objid ("b5676080-4f5f-4269-871d-34e165b25fc5") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0805.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0805.java new file mode 100644 index 00000000..143414e0 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0805.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.HorizontalScaleRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("cb953698-7b41-4c0b-8455-5d45c7764362") +public class Rule0805 extends AbstractRule { + @objid ("e5d1879c-dba9-4e3d-90aa-1cbb3f42483d") + private static final String RULEID = "R0805"; + + @objid ("af900048-ba33-4b10-ae02-b2170d1887cb") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getMinInstances()); + } + + @objid ("716e2c21-ea5b-48ff-b4de-0b7676850d0d") + @Override + public String getDescription(T elt) { + return "HorizontalScaleRequirement : " + elt.getName() + " must specified one min instance."; + } + + @objid ("6e6f0209-3615-496f-84d1-4633fa3abfa8") + @Override + public String getRuleId() { + return Rule0805.RULEID; + } + + @objid ("69ddb2c9-4434-4fe3-8c06-2de07ec51490") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0806.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0806.java new file mode 100644 index 00000000..83897117 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0806.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.HorizontalScaleRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("33380e2e-a71e-4e32-b74a-6c87eb6e5046") +public class Rule0806 extends AbstractRule { + @objid ("507a46ba-e1a9-496d-a1d9-4225760fdda8") + private static final String RULEID = "R0806"; + + @objid ("53d55f49-3984-442f-af7b-e11dd23c84aa") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getMaxInstances()); + } + + @objid ("828ef191-1f34-4d0d-8ec8-746056bf8df8") + @Override + public String getDescription(T elt) { + return "HorizontalScaleRequirement : " + elt.getName() + " must specified one max instance."; + } + + @objid ("612c60aa-0e2a-4f29-b4fe-dbbd88aacd46") + @Override + public String getRuleId() { + return Rule0806.RULEID; + } + + @objid ("d074b37f-ec7c-40e5-8f8e-246c90b47945") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0807.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0807.java new file mode 100644 index 00000000..ce76adf3 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0807.java @@ -0,0 +1,43 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.HorizontalScaleRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("22b4927e-127e-4bee-ba56-5c4ed23cf508") +public class Rule0807 extends AbstractRule { + @objid ("fd746585-8382-4de7-aa20-ee6ab3e2f654") + private static final String RULEID = "R0807"; + + @objid ("7cf31514-5981-4ec9-b73e-12e7a3c97566") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'HorizontalScaleRequirement: ' + self.name + ' has wrong values for the minInstances and/or maxInstance properties. The minInstances value should be non-negative, the maxInstances value positive or equal to -1, and when maxInstances value is positive, then minInstances value should not be greater than it', + // status : Boolean = + // asError(self.minInstances >= 0 and (self.maxInstances > 0 or self.maxInstances = - 1) and + // (self.maxInstances <> - 1 implies self.minInstances<= self.maxInstances)) + // }.status + return false; + } + + @objid ("b74a1478-361e-49fe-a6bd-4a7e1f311e53") + @Override + public String getDescription(T elt) { + return "HorizontalScaleRequirement : " + elt.getName() + " must specified consistantes instance."; + } + + @objid ("6c9173c0-92c2-4cd8-a3d1-ff549d84766a") + @Override + public String getRuleId() { + return Rule0807.RULEID; + } + + @objid ("6223d390-8c95-46fa-818b-3904e5b9980f") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0808.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0808.java new file mode 100644 index 00000000..bceeee3b --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0808.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.VerticalScaleRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("ad78fe89-10a0-4106-a216-f76ac782842b") +public class Rule0808 extends AbstractRule { + @objid ("5caa3c7d-c290-4715-8790-23d9701634d1") + private static final String RULEID = "R0808"; + + @objid ("e43773f0-4aee-42af-bbb2-bf62e3f7429f") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'VerticalScaleRequirement: ' + self.name + ' should have at least one feature or attribute being specified', + // status : Boolean = + // asError(self.subFeatures->size() <> 0 xor self.attributes->size() <> 0) + // }.status + return false; + } + + @objid ("c150cab0-e135-4e22-a478-f4b10eadcc9a") + @Override + public String getDescription(T elt) { + return "VerticalScaleRequirement : " + elt.getName() + " must specified consistantes instance."; + } + + @objid ("c5cfd237-622a-4059-ab97-a70cbde61fad") + @Override + public String getRuleId() { + return Rule0808.RULEID; + } + + @objid ("3e32aadb-7e6c-4999-b9ac-a5bb0db4b722") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0809.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0809.java new file mode 100644 index 00000000..c326c9d8 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0809.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.OptimisationRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("cfbe4eb1-7124-4b88-89b1-e2a6307ebb18") +public class Rule0809 extends AbstractRule { + @objid ("6d93314a-7fd5-4e49-a37d-03146b8f7833") + private static final String RULEID = "R0809"; + + @objid ("68ab8dc3-a5a6-4ffa-8e88-ae0f3c5c69e3") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'In OptimizationRequirement: ' + self.name + ' either a metric context or a metric variable must given', + // status : Boolean = + // asError((metricContext <> null and metricVariable = null) xor (metricContext = null and metricVariable <> null)) + // }.status + return false; + } + + @objid ("5b7ec428-1a8d-4688-8355-8655603d386f") + @Override + public String getDescription(T elt) { + return "OptimisationRequirement : " + elt.getName() + " must specified consistantes instance."; + } + + @objid ("d8a59785-ec3c-4c0e-bc38-1ef5ec36b063") + @Override + public String getRuleId() { + return Rule0809.RULEID; + } + + @objid ("f8a41e3f-9e62-472d-ad01-2740bc85ace2") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0810.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0810.java new file mode 100644 index 00000000..97ff15bf --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0810.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.generalclass.SoftRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("1f929a3a-b9f8-4bb3-a2b5-c9cf963dfb81") +public class Rule0810 extends AbstractRule { + @objid ("b9cae5d8-e462-4613-8c1f-169e788905cc") + private static final String RULEID = "R0810"; + + @objid ("a417473b-7f56-4ea3-8490-5e9fc59f8e67") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'Requirement: ' + self.name + ' has a negative priority: ' + self.priority.toString(), + // status : Boolean = + // asError(self.priority >= 0.0) + // }.status + return false; + } + + @objid ("e0fbaaeb-35d5-4167-9dc8-9f54538d4baf") + @Override + public String getDescription(T elt) { + return "SoftRequirement : " + elt.getName() + " must specified consistantes instance."; + } + + @objid ("8d40d118-4031-47f4-90c1-2dcebe3d1812") + @Override + public String getRuleId() { + return Rule0810.RULEID; + } + + @objid ("71864286-faf1-4894-af34-b3827522f64b") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0811.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0811.java new file mode 100644 index 00000000..a1cb8831 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0811.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.generalclass.SoftRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; +import fr.softeam.cameldesigner.utils.StringUtils; + +@objid ("c57ce2ee-535d-46ce-8f4b-54e566d11d46") +public class Rule0811 extends AbstractRule { + @objid ("0f8b7b51-79c9-4206-bea8-e31e16ba7526") + private static final String RULEID = "R0811"; + + @objid ("8f93b299-5b0b-43ab-a2b2-ee630bc89dc7") + @Override + public boolean isViolated(T context) { + return StringUtils.isNullOrEmpty(context.getPriority()); + } + + @objid ("6e5f8cce-7533-4d20-8d2a-16130d214f63") + @Override + public String getDescription(T elt) { + return "SoftRequirement : " + elt.getName() + " must specified one priority."; + } + + @objid ("6392f446-6f5b-4167-a545-5d354e1c2e4a") + @Override + public String getRuleId() { + return Rule0811.RULEID; + } + + @objid ("a57568c6-f78b-44d5-af53-e71e74ed4d9c") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0812.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0812.java new file mode 100644 index 00000000..f9c01c8f --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0812.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ResourceRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("aa24d2e7-f569-496b-995e-128266c1c192") +public class Rule0812 extends AbstractRule { + @objid ("259e1290-dff0-4e39-b321-662d32b9afb2") + private static final String RULEID = "R0812"; + + @objid ("1f31323d-0395-484b-a9ab-8d505dfb36b5") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'ResourceRequirement: ' + self.name + ' should have at least one feature or attribute being specified', + // status : Boolean = + // asError(self.subFeatures->size() > 0 or self.attributes->size() > 0) + // }.status + return false; + } + + @objid ("acd8fc84-5127-4910-a921-4776786e4c05") + @Override + public String getDescription(T elt) { + return "ResourceRequirement : " + elt.getName() + " must specified one priority."; + } + + @objid ("d03283cb-d6ae-4e7b-bb73-4206763962df") + @Override + public String getRuleId() { + return Rule0812.RULEID; + } + + @objid ("39c576a0-2a04-4615-9571-ceb63772dd5d") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0813.java b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0813.java new file mode 100644 index 00000000..c40c6c6f --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/audit/rule/requirement/Rule0813.java @@ -0,0 +1,42 @@ +package fr.softeam.cameldesigner.audit.rule.requirement; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.PaaSRequirement; +import fr.softeam.cameldesigner.audit.CheckerPlan; +import fr.softeam.cameldesigner.audit.rule.AbstractRule; + +@objid ("c26ec26c-0b71-4210-a3cf-033a6fec0884") +public class Rule0813 extends AbstractRule { + @objid ("0b858c1c-5b5a-469d-9796-bffae739cf3f") + private static final String RULEID = "R0813"; + + @objid ("fb15f063-2dd9-4594-9522-4f9c244c3b38") + @Override + public boolean isViolated(T context) { + // Tuple { + // message : String = 'PaaSRequirement: ' + self.name + ' should have at least one feature or attribute being specified', + // status : Boolean = + // asError(self.subFeatures->size() > 0 or self.attributes->size() > 0) + // }.status + return false; + } + + @objid ("1037de8a-d73b-4a23-9d7d-4d499717503c") + @Override + public String getDescription(T elt) { + return "PaaSRequirement : " + elt.getName() + " must specified one priority."; + } + + @objid ("c538c5a1-df1d-4136-9aaa-7ea3799767e5") + @Override + public String getRuleId() { + return Rule0813.RULEID; + } + + @objid ("c57bd444-a135-4bf9-b786-45db37217bc3") + @Override + public void registerRule(CheckerPlan plan) { + plan.registerRule(T.STEREOTYPE_NAME, this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/HostingPortExporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/HostingPortExporter.java index 15a3d5b3..09656cdf 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/HostingPortExporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/HostingPortExporter.java @@ -19,23 +19,6 @@ public HostingPortExporter(T elt) { @objid ("5e2d5a6f-e740-4cae-928c-f02f2e3d5c1c") @Override public CDOObject createCamelElt(CDOObject context) { - int orientation = this._element.getElement().getDirection().getValue(); - - if (this._element.getElement().isStereotyped(ICamelDesignerPeerModule.MODULE_NAME, CommunicationPort.STEREOTYPE_NAME)) { - - if (orientation==PortOrientation.IN_VALUE) - return DeploymentFactory.eINSTANCE.createRequiredCommunication(); - else - return DeploymentFactory.eINSTANCE.createProvidedCommunication(); - } - - else if(this._element.getElement().isStereotyped(ICamelDesignerPeerModule.MODULE_NAME, HostingPort.STEREOTYPE_NAME)) { - - if (orientation==PortOrientation.IN_VALUE) - return DeploymentFactory.eINSTANCE.createRequiredHost(); - else - return DeploymentFactory.eINSTANCE.createProvidedHost(); - } return super.createCamelElt(context); } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/RequiredHostExporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/RequiredHostExporter.java index 75cc1acf..90506dfa 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/RequiredHostExporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/exporter/deployment/RequiredHostExporter.java @@ -29,7 +29,11 @@ public void setProperties(CDOObject elt) { public void attach(CDOObject elt, CDOObject context) { if ((context instanceof camel.deployment.SoftwareComponent) && (elt instanceof camel.deployment.RequiredHost)) { ((camel.deployment.SoftwareComponent) context).setRequiredHost((camel.deployment.RequiredHost) elt); - }else { + + }else if ((context instanceof camel.deployment.Container) && (elt instanceof camel.deployment.RequiredHost)) { + ((camel.deployment.Container) context).setRequiredHost((camel.deployment.RequiredHost) elt); + + }else { super.attach(elt, context); } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/CamelContainment.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/CamelContainment.java index 87ca12ec..468756eb 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/CamelContainment.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/CamelContainment.java @@ -3,323 +3,86 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import camel.constraint.AttributeConstraint; -import camel.constraint.CompositeConstraint; -import camel.constraint.Constraint; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; import camel.constraint.IfThenConstraint; -import camel.constraint.LogicalConstraint; -import camel.constraint.MetricConstraint; -import camel.constraint.MetricVariableConstraint; -import camel.constraint.UnaryConstraint; -import camel.core.Action; import camel.core.Attribute; import camel.core.CamelModel; import camel.core.Feature; -import camel.core.MeasurableAttribute; -import camel.core.QualityAttribute; import camel.data.Data; import camel.data.DataInstance; import camel.data.DataInstanceModel; -import camel.data.DataModel; -import camel.data.DataSource; -import camel.data.DataSourceInstance; import camel.data.DataTypeModel; -import camel.deployment.BuildConfiguration; import camel.deployment.ClusterConfiguration; import camel.deployment.Communication; -import camel.deployment.CommunicationPort; import camel.deployment.Component; -import camel.deployment.ComponentRelation; -import camel.deployment.Configuration; import camel.deployment.Container; -import camel.deployment.DeploymentModel; import camel.deployment.DeploymentTypeModel; import camel.deployment.EventConfiguration; import camel.deployment.Hosting; -import camel.deployment.HostingPort; -import camel.deployment.LocationCoupling; -import camel.deployment.PaaS; -import camel.deployment.PaaSConfiguration; -import camel.deployment.ProvidedCommunication; -import camel.deployment.ProvidedHost; -import camel.deployment.RequiredCommunication; -import camel.deployment.RequiredHost; -import camel.deployment.RequirementSet; -import camel.deployment.ScriptConfiguration; import camel.deployment.ServerlessConfiguration; import camel.deployment.SoftwareComponent; import camel.deployment.VM; -import camel.execution.ActionInstance; -import camel.execution.ApplicationMeasurement; import camel.execution.Cause; -import camel.execution.CommunicationMeasurement; -import camel.execution.ContainerMeasurement; -import camel.execution.DataMeasurement; import camel.execution.ExecutionModel; -import camel.execution.HistoryInfo; import camel.execution.HistoryRecord; -import camel.execution.Measurement; -import camel.execution.PaaSMeasurement; -import camel.execution.RuleTrigger; -import camel.execution.SLOViolation; -import camel.execution.SoftwareComponentMeasurement; -import camel.execution.VMMeasurement; import camel.location.CloudLocation; -import camel.location.GeographicalRegion; -import camel.location.Location; import camel.location.LocationModel; -import camel.metric.AttributeContext; -import camel.metric.CompositeMetric; -import camel.metric.CompositeMetricContext; -import camel.metric.Function; -import camel.metric.Metric; -import camel.metric.MetricContext; -import camel.metric.MetricInstance; import camel.metric.MetricInstanceModel; -import camel.metric.MetricModel; -import camel.metric.MetricObjectBinding; -import camel.metric.MetricTemplate; import camel.metric.MetricTypeModel; -import camel.metric.MetricVariable; -import camel.metric.ObjectContext; -import camel.metric.RawMetric; -import camel.metric.RawMetricContext; -import camel.metric.Schedule; -import camel.metric.Sensor; -import camel.metric.Window; import camel.mms.MetaDataModel; import camel.mms.MmsConcept; import camel.mms.MmsConceptInstance; -import camel.mms.MmsProperty; -import camel.mms.MmsPropertyInstance; -import camel.organisation.CloudCredentials; -import camel.organisation.CloudProvider; -import camel.organisation.Credentials; import camel.organisation.DataResourceFilter; -import camel.organisation.Entity; -import camel.organisation.ExternalIdentifier; -import camel.organisation.ModelResourceFilter; import camel.organisation.Organisation; import camel.organisation.OrganisationModel; -import camel.organisation.Permission; -import camel.organisation.PlatformCredentials; -import camel.organisation.ResourceFilter; -import camel.organisation.Role; -import camel.organisation.RoleAssignment; -import camel.organisation.ServiceResourceFilter; -import camel.organisation.SoftwareComponentResourceFilter; import camel.organisation.User; -import camel.organisation.UserGroup; -import camel.requirement.HardRequirement; -import camel.requirement.HorizontalScaleRequirement; -import camel.requirement.ImageRequirement; -import camel.requirement.LocationRequirement; -import camel.requirement.OSRequirement; -import camel.requirement.OptimisationRequirement; -import camel.requirement.PaaSRequirement; -import camel.requirement.ProviderRequirement; -import camel.requirement.Requirement; import camel.requirement.RequirementModel; import camel.requirement.ResourceRequirement; -import camel.requirement.ScaleRequirement; -import camel.requirement.SecurityRequirement; -import camel.requirement.ServiceLevelObjective; -import camel.requirement.SoftRequirement; -import camel.requirement.VerticalScaleRequirement; -import camel.scalability.BinaryEventPattern; -import camel.scalability.Event; -import camel.scalability.EventInstance; -import camel.scalability.EventPattern; -import camel.scalability.FunctionalEvent; -import camel.scalability.FunctionalEventInstance; -import camel.scalability.HorizontalScalingAction; -import camel.scalability.NonFunctionalEvent; -import camel.scalability.NonFunctionalEventInstance; import camel.scalability.ScalabilityModel; -import camel.scalability.ScalabilityRule; -import camel.scalability.ScalingAction; -import camel.scalability.SingleEvent; -import camel.scalability.Timer; -import camel.scalability.UnaryEventPattern; -import camel.scalability.VerticalScalingAction; -import camel.security.Certifiable; -import camel.security.CompositeSecurityMetric; -import camel.security.RawSecurityMetric; -import camel.security.SecurityAttribute; -import camel.security.SecurityControl; -import camel.security.SecurityDomain; -import camel.security.SecurityMetricInstance; import camel.security.SecurityModel; -import camel.security.SecuritySLO; -import camel.unit.CompositeUnit; -import camel.unit.DimensionedUnit; -import camel.unit.Dimensionless; -import camel.unit.SingleUnit; -import camel.unit.Unit; -import camel.unit.UnitDimension; import camel.unit.UnitModel; -import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelAttribute; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.camelcore.standard.package_.SubModel; -import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.CamelConstraint; -import fr.softeam.cameldesigner.exchange.importer.constraint.AttributeConstraintImporter; -import fr.softeam.cameldesigner.exchange.importer.constraint.CamelConstraintImporter; -import fr.softeam.cameldesigner.exchange.importer.constraint.CompositeConstraintImporter; import fr.softeam.cameldesigner.exchange.importer.constraint.IfThenConstraintImporter; -import fr.softeam.cameldesigner.exchange.importer.constraint.LogicalConstraintImporter; -import fr.softeam.cameldesigner.exchange.importer.constraint.MetricConstraintImporter; -import fr.softeam.cameldesigner.exchange.importer.constraint.MetricVariableConstraintImporter; -import fr.softeam.cameldesigner.exchange.importer.constraint.UnaryConstraintImporter; -import fr.softeam.cameldesigner.exchange.importer.core.ActionImporter; import fr.softeam.cameldesigner.exchange.importer.core.AttributeImporter; import fr.softeam.cameldesigner.exchange.importer.core.CamelElementImporter; import fr.softeam.cameldesigner.exchange.importer.core.CamelModelImporter; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import fr.softeam.cameldesigner.exchange.importer.core.MeasurableAttributeImporter; -import fr.softeam.cameldesigner.exchange.importer.core.QualityAttributeImporter; import fr.softeam.cameldesigner.exchange.importer.data.DataImporter; import fr.softeam.cameldesigner.exchange.importer.data.DataInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.data.DataInstanceModelImporter; -import fr.softeam.cameldesigner.exchange.importer.data.DataModelImporter; -import fr.softeam.cameldesigner.exchange.importer.data.DataSourceImporter; -import fr.softeam.cameldesigner.exchange.importer.data.DataSourceInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.data.DataTypeModelImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.BuildConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.CamelComponentImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ClusterConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationPortImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ComponentRelationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ConfigurationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ComponentImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ContainerImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.DeploymentModelImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.DeploymentTypeModelImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.EventConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.HostingImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.HostingPortImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.LocationCouplingImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.PaaSConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.PaaSImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ProvidedCommunicationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ProvidedHostImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredCommunicationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredHostImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredSetImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ScriptConfiguationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ServerlessConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.SoftwareComponentImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.VMImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.ActionInstanceImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.ApplicationMeasurementImporter; import fr.softeam.cameldesigner.exchange.importer.execution.CauseImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.CommunicationMeasurementImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.ContainerMeasurementImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.DataMeasurementImporter; import fr.softeam.cameldesigner.exchange.importer.execution.ExecutionModelImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.HistoryInfoImporter; import fr.softeam.cameldesigner.exchange.importer.execution.HistoryRecordImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.MeasurementImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.PaaSMeasurementImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.RuleTriggerImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.SLOViolationImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.SoftwareComponentMeasurementImporter; -import fr.softeam.cameldesigner.exchange.importer.execution.VMMeasurementImporter; import fr.softeam.cameldesigner.exchange.importer.location.CloudLocationImporter; -import fr.softeam.cameldesigner.exchange.importer.location.GeographicalRegionImporter; -import fr.softeam.cameldesigner.exchange.importer.location.LocationImporter; import fr.softeam.cameldesigner.exchange.importer.location.LocationModelImporter; import fr.softeam.cameldesigner.exchange.importer.metadata.MetaDataModelImporter; import fr.softeam.cameldesigner.exchange.importer.metadata.MmsConceptImporter; import fr.softeam.cameldesigner.exchange.importer.metadata.MmsConceptInstanceImporter; -import fr.softeam.cameldesigner.exchange.importer.metadata.MmsPropertyImporter; -import fr.softeam.cameldesigner.exchange.importer.metadata.MmsPropertyInstanceImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.AttributeContextImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.CompositeMetricContextImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.CompositeMetricImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.FunctionImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.MetricContextImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.MetricImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.MetricInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.metric.MetricInstanceModelImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.MetricModelImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.MetricObjectBindingImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.MetricTemplateImporter; import fr.softeam.cameldesigner.exchange.importer.metric.MetricTypeModelImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.MetricVariableImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.ObjectContextImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.RawMetricContextImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.RawMetricImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.ScheduleImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.SensorImporter; -import fr.softeam.cameldesigner.exchange.importer.metric.WindowImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.CloudCredentialsImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.CloudProviderImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.CredentialsImporter; import fr.softeam.cameldesigner.exchange.importer.organisation.DataResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.EntityImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ExternalIdentifierImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ModelResourceFilterImporter; import fr.softeam.cameldesigner.exchange.importer.organisation.OrganisationImporter; import fr.softeam.cameldesigner.exchange.importer.organisation.OrganisationModelImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.PermissionImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.PlatformCredentialsImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.RoleAssignmentImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.RoleImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ServiceResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.SoftwareComponentResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.UserGroupImporter; import fr.softeam.cameldesigner.exchange.importer.organisation.UserImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.HardRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.HorizontalScaleRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.ImageRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.LocationRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.OSRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.OptimisationRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.PaaSRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.ProviderRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.RequirementImporter; import fr.softeam.cameldesigner.exchange.importer.requirement.RequirementModelImporter; import fr.softeam.cameldesigner.exchange.importer.requirement.ResourceRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.ScaleRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.SecurityRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.ServiceLevelObjectiveImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.SoftRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.requirement.VerticalScaleRequirementImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.BinaryEventPatternImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.EventImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.EventInstanceImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.EventPatternImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.FunctionalEventImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.FunctionalEventInstanceImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.HorizontalScalingActionImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.NonFunctionalEventImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.NonFunctionalEventInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.scalability.ScalabilityModelImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.ScalabilityRuleImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.ScalingActionImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.SingleEventImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.TimerImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.UnaryEventPatternImporter; -import fr.softeam.cameldesigner.exchange.importer.scalability.VerticalScalingActionImporter; -import fr.softeam.cameldesigner.exchange.importer.security.CertifiableImporter; -import fr.softeam.cameldesigner.exchange.importer.security.CompositeSecurityMetricImporter; -import fr.softeam.cameldesigner.exchange.importer.security.RawSecurityMetricImporter; -import fr.softeam.cameldesigner.exchange.importer.security.SecurityAttributeImporter; -import fr.softeam.cameldesigner.exchange.importer.security.SecurityControlImporter; -import fr.softeam.cameldesigner.exchange.importer.security.SecurityDomainImporter; -import fr.softeam.cameldesigner.exchange.importer.security.SecurityMetricInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.security.SecurityModelImporter; -import fr.softeam.cameldesigner.exchange.importer.security.SecuritySLOImporter; -import fr.softeam.cameldesigner.exchange.importer.unit.CompositeUnitImporter; -import fr.softeam.cameldesigner.exchange.importer.unit.DimensionedUnitImporter; -import fr.softeam.cameldesigner.exchange.importer.unit.DimensionlessImporter; -import fr.softeam.cameldesigner.exchange.importer.unit.SingleUnitImporter; -import fr.softeam.cameldesigner.exchange.importer.unit.UnitDimensionImporter; -import fr.softeam.cameldesigner.exchange.importer.unit.UnitImporter; import fr.softeam.cameldesigner.exchange.importer.unit.UnitModelImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("63498b40-f2f0-4924-a856-cf2209bafd01") public class CamelContainment { @@ -332,7 +95,7 @@ public static final Object getChilds(final CamelElementImporter camelModel) { @@ -342,8 +105,10 @@ public Object visitCamelElement(CamelElementImporter camelModel) { + List childs = new ArrayList<>(); - childs.addAll((Collection) this.visitModel(camelModel)); + childs.addAll((Collection) super.visitCamelModel(camelModel)); + CamelModel cdoElt = camelModel.getElement(); childs.addAll(cdoElt.getActions()); childs.addAll(cdoElt.getConstraintModels()); @@ -359,119 +124,86 @@ public Object visitCamelModel(CamelModelImporter feature) { + public Object visitFeature(FeatureImporter feature) { + List childs = new ArrayList<>(); - childs.addAll((Collection) this.visitNamedElement(feature)); + childs.addAll((Collection) super.visitFeature(feature)); + Feature cdoElt = feature.getElement(); childs.addAll(cdoElt.getAttributes()); childs.addAll(cdoElt.getSubFeatures()); + return childs; } + @SuppressWarnings ("unchecked") @objid ("d1cc11ff-9655-4589-9bca-619af86a2eb2") @Override - public Object visitMmsConcept(MmsConceptImporter mmsConcept) { + public Object visitMmsConcept(MmsConceptImporter mmsConcept) { + List childs = new ArrayList<>(); + childs.addAll((List) super.visitMmsConcept(mmsConcept)); + MmsConcept cdoElt = mmsConcept.getElement(); childs.addAll(cdoElt.getConcept()); childs.addAll(cdoElt.getInstance()); childs.addAll(cdoElt.getProperty()); + return childs; } + @SuppressWarnings ("unchecked") @objid ("f80d57ab-c9df-4d60-b588-80029b05f48c") @Override public Object visitMetaDataModel(MetaDataModelImporter metaDataModel) { + List childs = new ArrayList<>(); - childs.addAll((Collection) this.visitModel(metaDataModel)); + childs.addAll((List) super.visitMetaDataModel(metaDataModel)); + MetaDataModel cdoElt = metaDataModel.getElement(); childs.addAll(cdoElt.getMetadataElements()); + return childs; } + @SuppressWarnings ("unchecked") @objid ("086aaca3-634e-446d-aa8f-b4487708c18e") @Override public Object visitMmsConceptInstance(MmsConceptInstanceImporter mmsConceptInstanceImporter) { + List childs = new ArrayList<>(); + childs.addAll((List) super.visitMmsConceptInstance(mmsConceptInstanceImporter)); + MmsConceptInstance cdoElt = mmsConceptInstanceImporter.getElement(); childs.addAll(cdoElt.getPropertyInstance()); - return childs; - } - @objid ("45c686c6-c9e2-4b0f-b760-0ed1c42185d5") - @Override - public Object visitMmsProperty(MmsPropertyImporter mmsPropertyImporter) { - return new ArrayList<>(); + return childs; } - @objid ("5e6250a1-784a-4133-8a20-d5a0b73eba33") - @Override - public Object visitMmsPropertyInstance(MmsPropertyInstanceImporter mmsPropertyInstanceImporter) { - return new ArrayList<>(); - } @objid ("7f8027c5-6acb-4903-aa0a-c5a45d2c97b4") @Override public Object visitSoftwareComponent(SoftwareComponentImporter softwareComponentImporter) { + List childs = new ArrayList<>(); + childs.addAll((List) super.visitSoftwareComponent(softwareComponentImporter)); + SoftwareComponent cdoElt = softwareComponentImporter.getElement(); childs.addAll(cdoElt.getRequiredCommunications()); childs.add(cdoElt.getRequiredHost()); - return childs; - } - - @objid ("4dcf8c86-505c-4b12-896e-188f65217b58") - @Override - public Object visitAttributeContext(AttributeContextImporter attributeContextImporter) { - return new ArrayList<>(); - } - - @objid ("5f623cd3-678b-4b24-af76-b4f12cdab734") - @Override - public Object visitCompositeMetric(CompositeMetricImporter compositeMetricImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("632f3097-5174-4087-8d9a-a1ffb9e8282e") - @Override - public Object visitMetric(MetricImporter metricImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("472328b4-8f2e-49fb-b0c4-e3135b53e8b5") - @Override - public Object visitCompositeMetricContext(CompositeMetricContextImporter compositeMetricContextImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("e2d2cddc-bef5-4ce0-8b31-f52a3ea2bb0f") - @Override - public Object visitMetricContext(MetricContextImporter metricContextImporter) { - // TODO Auto-generated method stub - return null; - } + childs.addAll(cdoElt.getProvidedCommunications()); + childs.addAll(cdoElt.getProvidedHosts()); + childs.addAll(cdoElt.getConfigurations()); - @objid ("120f48dd-9624-4d4e-92a2-d9fe012483f0") - @Override - public Object visitFunction(FunctionImporter functionImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("a48a8387-5c81-4732-8173-4290dd49680c") - @Override - public Object visitMetricInstance(MetricInstanceImporter metricInstanceImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("ad44e588-63c9-43e4-9e0e-c698013dc33b") @Override @@ -483,17 +215,16 @@ public Object visitMetricInstanceModell(MetricInstanceModelImporter metricModelImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("8677607a-0e79-44e8-aa3e-93d87e1393c5") @Override - public Object visitMetricTypeModel(MetricTypeModelImporter metricTypeModelImporter) { + public Object visitMetricTypeModel(MetricTypeModelImporter metricTypeModelImporter) { + + //Initialise and call super List childs = new ArrayList<>(); + childs.addAll((List) super.visitMetricTypeModel(metricTypeModelImporter)); + + //Adds MetricTypeModel childs MetricTypeModel cdoElt = metricTypeModelImporter.getElement(); childs.addAll(cdoElt.getMetricContexts()); childs.addAll(cdoElt.getAttributeContexts()); @@ -504,202 +235,76 @@ public Object visitMetricTypeModel(MetricTypeModelImporter metricObjectBindingImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("b08b268e-4854-4c7f-a80e-d05593f16775") - @Override - public Object visitMetricTemplate(MetricTemplateImporter metricTemplateImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("5ab209a9-7cf2-43ef-a4d0-ce8c47b3c287") - @Override - public Object visitMetricVariable(MetricVariableImporter metricVariableImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("96529427-51d1-43c4-8645-7f1592b18f1c") - @Override - public Object visitObjectContext(ObjectContextImporter objectContextImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("ef8cb092-e365-4992-ab4b-7228244547e9") - @Override - public Object visitRawMetricContext(RawMetricContextImporter rawMetricContextImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("d1f3e0d1-96fe-41fe-ae9d-8c369bc84810") - @Override - public Object visitRawMetric(RawMetricImporter rawMetricImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("b70a8995-72e2-41e9-a0d7-89ff5bb1243c") - @Override - public Object visitSchedule(ScheduleImporter scheduleImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("5178c80a-d3dc-47e3-af8a-b2a34c6aa83f") - @Override - public Object visitSensor(SensorImporter sensorImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("3c397e17-a2b4-4b39-80ac-42df4a730db9") - @Override - public Object visitWindow(WindowImporter windowImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("45ec9794-641b-4c2c-a79e-4ef780be627e") - @Override - public Object visitConstraint(CamelConstraintImporter camelConstraintImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("e247965a-3a8a-42e3-87d0-d2bdb5bdccbf") - @Override - public Object visitAttributeConstraint(AttributeConstraintImporter attributeConstraintImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("5066ffcb-20d5-437e-8e13-9a71a98deb6b") - @Override - public Object visitUnaryConstraint(UnaryConstraintImporter unaryConstraintImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("14e7c89b-a0d6-4b1f-b3dd-06715356cdb7") - @Override - public Object visitCompositeConstraint(CompositeConstraintImporter compositeConstraintImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("74c36b53-f93c-4416-9ce9-a2d2b8125f42") @Override public Object visitIfThenConstraint(IfThenConstraintImporter ifThenConstraintImporter) { + List childs = new ArrayList<>(); + childs.addAll((List) super.visitIfThenConstraint(ifThenConstraintImporter)); + IfThenConstraint cdoElt = ifThenConstraintImporter.getElement(); childs.add(cdoElt.getIf()); childs.add(cdoElt.getThen()); childs.add(cdoElt.getElse()); - return childs; - } - - @objid ("28ff9e08-6e47-4a65-be60-7afcde69eee2") - @Override - public Object visitLogicalConstraint(LogicalConstraintImporter logicalConstraintImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("05664f0f-790c-40f3-a8b6-794dadc4936b") - @Override - public Object visitMetricConstraint(MetricConstraintImporter metricConstraintImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("43714d9f-a72c-4239-89de-eb276a3c4419") - @Override - public Object visitMetricVariableConstraint(MetricVariableConstraintImporter metricVariableConstraintImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("58981946-7bf3-4dae-9b57-67c3a2fcd4c9") - @Override - public Object visitBuildConfiguration(BuildConfigurationImporter buildConfigurationImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("dd37ba10-bf5c-43de-8910-74bfbbeebf23") @Override public Object visitClusterConfiguration(ClusterConfigurationImporter clusterConfigurationImporter) { + List childs = new ArrayList<>(); + childs.addAll((List) super.visitClusterConfiguration(clusterConfigurationImporter)); + ClusterConfiguration cdoElt = clusterConfigurationImporter.getElement(); childs.addAll(cdoElt.getConfigParameters()); + return childs; } @objid ("1f5d48e2-8b60-436d-bfed-3340268ee935") @Override public Object visitCommunication(CommunicationImporter communicationImporter) { + List childs = new ArrayList<>(); + childs.addAll((List) super.visitCommunication(communicationImporter)); + Communication cdoElt = communicationImporter.getElement(); childs.add(cdoElt.getProvidedPortConfiguration()); childs.add(cdoElt.getRequiredPortConfiguration()); - return childs; - } - - @objid ("91200e95-9d20-48c7-8dd0-5670bb16dc1b") - @Override - public Object visitCommunicationPort(CommunicationPortImporter communicationPortImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("0f2fd748-7b90-4324-a314-559ae826bcd1") - @Override - public Object visitComponentRelation(ComponentRelationImporter componentRelationImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("2666b55b-e15f-4bec-b2af-52c6567ace5f") - @Override - public Object visitConfiguration(ConfigurationImporter configurationImporter) { - // TODO Auto-generated method stub - return null; + return childs; } @objid ("45276b2d-d379-48a5-9604-e5ddf5f3f404") @Override public Object visitContainer(ContainerImporter containerImporter) { + List childs = new ArrayList<>(); + childs.addAll((List) super.visitContainer(containerImporter)); + Container cdoElt = containerImporter.getElement(); childs.addAll(cdoElt.getRequiredCommunications()); childs.add(cdoElt.getRequiredHost()); - return childs; - } - @objid ("54bb95ef-3a78-4a9e-830c-58a33f57f965") - @Override - public Object visitDeploymentModel(DeploymentModelImporter deploymentModelImporter) { - // TODO Auto-generated method stub - return null; + return childs; } @objid ("155a41e9-0b7c-4482-aee0-883101eb47df") @Override public Object visitDeploymentTypeModel(DeploymentTypeModelImporter deploymentTypeModelImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitDeploymentTypeModel(deploymentTypeModelImporter)); + DeploymentTypeModel cdoElt = deploymentTypeModelImporter.getElement(); - childs.addAll((Collection) this.visitModel(deploymentTypeModelImporter)); childs.addAll(cdoElt.getSoftwareComponents()); childs.addAll(cdoElt.getVms()); childs.addAll(cdoElt.getPaases()); @@ -708,416 +313,230 @@ public Object visitDeploymentTypeModel(DeploymentTypeModelImporter eventConfigurationImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitEventConfiguration(eventConfigurationImporter)); + EventConfiguration cdoElt = eventConfigurationImporter.getElement(); childs.add(cdoElt.getScheduledExecutionConfig()); + return childs; } @objid ("1c4bcb3f-2884-4ddd-9c64-a24078d192d9") @Override public Object visitHosting(HostingImporter hostingImporter) { - List childs = new ArrayList<>(); - Hosting cdoElt = hostingImporter.getElement(); - childs.add(cdoElt.getProvidedHostConfiguration()); - childs.addAll(cdoElt.getRequiredHostsConfiguration()); - return childs; - } - @objid ("826e971a-0d2b-49e7-befc-14e8b12aea09") - @Override - public Object visitHostingPort(HostingPortImporter hostingPortImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("dfe92829-8d67-42a9-bbe9-53002739267c") - @Override - public Object visitLocationCoupling(LocationCouplingImporter locationCouplingImporter) { - // TODO Auto-generated method stub - return null; - } + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitHosting(hostingImporter)); - @objid ("fb770bbe-8358-4868-8e2a-bae31e6a6920") - @Override - public Object visitPaaSConfiguration(PaaSConfigurationImporter paaSConfigurationImporter) { - // TODO Auto-generated method stub - return null; - } + Hosting cdoElt = hostingImporter.getElement(); + childs.add(cdoElt.getProvidedHostConfiguration()); + childs.addAll(cdoElt.getRequiredHostsConfiguration()); - @objid ("41d96c36-9e9a-4e61-9bee-797055e4ad2b") - @Override - public Object visitPaaS(PaaSImporter paaSImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("16f3633c-f667-48d0-9a78-f65e277f9453") - @Override - public Object visitRequiredSet(RequiredSetImporter requiredSetImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("4d3756c9-256b-4341-b9af-5ede4715abda") - @Override - public Object visitScriptConfiguration(ScriptConfiguationImporter scriptConfiguationImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("24682eff-dc92-456e-990e-50019845bbc2") @Override public Object visitServelessConfiguration(ServerlessConfigurationImporter serverlessConfigurationImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitServelessConfiguration(serverlessConfigurationImporter)); + ServerlessConfiguration cdoElt = serverlessConfigurationImporter.getElement(); childs.addAll(cdoElt.getEnvironmentConfigParams()); childs.add(cdoElt.getBuildConfiguration()); childs.add(cdoElt.getEventConfiguration()); + return childs; } @objid ("51e3b824-0b33-431b-b152-edbbb998e4b5") @Override public Object visitVM(VMImporter vmImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("e807c7da-6fd6-4248-ba33-cffe1c1b5b61") - @Override - public Object visitHardRequirement(HardRequirementImporter hardRequirementImporter) { - return null; - } - - @objid ("235fa67f-6aed-425a-8442-509f939b44d7") - @Override - public Object visitHorizontalScaleRequirement(HorizontalScaleRequirementImporter horizontalScaleRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("61c0fa97-6cfc-4774-ab0e-f5b58087222c") - @Override - public Object visitImageRequirement(ImageRequirementImporter imageRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("cd2095c2-3e4d-4703-b9e6-b02be44ed71b") - @Override - public Object visitLocationRequirement(LocationRequirementImporter locationRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("d8e6cd17-0fb9-485c-93b9-62ec28f75f4e") - @Override - public Object visitOptimisationRequirement(OptimisationRequirementImporter optimisationRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("95fc504a-9512-46c0-bd1e-b364f6da6d4a") - @Override - public Object visitOSRequirement(OSRequirementImporter osRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("769280e2-c825-40f9-ac9b-3bcb23f7f02c") - @Override - public Object visitPaaSRequirement(PaaSRequirementImporter paaSRequirementImporter) { - // TODO Auto-generated method stub - return null; - } + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitVM(vmImporter)); - @objid ("778c5b95-1da6-4a40-8cd8-92b0af6db417") - @Override - public Object visitProviderRequirement(ProviderRequirementImporter providerRequirementImporter) { - // TODO Auto-generated method stub - return null; - } + VM cdoElt = vmImporter.getElement(); + childs.addAll(cdoElt.getProvidedCommunications()); + childs.addAll(cdoElt.getProvidedHosts()); + childs.addAll(cdoElt.getConfigurations()); - @objid ("b71fef49-307e-4aaf-a06d-52ea57c9cee5") - @Override - public Object visitRequirement(RequirementImporter requirementImporter) { - return null; + return childs; } @objid ("33b18893-7426-460e-9080-cfd42ac4b3a8") @Override public Object visitRequirementModel(RequirementModelImporter requirementModelImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitRequirementModel(requirementModelImporter)); + RequirementModel cdoElt = requirementModelImporter.getElement(); childs.addAll(cdoElt.getRequirements()); + return childs; } @objid ("0bc47d1c-ee02-4b85-a0bb-a4877d0ec82d") @Override public Object visitResourceRequirement(ResourceRequirementImporter resourceRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("8f502ddb-cb82-441c-84e4-50f0bef8adf2") - @Override - public Object visitScaleRequirement(ScaleRequirementImporter scaleRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("a859b9bf-e3c6-4d58-b0aa-5180bb08255d") - @Override - public Object visitSecurityRequirement(SecurityRequirementImporter securityRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("d475943c-3ba8-411b-8f6d-0e8434e46d00") - @Override - public Object visitServiceLevelObjective(ServiceLevelObjectiveImporter serviceLevelObjectiveImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("c3c9fac2-eeae-455e-bb46-c311e1808d52") - @Override - public Object visitSoftRequirement(SoftRequirementImporter softRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("6fcb9af6-0feb-4dc6-bc2b-69484f5b8024") - @Override - public Object visitVerticalScaleRequirement(VerticalScaleRequirementImporter verticalScaleRequirementImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("0ae0cebe-5556-422d-8e0c-5ff36d26c39b") - @Override - public Object visitActionInstance(ActionInstanceImporter actionInstanceImporter) { - // TODO Auto-generated method stub - return null; - } + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitResourceRequirement(resourceRequirementImporter)); - @objid ("ad1a0e69-b9ab-481b-bd73-0d6a8a300124") - @Override - public Object visitMeasurement(MeasurementImporter measurementImporter) { - // TODO Auto-generated method stub - return null; - } + ResourceRequirement cdoElt = resourceRequirementImporter.getElement(); + childs.addAll(cdoElt.getSubFeatures()); + childs.addAll(cdoElt.getAttributes()); - @objid ("5f2e40ea-8903-4435-9f24-bfdffe3c518b") - @Override - public Object visitApplicationMeasurement(ApplicationMeasurementImporter applicationMeasurementImporter) { - // TODO Auto-generated method stub - return null; + return childs; } @objid ("b3f83a7f-d623-4054-bf5c-033488ef3f55") @Override public Object visitCause(CauseImporter causeImporter) { + List childs = new ArrayList<>(); - Cause cdoElt = causeImporter.getElement(); - childs.addAll(cdoElt.getEventInstances()); - return childs; - } + childs.addAll((Collection) super.visitCause(causeImporter)); - @objid ("532caf5e-ebab-4b2f-b39c-28c6bdf4eee1") - @Override - public Object visitCommunicationMeasurement(CommunicationMeasurementImporter communicationMeasurementImporter) { - // TODO Auto-generated method stub - return null; - } + Cause cdoElt = causeImporter.getElement(); + childs.addAll(cdoElt.getEventInstances()); - @objid ("8626bff1-c881-4fa6-a9e3-6048d9ebd81b") - @Override - public Object visitContainerMeasurement(ContainerMeasurementImporter containerMeasurementImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("0e2f6935-4066-4ebb-85cc-f9276e41c967") - @Override - public Object visitDataMeasurement(DataMeasurementImporter dataMeasurementImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("1d7516a5-4d1f-41ca-a464-683514475939") @Override public Object visitExecutionModel(ExecutionModelImporter executionModelImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitExecutionModel(executionModelImporter)); + ExecutionModel cdoElt = executionModelImporter.getElement(); childs.addAll(cdoElt.getMeasurements()); childs.addAll(cdoElt.getSloViolations()); childs.addAll(cdoElt.getHistoryRecords()); - return childs; - } - @objid ("2ed5d25b-73ed-481c-9824-ae1a59998790") - @Override - public Object visitHistoryInfo(HistoryInfoImporter historyInfoImporter) { - // TODO Auto-generated method stub - return null; + return childs; } @objid ("bd88c197-87c2-4543-bd09-4bb1a00444fa") @Override public Object visitHistoryRecord(HistoryRecordImporter historyRecordImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitHistoryRecord(historyRecordImporter)); + HistoryRecord cdoElt = historyRecordImporter.getElement(); childs.add(cdoElt.getCause()); childs.addAll(cdoElt.getInfos()); - return childs; - } - - @objid ("7f0b97a9-06cf-4a4d-a3be-3dd7917772a4") - @Override - public Object visitPaaSMeasurement(PaaSMeasurementImporter paaSMeasurementImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("9e1cea00-20f8-4575-ab9f-5b930b8816d9") - @Override - public Object visitRuleTrigger(RuleTriggerImporter ruleTriggerImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("e48c131a-b06d-4ae0-b334-d7e26856631c") - @Override - public Object visitSLOViolation(SLOViolationImporter sloViolationImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("97cd7961-cfc9-4eb0-ac53-ea7a37e0a97d") - @Override - public Object visitSoftwareComponentMeasurement(SoftwareComponentMeasurementImporter softwareComponentMeasurementImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("8c1f3f49-3ba0-48b4-bd79-5bae2eeafdf1") - @Override - public Object visitVMMeasurement(VMMeasurementImporter vmMeasurementImporter) { - // TODO Auto-generated method stub - return null; + return childs; } @objid ("fb2562e3-76ac-4630-98a0-d72f776dd0e4") @Override public Object visitCloudLocation(CloudLocationImporter cloudLocationImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitCloudLocation(cloudLocationImporter)); + CloudLocation cdoElt = cloudLocationImporter.getElement(); childs.addAll(cdoElt.getSubLocations()); + return childs; } - @objid ("029b7f32-3c91-4c8d-9824-9c33b685f637") - @Override - public Object visitLocation(LocationImporter locationImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("118067e5-b6d8-4140-a9ba-5eaebf9ac9c5") @Override public Object visitLocationModel(LocationModelImporter locationModelImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitLocationModel(locationModelImporter)); + LocationModel cdoElt = locationModelImporter.getElement(); childs.addAll(cdoElt.getCloudLocations()); childs.addAll(cdoElt.getRegions()); - return childs; - } - @objid ("748e2a37-305d-442f-a21a-0971bb8e9c55") - @Override - public Object visitGeographicalRegion(GeographicalRegionImporter geographicalRegionImporter) { - List childs = new ArrayList<>(); - GeographicalRegion cdoElt = geographicalRegionImporter.getElement(); - childs.addAll(cdoElt.getParentRegions()); return childs; } + @objid ("d1ea27c3-a253-4cb2-8e3d-25fb04b2bc82") @Override public Object visitData(DataImporter dataImporter) { - // TODO Auto-generated method stub - return null; + + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitData(dataImporter)); + + Data cdoElt = dataImporter.getElement(); + childs.addAll(cdoElt.getIncludesData()); + + return childs; } @objid ("bd962597-f6e2-4b57-98fb-24ee8e74cf0a") @Override public Object visitDataInstance(DataInstanceImporter dataInstanceImporter) { - // TODO Auto-generated method stub - return null; + + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitDataInstance(dataInstanceImporter)); + + DataInstance cdoElt = dataInstanceImporter.getElement(); + childs.addAll(cdoElt.getIncludesDataInstance()); + + return childs; } @objid ("d4a19f91-ff80-4aac-b21c-d2a3793f30b7") @Override public Object visitDataInstanceModel(DataInstanceModelImporter dataInstanceModelImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("2c853c70-59a0-41bc-8c74-37b10fb1055c") - @Override - public Object visitDataModel(DataModelImporter dataModelImporter) { - // TODO Auto-generated method stub - return null; - } + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitDataInstanceModel(dataInstanceModelImporter)); - @objid ("0a36178d-07fe-4465-b07c-30a3fc601da1") - @Override - public Object visitDataSource(DataSourceImporter dataSourceImporter) { - // TODO Auto-generated method stub - return null; - } + DataInstanceModel cdoElt = dataInstanceModelImporter.getElement(); + childs.addAll(cdoElt.getDataInstances()); + childs.addAll(cdoElt.getDataSourceInstances()); - @objid ("add39341-552c-48bf-a4f9-f50c664f10af") - @Override - public Object visitDataSourceInstance(DataSourceInstanceImporter dataSourceInstanceImporter) { - // TODO Auto-generated method stub - return null; + return childs; } + @objid ("ac337190-2f94-48a1-b0fa-b185554f9dff") @Override public Object visitDataTypeModel(DataTypeModelImporter dataTypeModelImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("009148c3-8ff6-4e5b-b770-e6058fc9f227") - @Override - public Object visitBinaryEventPattern(BinaryEventPatternImporter binaryEventPatternImporter) { - // TODO Auto-generated method stub - return null; - } + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitDataTypeModel(dataTypeModelImporter)); - @objid ("b792c6c4-ceca-4b39-9182-d88aeeec03ef") - @Override - public Object visitEvent(EventImporter eventImporter) { - // TODO Auto-generated method stub - return null; + DataTypeModel cdoElt = dataTypeModelImporter.getElement(); + childs.addAll(cdoElt.getData()); + childs.addAll(cdoElt.getDataSources()); + + return childs; } @objid ("772c42ab-76a0-47be-9af2-cebdb273301a") @Override public Object visitScalabilityModel(ScalabilityModelImporter scalabilityModelImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitScalabilityModel(scalabilityModelImporter)); + ScalabilityModel cdoElt = scalabilityModelImporter.getElement(); childs.addAll(cdoElt.getRules()); childs.addAll(cdoElt.getEvents()); @@ -1125,183 +544,31 @@ public Object visitScalabilityModel(ScalabilityModelImporter eventInstanceImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("a197ff88-a653-41ed-bb57-396b39f463ba") - @Override - public Object visitEventPattern(EventPatternImporter eventPatternImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("3349ceb4-2cd8-4e46-a304-f000ad22ca48") - @Override - public Object visitFunctionalEvent(FunctionalEventImporter functionalEventImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("ad10556f-b17f-49fa-810d-399bcec295ad") - @Override - public Object visitFunctionalEventInstance(FunctionalEventInstanceImporter functionalEventInstanceImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("a98a871a-d34b-48b1-80b3-dc0aa81e55ef") - @Override - public Object visitHorizontalScalingAction(HorizontalScalingActionImporter horizontalScalingActionImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("b3bf0dc4-3a54-4077-8003-fadcb7cfae53") - @Override - public Object visitNonFunctionalEvent(NonFunctionalEventImporter nonFunctionalEventImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("e635a838-4ec9-4794-8910-1d508b078afc") - @Override - public Object visitNonFunctionalEventInstance(NonFunctionalEventInstanceImporter nonFunctionalEventInstanceImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("64f1b76e-7ffe-4078-afed-c745d4ea893f") - @Override - public Object visitScalabilityRule(ScalabilityRuleImporter scalabilityRuleImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("dbf8d1ee-ad59-4dd6-8dc2-6be99e692d01") - @Override - public Object visitAction(ActionImporter actionImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("56777779-4840-4b0e-b44a-a03212688f0d") - @Override - public Object visitScalingAction(ScalingActionImporter scalingActionImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("13a51478-1ca7-405f-a4a9-0c1ee594199e") - @Override - public Object visitSingleEvent(SingleEventImporter singleEventImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("5d5a98ea-cc1a-4d2c-9d91-3f79e9694167") - @Override - public Object visitTimer(TimerImporter timerImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("acdd9b75-ff3d-4261-b027-44f126b185b2") - @Override - public Object visitUnaryEventPattern(UnaryEventPatternImporter unaryEventPatternImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("566ceb04-901d-4b11-a409-7d39615ed807") - @Override - public Object visitVerticalScalingAction(VerticalScalingActionImporter verticalScalingActionImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("5ce4f65b-1620-4cb2-9300-7e8fdc421d74") - @Override - public Object visitCertifiable(CertifiableImporter certifiableImporter) { - // TODO Auto-generated method stub - return null; + return childs; } @objid ("9c8a3aef-6210-4e0d-a17c-d18febafe1a2") @Override public Object visitAttribute(AttributeImporter attributeImporter) { - List childs = new ArrayList<>(); - Attribute cdoElt = attributeImporter.getElement(); - childs.add(cdoElt.getValue()); - return childs; - } - @objid ("40170233-103e-4cd7-9c59-7341bfd34356") - @Override - public Object visitQualityAttribute(QualityAttributeImporter qualityAttributeImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("fc4a0c11-a42e-4bf8-be42-9d338035da56") - @Override - public Object visitMeasurableAttribute(MeasurableAttributeImporter measurableAttributeImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("cbd9d210-1eb5-4005-ac62-39965db6a558") - @Override - public Object visitSecurityAttribute(SecurityAttributeImporter securityAttributeImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("1fda6711-b6c7-4769-a391-e81a95ad2066") - @Override - public Object visitCompositeSecurityMetric(CompositeSecurityMetricImporter compositeSecurityMetricImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("c14ec19c-91f4-49f6-83cb-1581f4f6cb09") - @Override - public Object visitRawSecurityMetric(RawSecurityMetricImporter rawSecurityMetricImporter) { - // TODO Auto-generated method stub - return null; - } + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitAttribute(attributeImporter)); - @objid ("6f5d394f-73a6-4abf-99b8-7c9650d1ae21") - @Override - public Object visitSecurityControl(SecurityControlImporter securityControlImporter) { - // TODO Auto-generated method stub - return null; - } + Attribute cdoElt = attributeImporter.getElement(); + //childs.add(cdoElt.getValue()); - @objid ("452e9576-b9c8-4e1a-b692-71222c1a3be9") - @Override - public Object visitSecurityDomain(SecurityDomainImporter securityDomainImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("72937f96-a0bc-493a-b97c-b35b4d858ff9") - @Override - public Object visitSecurityMetricInstance(SecurityMetricInstanceImporter securityMetricInstanceImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("94ccbf6e-2809-48fe-8455-159a7b9e229d") @Override public Object visitSecurityModel(SecurityModelImporter securityModelImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitSecurityModel(securityModelImporter)); + SecurityModel cdoElt = securityModelImporter.getElement(); childs.addAll(cdoElt.getSecurityControls()); childs.addAll(cdoElt.getSecurityRequirements()); @@ -1311,82 +578,47 @@ public Object visitSecurityModel(SecurityModelImporter securitySLOImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("53533c80-2d48-4cbf-97e2-f558fd6a5e8a") - @Override - public Object visitCloudCredentials(CloudCredentialsImporter cloudCredentialsImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("50965f30-c241-428f-92d5-c087d19592a7") - @Override - public Object visitCloudProvider(CloudProviderImporter cloudProviderImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("d66d5ec9-be3a-49d1-834b-a943083fedfa") - @Override - public Object visitCredentials(CredentialsImporter credentialsImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("340f1764-211d-465b-9a44-568813ed6d22") @Override public Object visitDataResourceFilter(DataResourceFilterImporter dataResourceFilterImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitDataResourceFilter(dataResourceFilterImporter)); + DataResourceFilter cdoElt = dataResourceFilterImporter.getElement(); childs.addAll(cdoElt.getData()); childs.addAll(cdoElt.getDataInstances()); childs.addAll(cdoElt.getLocations()); - return childs; - } - @objid ("cf76d4e4-a888-4929-a817-d64959528528") - @Override - public Object visitEntity(EntityImporter entityImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("d02ae4a2-541d-489e-9864-d905db038e5e") - @Override - public Object visitExternalIdentifier(ExternalIdentifierImporter externalIdentifierImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("219086bb-cf33-4c42-a6ae-6871f2fbfc28") - @Override - public Object visitModelResourceFilter(ModelResourceFilterImporter modelResourceFilterImporter) { - // TODO Auto-generated method stub - return null; - } @objid ("140ea594-e836-43b1-b502-a21b84b9e025") @Override public Object visitOrganisation(OrganisationImporter organisationImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitOrganisation(organisationImporter)); + Organisation cdoElt = organisationImporter.getElement(); childs.addAll(cdoElt.getCloudCredentials()); + return childs; } @objid ("150761f4-10bc-495c-9466-8c4d08d920e5") @Override public Object visitOrganisationModel(OrganisationModelImporter organisationModelImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitOrganisationModel(organisationModelImporter)); + OrganisationModel cdoElt = organisationModelImporter.getElement(); childs.add(cdoElt.getOrganisation()); childs.addAll(cdoElt.getExternalIdentifiers()); @@ -1396,68 +628,18 @@ public Object visitOrganisationModel(OrganisationModelImporter permissionImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("ea55f3a1-eb51-4d54-bc9d-c936d0ed0716") - @Override - public Object visitPlatformCredentials(PlatformCredentialsImporter platformCredentialsImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("7123db3f-cf6a-4cb3-a0da-68efc6df6f7e") - @Override - public Object visitResourceFilter(ResourceFilterImporter resourceFilterImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("440904a1-30ae-445e-b58c-df7862bf40d5") - @Override - public Object visitRoleAssignment(RoleAssignmentImporter roleAssignmentImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("074a0ff1-596e-4055-a54b-108ae217a048") - @Override - public Object visitRole(RoleImporter roleImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("95cabeec-c3bf-41a8-8558-932ba800bf1f") - @Override - public Object visitServiceResourceFilter(ServiceResourceFilterImporter serviceResourceFilterImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("ca89a225-ab97-45cc-85ba-bc1adcccbf9e") - @Override - public Object visitSoftwareComponentResourceFilter(SoftwareComponentResourceFilterImporter softwareComponentResourceFilterImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("1e72d36a-60d8-4923-9a94-a221e4e24627") - @Override - public Object visitUserGroup(UserGroupImporter userGroupImporter) { - return null; - } @objid ("c9f3ff0a-e879-47ba-ad9d-50f09765ea5e") @Override public Object visitUser(UserImporter userImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitUser(userImporter)); + User cdoElt = userImporter.getElement(); childs.addAll(cdoElt.getExternalIdentifiers()); childs.add(cdoElt.getPlatformCredentials()); @@ -1465,94 +647,37 @@ public Object visitUser(UserImporter providedCommunicationImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("2ba230c6-c601-41e1-a6dd-6fd8a9b82ace") - @Override - public Object visitProvidedHost(ProvidedHostImporter providedHostImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("c6826b05-b0b7-4d4a-b931-77afbb7e5979") - @Override - public Object visitRequiredCommunication(RequiredCommunicationImporter requiredCommunicationImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("4a3220c5-a6d9-4975-804d-f395eecb8178") - @Override - public Object visitRequiredHost(RequiredHostImporter requiredHostImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("993bb7cb-bcbf-4ba8-9c71-44bd577b77de") - @Override - public Object visitCompositeUnit(CompositeUnitImporter compositeUnitImporter) { - // TODO Auto-generated method stub - return null; + return childs; } - @objid ("505db101-f9da-40d3-b45c-6f7c810c3756") - @Override - public Object visitDimensionedUnit(DimensionedUnitImporter dimensionedUnitImporter) { - // TODO Auto-generated method stub - return null; - } - @objid ("3902056e-57c5-457c-b2fd-cc5f8aeabd63") - @Override - public Object visitDimensionless(DimensionlessImporter dimensionlessImporter) { - // TODO Auto-generated method stub - return null; - } - - @objid ("03bd2d78-fb5d-4f3e-bb5b-77e00c6ed342") + @objid ("1d02f214-abe2-4cec-a295-258edc9183fa") @Override - public Object visitSingleUnit(SingleUnitImporter singleUnitImporter) { - // TODO Auto-generated method stub - return null; - } + public Object visitUnitModel(UnitModelImporter unitModelImporter) { - @objid ("41729d1f-0277-494d-96d8-ac9e17696150") - @Override - public Object visitUnitDimension(UnitDimensionImporter unitDimensionImporter) { - // TODO Auto-generated method stub - return null; - } + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitUnitModel(unitModelImporter)); - @objid ("dbea1b17-3900-4fbc-8695-fc9d1aec47f5") - @Override - public Object visitUnit(UnitImporter unitImporter) { - // TODO Auto-generated method stub - return null; - } + UnitModel cdoElt = unitModelImporter.getElement(); + childs.addAll(cdoElt.getUnits()); + childs.addAll(cdoElt.getDimensions()); - @objid ("1d02f214-abe2-4cec-a295-258edc9183fa") - @Override - public Object visitUnitModel(UnitModelImporter unitModelImporter) { - // TODO Auto-generated method stub - return null; + return childs; } @objid ("a0370165-b929-488d-a646-94e1a35b4b75") @Override - public Object visitCamelComponent(CamelComponentImporter camelComponentImporter) { + public Object visitCamelComponent(ComponentImporter camelComponentImporter) { + List childs = new ArrayList<>(); + childs.addAll((Collection) super.visitCamelComponent(camelComponentImporter)); + Component cdoElt = camelComponentImporter.getElement(); childs.addAll(cdoElt.getProvidedCommunications()); childs.addAll(cdoElt.getProvidedHosts()); childs.addAll(cdoElt.getConfigurations()); + return childs; } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/DefaultCamelVisitor.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/DefaultCamelVisitor.java new file mode 100644 index 00000000..55f871d8 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/DefaultCamelVisitor.java @@ -0,0 +1,1371 @@ +package fr.softeam.cameldesigner.exchange.importer; + +import org.eclipse.emf.cdo.CDOObject; +import camel.constraint.AttributeConstraint; +import camel.constraint.CompositeConstraint; +import camel.constraint.Constraint; +import camel.constraint.ConstraintModel; +import camel.constraint.IfThenConstraint; +import camel.constraint.LogicalConstraint; +import camel.constraint.MetricConstraint; +import camel.constraint.MetricVariableConstraint; +import camel.constraint.UnaryConstraint; +import camel.core.Action; +import camel.core.Attribute; +import camel.core.CamelModel; +import camel.core.Feature; +import camel.core.MeasurableAttribute; +import camel.core.Model; +import camel.core.NamedElement; +import camel.core.QualityAttribute; +import camel.data.Data; +import camel.data.DataInstance; +import camel.data.DataInstanceModel; +import camel.data.DataModel; +import camel.data.DataSource; +import camel.data.DataSourceInstance; +import camel.data.DataTypeModel; +import camel.deployment.BuildConfiguration; +import camel.deployment.ClusterConfiguration; +import camel.deployment.Communication; +import camel.deployment.CommunicationInstance; +import camel.deployment.CommunicationPort; +import camel.deployment.CommunicationPortInstance; +import camel.deployment.Component; +import camel.deployment.ComponentInstance; +import camel.deployment.ComponentRelation; +import camel.deployment.ComponentRelationInstance; +import camel.deployment.Configuration; +import camel.deployment.Container; +import camel.deployment.ContainerInstance; +import camel.deployment.DeploymentInstanceModel; +import camel.deployment.DeploymentModel; +import camel.deployment.DeploymentTypeModel; +import camel.deployment.EventConfiguration; +import camel.deployment.Hosting; +import camel.deployment.HostingInstance; +import camel.deployment.HostingPort; +import camel.deployment.HostingPortInstance; +import camel.deployment.LocationCoupling; +import camel.deployment.PaaS; +import camel.deployment.PaaSConfiguration; +import camel.deployment.PaaSInstance; +import camel.deployment.ProvidedCommunication; +import camel.deployment.ProvidedCommunicationInstance; +import camel.deployment.ProvidedHost; +import camel.deployment.ProvidedHostInstance; +import camel.deployment.RequiredCommunication; +import camel.deployment.RequiredCommunicationInstance; +import camel.deployment.RequiredHost; +import camel.deployment.RequiredHostInstance; +import camel.deployment.RequirementSet; +import camel.deployment.ScriptConfiguration; +import camel.deployment.ServerlessConfiguration; +import camel.deployment.SoftwareComponent; +import camel.deployment.SoftwareComponentInstance; +import camel.deployment.VM; +import camel.deployment.VMInstance; +import camel.execution.ActionInstance; +import camel.execution.ApplicationMeasurement; +import camel.execution.Cause; +import camel.execution.CommunicationMeasurement; +import camel.execution.ContainerMeasurement; +import camel.execution.DataMeasurement; +import camel.execution.ExecutionModel; +import camel.execution.HistoryInfo; +import camel.execution.HistoryRecord; +import camel.execution.Measurement; +import camel.execution.PaaSMeasurement; +import camel.execution.RuleTrigger; +import camel.execution.SLOViolation; +import camel.execution.SoftwareComponentMeasurement; +import camel.execution.VMMeasurement; +import camel.location.CloudLocation; +import camel.location.GeographicalRegion; +import camel.location.Location; +import camel.location.LocationModel; +import camel.metric.AttributeContext; +import camel.metric.CompositeMetric; +import camel.metric.CompositeMetricContext; +import camel.metric.Function; +import camel.metric.Metric; +import camel.metric.MetricContext; +import camel.metric.MetricInstance; +import camel.metric.MetricInstanceModel; +import camel.metric.MetricModel; +import camel.metric.MetricObjectBinding; +import camel.metric.MetricTemplate; +import camel.metric.MetricTypeModel; +import camel.metric.MetricVariable; +import camel.metric.ObjectContext; +import camel.metric.RawMetric; +import camel.metric.RawMetricContext; +import camel.metric.Schedule; +import camel.metric.Sensor; +import camel.metric.Window; +import camel.mms.MetaDataModel; +import camel.mms.MmsConcept; +import camel.mms.MmsConceptInstance; +import camel.mms.MmsObject; +import camel.mms.MmsProperty; +import camel.mms.MmsPropertyInstance; +import camel.organisation.CloudCredentials; +import camel.organisation.CloudProvider; +import camel.organisation.Credentials; +import camel.organisation.DataResourceFilter; +import camel.organisation.Entity; +import camel.organisation.ExternalIdentifier; +import camel.organisation.ModelResourceFilter; +import camel.organisation.Organisation; +import camel.organisation.OrganisationModel; +import camel.organisation.Permission; +import camel.organisation.PlatformCredentials; +import camel.organisation.ResourceFilter; +import camel.organisation.Role; +import camel.organisation.RoleAssignment; +import camel.organisation.ServiceResourceFilter; +import camel.organisation.SoftwareComponentResourceFilter; +import camel.organisation.User; +import camel.organisation.UserGroup; +import camel.requirement.HardRequirement; +import camel.requirement.HorizontalScaleRequirement; +import camel.requirement.ImageRequirement; +import camel.requirement.LocationRequirement; +import camel.requirement.OSRequirement; +import camel.requirement.OptimisationRequirement; +import camel.requirement.PaaSRequirement; +import camel.requirement.ProviderRequirement; +import camel.requirement.Requirement; +import camel.requirement.RequirementModel; +import camel.requirement.ResourceRequirement; +import camel.requirement.ScaleRequirement; +import camel.requirement.SecurityRequirement; +import camel.requirement.ServiceLevelObjective; +import camel.requirement.SoftRequirement; +import camel.requirement.VerticalScaleRequirement; +import camel.scalability.BinaryEventPattern; +import camel.scalability.Event; +import camel.scalability.EventInstance; +import camel.scalability.EventPattern; +import camel.scalability.FunctionalEvent; +import camel.scalability.FunctionalEventInstance; +import camel.scalability.HorizontalScalingAction; +import camel.scalability.NonFunctionalEvent; +import camel.scalability.NonFunctionalEventInstance; +import camel.scalability.ScalabilityModel; +import camel.scalability.ScalabilityRule; +import camel.scalability.ScalingAction; +import camel.scalability.SingleEvent; +import camel.scalability.Timer; +import camel.scalability.UnaryEventPattern; +import camel.scalability.VerticalScalingAction; +import camel.security.Certifiable; +import camel.security.CompositeSecurityMetric; +import camel.security.RawSecurityMetric; +import camel.security.SecurityAttribute; +import camel.security.SecurityControl; +import camel.security.SecurityDomain; +import camel.security.SecurityMetricInstance; +import camel.security.SecurityModel; +import camel.security.SecuritySLO; +import camel.unit.CompositeUnit; +import camel.unit.DimensionedUnit; +import camel.unit.Dimensionless; +import camel.unit.SingleUnit; +import camel.unit.Unit; +import camel.unit.UnitDimension; +import camel.unit.UnitModel; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelAttribute; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.camelcore.standard.package_.SubModel; +import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.CamelConstraint; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.CamelComponent; +import fr.softeam.cameldesigner.exchange.importer.constraint.AttributeConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.CamelConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.CompositeConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.ConstraintModelImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.IfThenConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.LogicalConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.MetricConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.MetricVariableConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.UnaryConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.core.ActionImporter; +import fr.softeam.cameldesigner.exchange.importer.core.AttributeImporter; +import fr.softeam.cameldesigner.exchange.importer.core.CamelElementImporter; +import fr.softeam.cameldesigner.exchange.importer.core.CamelModelImporter; +import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; +import fr.softeam.cameldesigner.exchange.importer.core.MeasurableAttributeImporter; +import fr.softeam.cameldesigner.exchange.importer.core.NamedElementImporter; +import fr.softeam.cameldesigner.exchange.importer.core.QualityAttributeImporter; +import fr.softeam.cameldesigner.exchange.importer.core.SubModelImporter; +import fr.softeam.cameldesigner.exchange.importer.data.DataImporter; +import fr.softeam.cameldesigner.exchange.importer.data.DataInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.data.DataInstanceModelImporter; +import fr.softeam.cameldesigner.exchange.importer.data.DataModelImporter; +import fr.softeam.cameldesigner.exchange.importer.data.DataSourceImporter; +import fr.softeam.cameldesigner.exchange.importer.data.DataSourceInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.data.DataTypeModelImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.BuildConfigurationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ClusterConfigurationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationPortImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ComponentImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ComponentRelationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ConfigurationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ContainerImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.DeploymentModelImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.DeploymentTypeModelImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.EventConfigurationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.HostingImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.HostingPortImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.LocationCouplingImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.PaaSConfigurationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.PaaSImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ProvidedCommunicationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ProvidedHostImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredCommunicationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredHostImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.RequirementSetImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ScriptConfiguationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ServerlessConfigurationImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.SoftwareComponentImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.VMImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.CommunicationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.CommunicationPortInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ComponentInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ComponentRelationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ContainerInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.DeploymentInstanceModelImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.HostingInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.HostingPortInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.PaaSInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ProvidedCommunicationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ProvidedHostInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.RequiredCommunicationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.RequiredHostInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.SoftwareComponentInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.VMInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.ActionInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.ApplicationMeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.CauseImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.CommunicationMeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.ContainerMeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.DataMeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.ExecutionModelImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.HistoryInfoImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.HistoryRecordImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.MeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.PaaSMeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.RuleTriggerImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.SLOViolationImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.SoftwareComponentMeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.execution.VMMeasurementImporter; +import fr.softeam.cameldesigner.exchange.importer.location.CloudLocationImporter; +import fr.softeam.cameldesigner.exchange.importer.location.GeographicalRegionImporter; +import fr.softeam.cameldesigner.exchange.importer.location.LocationImporter; +import fr.softeam.cameldesigner.exchange.importer.location.LocationModelImporter; +import fr.softeam.cameldesigner.exchange.importer.metadata.MetaDataModelImporter; +import fr.softeam.cameldesigner.exchange.importer.metadata.MmsConceptImporter; +import fr.softeam.cameldesigner.exchange.importer.metadata.MmsConceptInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.metadata.MmsObjectImporter; +import fr.softeam.cameldesigner.exchange.importer.metadata.MmsPropertyImporter; +import fr.softeam.cameldesigner.exchange.importer.metadata.MmsPropertyInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.AttributeContextImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.CompositeMetricContextImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.CompositeMetricImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.FunctionImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricContextImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricInstanceModelImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricModelImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricObjectBindingImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricTemplateImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricTypeModelImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.MetricVariableImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.ObjectContextImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.RawMetricContextImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.RawMetricImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.ScheduleImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.SensorImporter; +import fr.softeam.cameldesigner.exchange.importer.metric.WindowImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.CloudCredentialsImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.CloudProviderImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.CredentialsImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.DataResourceFilterImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.EntityImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.ExternalIdentifierImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.ModelResourceFilterImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.OrganisationImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.OrganisationModelImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.PermissionImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.PlatformCredentialsImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.ResourceFilterImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.RoleAssignmentImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.RoleImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.ServiceResourceFilterImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.SoftwareComponentResourceFilterImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.UserGroupImporter; +import fr.softeam.cameldesigner.exchange.importer.organisation.UserImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.HardRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.HorizontalScaleRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.ImageRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.LocationRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.OSRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.OptimisationRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.PaaSRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.ProviderRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.RequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.RequirementModelImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.ResourceRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.ScaleRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.SecurityRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.ServiceLevelObjectiveImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.SoftRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.requirement.VerticalScaleRequirementImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.BinaryEventPatternImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.EventImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.EventInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.EventPatternImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.FunctionalEventImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.FunctionalEventInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.HorizontalScalingActionImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.NonFunctionalEventImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.NonFunctionalEventInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.ScalabilityModelImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.ScalabilityRuleImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.ScalingActionImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.SingleEventImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.TimerImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.UnaryEventPatternImporter; +import fr.softeam.cameldesigner.exchange.importer.scalability.VerticalScalingActionImporter; +import fr.softeam.cameldesigner.exchange.importer.security.CertifiableImporter; +import fr.softeam.cameldesigner.exchange.importer.security.CompositeSecurityMetricImporter; +import fr.softeam.cameldesigner.exchange.importer.security.RawSecurityMetricImporter; +import fr.softeam.cameldesigner.exchange.importer.security.SecurityAttributeImporter; +import fr.softeam.cameldesigner.exchange.importer.security.SecurityControlImporter; +import fr.softeam.cameldesigner.exchange.importer.security.SecurityDomainImporter; +import fr.softeam.cameldesigner.exchange.importer.security.SecurityMetricInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.security.SecurityModelImporter; +import fr.softeam.cameldesigner.exchange.importer.security.SecuritySLOImporter; +import fr.softeam.cameldesigner.exchange.importer.unit.CompositeUnitImporter; +import fr.softeam.cameldesigner.exchange.importer.unit.DimensionedUnitImporter; +import fr.softeam.cameldesigner.exchange.importer.unit.DimensionlessImporter; +import fr.softeam.cameldesigner.exchange.importer.unit.SingleUnitImporter; +import fr.softeam.cameldesigner.exchange.importer.unit.UnitDimensionImporter; +import fr.softeam.cameldesigner.exchange.importer.unit.UnitImporter; +import fr.softeam.cameldesigner.exchange.importer.unit.UnitModelImporter; + + +public class DefaultCamelVisitor implements ICamelImporterVisitor { + + @Override + public Object visitFeature(FeatureImporter feature) { + return visitNamedElement(feature); + } + + + @Override + public Object visitCamelElement(CamelElementImporter camelElt) { + return null; + } + + + @Override + public Object visitCamelModel(CamelModelImporter camelModel) { + return visitModel(camelModel); + } + + @Override + public Object visitMetaDataModel(MetaDataModelImporter metaDataModel) { + return visitModel(metaDataModel); + } + + + @Override + public Object visitMmsConcept(MmsConceptImporter mmsConcept) { + return visitMmsObject(mmsConcept); + } + + @Override + public Object visitMmsProperty(MmsPropertyImporter mmsConcept) { + return visitMmsObject(mmsConcept); + } + + @Override + public Object visitMmsPropertyInstance(MmsPropertyInstanceImporter mmsConcept) { + return visitMmsObject(mmsConcept); + } + + @Override + public Object visitMmsConceptInstance(MmsConceptInstanceImporter mmsConcept) { + return visitMmsObject(mmsConcept); + } + + @Override + public Object visitMmsObject(MmsObjectImporter model) { + return null; + } + + @Override + public Object visitModel(SubModelImporter model) { + return visitFeature(model); + } + + + @Override + public Object visitNamedElement(NamedElementImporter namedElement) { + return visitCamelElement(namedElement); + } + + + @Override + public Object visitBuildConfiguration(BuildConfigurationImporter buildConfiguration) { + return visitFeature(buildConfiguration); + } + + @Override + public Object visitClusterConfiguration(ClusterConfigurationImporter clusterConfiguration) { + return visitConfiguration(clusterConfiguration); + } + + + @Override + public Object visitCommunication(CommunicationImporter communication) { + return visitComponentRelation(communication); + } + + @Override + public Object visitComponentRelationInstance(ComponentRelationInstanceImporter componentRelationInstance) { + return visitFeature(componentRelationInstance); + } + + + @Override + public Object visitCommunicationInstance(CommunicationInstanceImporter communicationInstance) { + return visitComponentRelationInstance(communicationInstance); + } + + + @Override + public Object visitCommunicationPort(CommunicationPortImporter communicationPort) { + return visitFeature(communicationPort); + } + + @Override + public Object visitCommunicationPortInstance(CommunicationPortInstanceImporter communicationPortInstance) { + return visitFeature(communicationPortInstance); + } + + + @Override + public Object visitComponentRelation(ComponentRelationImporter componentRelation) { + return visitFeature(componentRelation); + } + + @Override + public Object visitComponent(ComponentImporter component) { + return visitFeature(component); + } + + @Override + public Object visitComponentInstance(ComponentInstanceImporter componentInstance) { + return visitFeature(componentInstance); + } + + + @Override + public Object visitConfiguration(ConfigurationImporter configuration) { + return visitFeature(configuration); + } + + + @Override + public Object visitContainer(ContainerImporter container) { + return visitComponent(container); + } + + @Override + public Object visitContainerInstance(ContainerInstanceImporter containerInstance) { + return visitComponentInstance(containerInstance); + } + + + @Override + public Object visitDeploymentModel(DeploymentModelImporter deploymentModel) { + return visitModel(deploymentModel); + } + + @Override + public Object visitDeploymentTypeModel(DeploymentTypeModelImporter deploymentTypeModel) { + return visitDeploymentModel(deploymentTypeModel); + } + + @Override + public Object visitDeploymentInstanceModel(DeploymentInstanceModelImporter deploymentInstanceModel) { + return visitDeploymentModel(deploymentInstanceModel); + } + + + @Override + public Object visitEventConfiguration(EventConfigurationImporter eventConfiguration) { + return visitFeature(eventConfiguration); + } + + + @Override + public Object visitHosting(HostingImporter hosting) { + return visitComponentRelation(hosting); + } + + @Override + public Object visitHostingInstance(HostingInstanceImporter hostingInstance) { + return visitComponentRelationInstance(hostingInstance); + } + + @Override + public Object visitHostingPort(HostingPortImporter hostingPort) { + return visitFeature(hostingPort); + } + + @Override + public Object visitHostingPortInstance(HostingPortInstanceImporter hostingPortInstance) { + return visitFeature(hostingPortInstance); + } + + @Override + public Object visitLocationCoupling(LocationCouplingImporter locationCoupling) { + return visitComponentRelation(locationCoupling); + } + + @Override + public Object visitPaaSConfiguration(PaaSConfigurationImporter paaSConfiguration) { + return visitConfiguration(paaSConfiguration); + } + + @Override + public Object visitPaaS(PaaSImporter paaS) { + return visitComponent(paaS); + } + + @Override + public Object visitPaaSInstance(PaaSInstanceImporter paaSInstance) { + return visitComponentInstance(paaSInstance); + } + + @Override + public Object visitRequirementSet(RequirementSetImporter requiredSet) { + return visitFeature(requiredSet); + } + + @Override + public Object visitScriptConfiguration(ScriptConfiguationImporter scriptConfiguration) { + return visitConfiguration(scriptConfiguration); + } + + @Override + public Object visitServelessConfiguration(ServerlessConfigurationImporter serverlessConfiguration) { + return visitConfiguration(serverlessConfiguration); + } + + @Override + public Object visitSoftwareComponent(SoftwareComponentImporter softwareComponent) { + return visitComponent(softwareComponent); + } + + @Override + public Object visitSoftwareComponentInstance(SoftwareComponentInstanceImporter softwareComponentInstance) { + return visitComponentInstance(softwareComponentInstance); + } + + @Override + public Object visitVM(VMImporter vm) { + return visitComponent(vm); + } + + @Override + public Object visitVMInstance(VMInstanceImporter vmInstance) { + return visitComponentInstance(vmInstance); + } + + @Override + public Object visitCloudCredentials(CloudCredentialsImporter cloudCredentials) { + return visitCredentials(cloudCredentials); + } + + + @Override + public Object visitCloudProvider(CloudProviderImporter cloudProvider) { + return visitOrganisation(cloudProvider); + } + + @Override + public Object visitCredentials(CredentialsImporter credentials) { + return visitFeature(credentials); + } + + @Override + public Object visitDataResourceFilter(DataResourceFilterImporter dataResourceFilter) { + return visitResourceFilter(dataResourceFilter); + } + + + @Override + public Object visitEntity(EntityImporter entity) { + return visitFeature(entity); + } + + @Override + public Object visitExternalIdentifier(ExternalIdentifierImporter externalIdentifier) { + return visitFeature(externalIdentifier); + } + + @Override + public Object visitModelResourceFilter(ModelResourceFilterImporter modelResourceFilter) { + return visitResourceFilter(modelResourceFilter); + } + + @Override + public Object visitOrganisation(OrganisationImporter organisation) { + return visitEntity(organisation); + } + + + @Override + public Object visitOrganisationModel(OrganisationModelImporter organisationModel) { + return visitModel(organisationModel); + } + + + @Override + public Object visitPermission(PermissionImporter permission) { + return visitFeature(permission); + } + + @Override + public Object visitPlatformCredentials(PlatformCredentialsImporter platformCredentials) { + return visitCredentials(platformCredentials); + } + + @Override + public Object visitResourceFilter(ResourceFilterImporter resourceFilter) { + return visitFeature(resourceFilter); + } + + @Override + public Object visitRoleAssignment(RoleAssignmentImporter roleAssignment) { + return visitFeature(roleAssignment); + } + + @Override + public Object visitRole(RoleImporter role) { + return visitFeature(role); + } + + @Override + public Object visitServiceResourceFilter(ServiceResourceFilterImporter serviceResourceFilter) { + return visitResourceFilter(serviceResourceFilter); + } + + @Override + public Object visitSoftwareComponentResourceFilter(SoftwareComponentResourceFilterImporter softwareComponentResourceFilter) { + return visitResourceFilter(softwareComponentResourceFilter); + } + + + @Override + public Object visitUserGroup(UserGroupImporter userGroup) { + return visitFeature(userGroup); + } + + @Override + public Object visitUser(UserImporter user) { + return visitEntity(user); + } + + @Override + public Object visitCamelComponent(ComponentImporter camelComponent) { + return visitCamelElement(camelComponent); + } + + + @Override + public Object visitAttributeContext(AttributeContextImporter attributeContextImporter) { + return visitFeature(attributeContextImporter); + } + + + @Override + public Object visitCompositeMetric(CompositeMetricImporter compositeMetricImporter) { + return visitMetric(compositeMetricImporter); + } + + + @Override + public Object visitMetric(MetricImporter metricImporter) { + return visitFeature(metricImporter); + } + + + @Override + public Object visitCompositeMetricContext(CompositeMetricContextImporter compositeMetricContextImporter) { + return visitMetricContext(compositeMetricContextImporter); + } + + + @Override + public Object visitMetricContext(MetricContextImporter metricContextImporter) { + return visitFeature(metricContextImporter); + } + + + @Override + public Object visitFunction(FunctionImporter functionImporter) { + return visitFeature(functionImporter); + } + + + @Override + public Object visitMetricInstance(MetricInstanceImporter metricInstanceImporter) { + return visitFeature(metricInstanceImporter); + } + + + @Override + public Object visitMetricInstanceModell(MetricInstanceModelImporter metricInstanceModelImporter) { + return visitModel(metricInstanceModelImporter); + } + + + @Override + public Object visitMetricModel(MetricModelImporter metricModelImporter) { + return visitModel(metricModelImporter); + } + + + @Override + public Object visitMetricTypeModel(MetricTypeModelImporter metricTypeModelImporter) { + return visitMetricModel(metricTypeModelImporter); + } + + + @Override + public Object visitMetricObjectBinding(MetricObjectBindingImporter metricObjectBindingImporter) { + return visitFeature(metricObjectBindingImporter); + } + + + @Override + public Object visitMetricTemplate(MetricTemplateImporter metricTemplateImporter) { + return visitFeature(metricTemplateImporter); + } + + + @Override + public Object visitMetricVariable(MetricVariableImporter metricVariableImporter) { + return visitMetric(metricVariableImporter); + } + + + @Override + public Object visitObjectContext(ObjectContextImporter objectContextImporter) { + return visitFeature(objectContextImporter); + } + + + @Override + public Object visitRawMetricContext(RawMetricContextImporter rawMetricContextImporter) { + return visitMetricContext(rawMetricContextImporter); + } + + + @Override + public Object visitRawMetric(RawMetricImporter rawMetricImporter) { + return visitMetric(rawMetricImporter); + } + + + @Override + public Object visitSchedule(ScheduleImporter scheduleImporter) { + return visitFeature(scheduleImporter); + } + + + @Override + public Object visitSensor(SensorImporter sensorImporter) { + return visitSoftwareComponent(sensorImporter); + } + + + @Override + public Object visitWindow(WindowImporter windowImporter) { + return visitFeature(windowImporter); + } + + + @Override + public Object visitConstraint(CamelConstraintImporter camelConstraintImporter) { + return visitNamedElement(camelConstraintImporter); + } + + @Override + public Object visitConstraintModel(ConstraintModelImporter constraintModelImporter) { + return visitModel(constraintModelImporter); + } + + + @Override + public Object visitAttributeConstraint(AttributeConstraintImporter attributeConstraintImporter) { + return visitUnaryConstraint(attributeConstraintImporter); + } + + + @Override + public Object visitUnaryConstraint(UnaryConstraintImporter unaryConstraintImporter) { + return visitConstraint(unaryConstraintImporter); + } + + + @Override + public Object visitCompositeConstraint(CompositeConstraintImporter compositeConstraintImporter) { + return visitConstraint(compositeConstraintImporter); + } + + + @Override + public Object visitIfThenConstraint(IfThenConstraintImporter ifThenConstraintImporter) { + return visitCompositeConstraint(ifThenConstraintImporter); + } + + + @Override + public Object visitLogicalConstraint(LogicalConstraintImporter logicalConstraintImporter) { + return visitCompositeConstraint(logicalConstraintImporter); + } + + + @Override + public Object visitMetricConstraint(MetricConstraintImporter metricConstraintImporter) { + return visitUnaryConstraint(metricConstraintImporter); + } + + + @Override + public Object visitMetricVariableConstraint(MetricVariableConstraintImporter metricVariableConstraintImporter) { + return visitUnaryConstraint(metricVariableConstraintImporter); + } + + + @Override + public Object visitHardRequirement(HardRequirementImporter hardRequirementImporter) { + return visitRequirement(hardRequirementImporter); + } + + + @Override + public Object visitHorizontalScaleRequirement( + HorizontalScaleRequirementImporter horizontalScaleRequirementImporter) { + return visitScaleRequirement(horizontalScaleRequirementImporter); + } + + + @Override + public Object visitImageRequirement(ImageRequirementImporter imageRequirementImporter) { + return visitHardRequirement(imageRequirementImporter); + } + + + @Override + public Object visitLocationRequirement(LocationRequirementImporter locationRequirementImporter) { + return visitHardRequirement(locationRequirementImporter); + } + + + @Override + public Object visitOptimisationRequirement(OptimisationRequirementImporter optimisationRequirementImporter) { + return visitSoftRequirement(optimisationRequirementImporter); + } + + + @Override + public Object visitOSRequirement(OSRequirementImporter osRequirementImporter) { + return visitHardRequirement(osRequirementImporter); + } + + + @Override + public Object visitPaaSRequirement(PaaSRequirementImporter paaSRequirementImporter) { + return visitHardRequirement(paaSRequirementImporter); + } + + + @Override + public Object visitProviderRequirement(ProviderRequirementImporter providerRequirementImporter) { + return visitHardRequirement(providerRequirementImporter); + } + + + @Override + public Object visitRequirement(RequirementImporter requirementImporter) { + return visitFeature(requirementImporter); + } + + + @Override + public Object visitRequirementModel(RequirementModelImporter requirementModelImporter) { + return visitModel(requirementModelImporter); + } + + + @Override + public Object visitResourceRequirement(ResourceRequirementImporter resourceRequirementImporter) { + return visitHardRequirement(resourceRequirementImporter); + } + + + @Override + public Object visitScaleRequirement(ScaleRequirementImporter scaleRequirementImporter) { + return visitHardRequirement(scaleRequirementImporter); + } + + + @Override + public Object visitSecurityRequirement(SecurityRequirementImporter securityRequirementImporter) { + return visitHardRequirement(securityRequirementImporter); + } + + + @Override + public Object visitServiceLevelObjective(ServiceLevelObjectiveImporter serviceLevelObjectiveImporter) { + return visitHardRequirement(serviceLevelObjectiveImporter); + } + + + @Override + public Object visitSoftRequirement(SoftRequirementImporter softRequirementImporter) { + return visitRequirement(softRequirementImporter); + } + + + @Override + public Object visitVerticalScaleRequirement(VerticalScaleRequirementImporter verticalScaleRequirementImporter) { + return visitScaleRequirement(verticalScaleRequirementImporter); + } + + + @Override + public Object visitActionInstance(ActionInstanceImporter actionInstanceImporter) { + return visitFeature(actionInstanceImporter); + } + + + @Override + public Object visitMeasurement(MeasurementImporter measurementImporter) { + return visitFeature(measurementImporter); + } + + + @Override + public Object visitApplicationMeasurement(ApplicationMeasurementImporter applicationMeasurementImporter) { + return visitMeasurement(applicationMeasurementImporter); + } + + + @Override + public Object visitCause(CauseImporter causeImporter) { + return visitFeature(causeImporter); + } + + + @Override + public Object visitCommunicationMeasurement(CommunicationMeasurementImporter communicationMeasurementImporter) { + return visitMeasurement(communicationMeasurementImporter); + } + + + @Override + public Object visitContainerMeasurement(ContainerMeasurementImporter containerMeasurementImporter) { + return visitMeasurement(containerMeasurementImporter); + } + + + @Override + public Object visitDataMeasurement(DataMeasurementImporter dataMeasurementImporter) { + return visitMeasurement(dataMeasurementImporter); + } + + + @Override + public Object visitExecutionModel(ExecutionModelImporter executionModelImporter) { + return visitModel(executionModelImporter); + } + + + @Override + public Object visitHistoryInfo(HistoryInfoImporter historyInfoImporter) { + return visitFeature(historyInfoImporter); + } + + + @Override + public Object visitHistoryRecord(HistoryRecordImporter historyRecordImporter) { + return visitFeature(historyRecordImporter); + } + + + @Override + public Object visitPaaSMeasurement(PaaSMeasurementImporter paaSMeasurementImporter) { + return visitMeasurement(paaSMeasurementImporter); + } + + + @Override + public Object visitRuleTrigger(RuleTriggerImporter ruleTriggerImporter) { + return visitCause(ruleTriggerImporter); + } + + + @Override + public Object visitSLOViolation(SLOViolationImporter sloViolationImporter) { + return visitCause(sloViolationImporter); + } + + + @Override + public Object visitSoftwareComponentMeasurement( + SoftwareComponentMeasurementImporter softwareComponentMeasurementImporter) { + return visitMeasurement(softwareComponentMeasurementImporter); + } + + + @Override + public Object visitVMMeasurement(VMMeasurementImporter vmMeasurementImporter) { + return visitMeasurement(vmMeasurementImporter); + } + + + @Override + public Object visitCloudLocation(CloudLocationImporter cloudLocationImporter) { + return visitLocation(cloudLocationImporter); + } + + + @Override + public Object visitLocation(LocationImporter locationImporter) { + return visitFeature(locationImporter); + } + + + @Override + public Object visitLocationModel(LocationModelImporter locationModelImporter) { + return visitModel(locationModelImporter); + } + + + @Override + public Object visitGeographicalRegion(GeographicalRegionImporter geographicalRegionImporter) { + return visitLocation(geographicalRegionImporter); + } + + + @Override + public Object visitData(DataImporter dataImporter) { + return visitFeature(dataImporter); + } + + + @Override + public Object visitDataInstance(DataInstanceImporter dataInstanceImporter) { + return visitFeature(dataInstanceImporter); + } + + + @Override + public Object visitDataInstanceModel(DataInstanceModelImporter dataInstanceModelImporter) { + return visitDataModel(dataInstanceModelImporter); + } + + + @Override + public Object visitDataModel(DataModelImporter dataModelImporter) { + return visitModel(dataModelImporter); + } + + + @Override + public Object visitDataSource(DataSourceImporter dataSourceImporter) { + return visitFeature(dataSourceImporter); + } + + + @Override + public Object visitDataSourceInstance(DataSourceInstanceImporter dataSourceInstanceImporter) { + return visitFeature(dataSourceInstanceImporter); + } + + + @Override + public Object visitDataTypeModel(DataTypeModelImporter dataTypeModelImporter) { + return visitDataModel(dataTypeModelImporter); + } + + + @Override + public Object visitBinaryEventPattern(BinaryEventPatternImporter binaryEventPatternImporter) { + return visitEventPattern(binaryEventPatternImporter); + } + + + @Override + public Object visitEvent(EventImporter eventImporter) { + return visitFeature(eventImporter); + } + + + @Override + public Object visitScalabilityModel(ScalabilityModelImporter scalabilityModelImporter) { + return visitModel(scalabilityModelImporter); + } + + + @Override + public Object visitEventInstance(EventInstanceImporter eventInstanceImporter) { + return visitFeature(eventInstanceImporter); + } + + + @Override + public Object visitEventPattern(EventPatternImporter eventPatternImporter) { + return visitEvent(eventPatternImporter); + } + + + @Override + public Object visitFunctionalEvent(FunctionalEventImporter functionalEventImporter) { + return visitSingleEvent(functionalEventImporter); + } + + + @Override + public Object visitFunctionalEventInstance(FunctionalEventInstanceImporter functionalEventInstanceImporter) { + return visitEventInstance(functionalEventInstanceImporter); + } + + + @Override + public Object visitHorizontalScalingAction(HorizontalScalingActionImporter horizontalScalingActionImporter) { + return visitScalingAction(horizontalScalingActionImporter); + } + + + @Override + public Object visitNonFunctionalEvent(NonFunctionalEventImporter nonFunctionalEventImporter) { + return visitSingleEvent(nonFunctionalEventImporter); + } + + + @Override + public Object visitNonFunctionalEventInstance( + NonFunctionalEventInstanceImporter nonFunctionalEventInstanceImporter) { + return visitEventInstance(nonFunctionalEventInstanceImporter); + } + + + @Override + public Object visitScalabilityRule(ScalabilityRuleImporter scalabilityRuleImporter) { + return visitFeature(scalabilityRuleImporter); + } + + + @Override + public Object visitAction(ActionImporter actionImporter) { + return visitFeature(actionImporter); + } + + + @Override + public Object visitScalingAction(ScalingActionImporter scalingActionImporter) { + return visitAction(scalingActionImporter); + } + + + @Override + public Object visitSingleEvent(SingleEventImporter singleEventImporter) { + return visitEvent(singleEventImporter); + } + + + @Override + public Object visitTimer(TimerImporter timerImporter) { + return visitFeature(timerImporter); + } + + + @Override + public Object visitUnaryEventPattern(UnaryEventPatternImporter unaryEventPatternImporter) { + return visitEventPattern(unaryEventPatternImporter); + } + + + @Override + public Object visitVerticalScalingAction(VerticalScalingActionImporter verticalScalingActionImporter) { + return visitScalingAction(verticalScalingActionImporter); + } + + + @Override + public Object visitCertifiable(CertifiableImporter certifiableImporter) { + return visitSecurityAttribute(certifiableImporter); + } + + + @Override + public Object visitAttribute(AttributeImporter attributeImporter) { + return visitNamedElement(attributeImporter); + } + + + @Override + public Object visitQualityAttribute(QualityAttributeImporter qualityAttributeImporter) { + return visitAttribute(qualityAttributeImporter); + } + + + @Override + public Object visitMeasurableAttribute(MeasurableAttributeImporter measurableAttributeImporter) { + return visitQualityAttribute(measurableAttributeImporter); + } + + + @Override + public Object visitSecurityAttribute(SecurityAttributeImporter securityAttributeImporter) { + return visitQualityAttribute(securityAttributeImporter); + } + + + @Override + public Object visitCompositeSecurityMetric(CompositeSecurityMetricImporter compositeSecurityMetricImporter) { + return visitCompositeMetric(compositeSecurityMetricImporter); + } + + + @Override + public Object visitRawSecurityMetric(RawSecurityMetricImporter rawSecurityMetricImporter) { + return visitRawMetric(rawSecurityMetricImporter); + } + + + @Override + public Object visitSecurityControl(SecurityControlImporter securityControlImporter) { + return visitFeature(securityControlImporter); + } + + + @Override + public Object visitSecurityDomain(SecurityDomainImporter securityDomainImporter) { + return visitFeature(securityDomainImporter); + } + + + @Override + public Object visitSecurityMetricInstance(SecurityMetricInstanceImporter securityMetricInstanceImporter) { + return visitMetricInstance(securityMetricInstanceImporter); + } + + + @Override + public Object visitSecurityModel(SecurityModelImporter securityModelImporter) { + return visitModel(securityModelImporter); + } + + + @Override + public Object visitSecuritySLO(SecuritySLOImporter securitySLOImporter) { + return visitServiceLevelObjective(securitySLOImporter); + } + + + @Override + public Object visitProvidedCommunication(ProvidedCommunicationImporter providedCommunicationImporter) { + return visitCommunicationPort(providedCommunicationImporter); + } + + @Override + public Object visitProvidedCommunicationInstance(ProvidedCommunicationInstanceImporter providedCommunicationInstanceImporter) { + return visitCommunicationPortInstance(providedCommunicationInstanceImporter); + } + + + @Override + public Object visitProvidedHost(ProvidedHostImporter providedHostImporter) { + return visitHostingPort(providedHostImporter); + } + + @Override + public Object visitProvidedHostInstance(ProvidedHostInstanceImporter providedHostInstanceImporter) { + return visitHostingPortInstance(providedHostInstanceImporter); + } + + + @Override + public Object visitRequiredCommunication(RequiredCommunicationImporter requiredCommunicationImporter) { + return visitCommunicationPort(requiredCommunicationImporter); + } + + @Override + public Object visitRequiredCommunicationInstance(RequiredCommunicationInstanceImporter requiredCommunicationInstanceImporter) { + return visitCommunicationPortInstance(requiredCommunicationInstanceImporter); + } + + @Override + public Object visitRequiredHost(RequiredHostImporter requiredHostImporter) { + return visitHostingPort(requiredHostImporter); + } + + @Override + public Object visitRequiredHostInstance(RequiredHostInstanceImporter requiredHostInstanceImporter) { + return visitHostingPortInstance(requiredHostInstanceImporter); + } + + @Override + public Object visitCompositeUnit(CompositeUnitImporter compositeUnitImporter) { + return visitDimensionedUnit(compositeUnitImporter); + } + + + @Override + public Object visitDimensionedUnit(DimensionedUnitImporter dimensionedUnitImporter) { + return visitUnit(dimensionedUnitImporter); + } + + + @Override + public Object visitDimensionless(DimensionlessImporter dimensionlessImporter) { + return visitUnit(dimensionlessImporter); + } + + + @Override + public Object visitSingleUnit(SingleUnitImporter singleUnitImporter) { + return visitDimensionedUnit(singleUnitImporter); + } + + + @Override + public Object visitUnitDimension(UnitDimensionImporter unitDimensionImporter) { + return visitFeature(unitDimensionImporter); + } + + + @Override + public Object visitUnit(UnitImporter unitImporter) { + return visitFeature(unitImporter); + } + + + @Override + public Object visitUnitModel(UnitModelImporter unitModelImporter) { + return visitModel(unitModelImporter); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelImporterVisitor.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelImporterVisitor.java index a56c080a..9506f25a 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelImporterVisitor.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelImporterVisitor.java @@ -1,8 +1,11 @@ package fr.softeam.cameldesigner.exchange.importer; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; import camel.constraint.AttributeConstraint; import camel.constraint.CompositeConstraint; import camel.constraint.Constraint; +import camel.constraint.ConstraintModel; import camel.constraint.IfThenConstraint; import camel.constraint.LogicalConstraint; import camel.constraint.MetricConstraint; @@ -26,28 +29,43 @@ import camel.deployment.BuildConfiguration; import camel.deployment.ClusterConfiguration; import camel.deployment.Communication; +import camel.deployment.CommunicationInstance; import camel.deployment.CommunicationPort; +import camel.deployment.CommunicationPortInstance; import camel.deployment.Component; +import camel.deployment.ComponentInstance; import camel.deployment.ComponentRelation; +import camel.deployment.ComponentRelationInstance; import camel.deployment.Configuration; import camel.deployment.Container; +import camel.deployment.ContainerInstance; +import camel.deployment.DeploymentInstanceModel; import camel.deployment.DeploymentModel; import camel.deployment.DeploymentTypeModel; import camel.deployment.EventConfiguration; import camel.deployment.Hosting; +import camel.deployment.HostingInstance; import camel.deployment.HostingPort; +import camel.deployment.HostingPortInstance; import camel.deployment.LocationCoupling; import camel.deployment.PaaS; import camel.deployment.PaaSConfiguration; +import camel.deployment.PaaSInstance; import camel.deployment.ProvidedCommunication; +import camel.deployment.ProvidedCommunicationInstance; import camel.deployment.ProvidedHost; +import camel.deployment.ProvidedHostInstance; import camel.deployment.RequiredCommunication; +import camel.deployment.RequiredCommunicationInstance; import camel.deployment.RequiredHost; +import camel.deployment.RequiredHostInstance; import camel.deployment.RequirementSet; import camel.deployment.ScriptConfiguration; import camel.deployment.ServerlessConfiguration; import camel.deployment.SoftwareComponent; +import camel.deployment.SoftwareComponentInstance; import camel.deployment.VM; +import camel.deployment.VMInstance; import camel.execution.ActionInstance; import camel.execution.ApplicationMeasurement; import camel.execution.Cause; @@ -158,7 +176,6 @@ import camel.unit.Unit; import camel.unit.UnitDimension; import camel.unit.UnitModel; -import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.camelcore.standard.package_.SubModel; import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.CamelConstraint; @@ -166,6 +183,7 @@ import fr.softeam.cameldesigner.exchange.importer.constraint.AttributeConstraintImporter; import fr.softeam.cameldesigner.exchange.importer.constraint.CamelConstraintImporter; import fr.softeam.cameldesigner.exchange.importer.constraint.CompositeConstraintImporter; +import fr.softeam.cameldesigner.exchange.importer.constraint.ConstraintModelImporter; import fr.softeam.cameldesigner.exchange.importer.constraint.IfThenConstraintImporter; import fr.softeam.cameldesigner.exchange.importer.constraint.LogicalConstraintImporter; import fr.softeam.cameldesigner.exchange.importer.constraint.MetricConstraintImporter; @@ -188,10 +206,10 @@ import fr.softeam.cameldesigner.exchange.importer.data.DataSourceInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.data.DataTypeModelImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.BuildConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.CamelComponentImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ClusterConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationPortImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.ComponentImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ComponentRelationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ContainerImporter; @@ -207,11 +225,26 @@ import fr.softeam.cameldesigner.exchange.importer.deployment.ProvidedHostImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredCommunicationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredHostImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredSetImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.RequirementSetImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ScriptConfiguationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ServerlessConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.SoftwareComponentImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.VMImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.CommunicationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.CommunicationPortInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ComponentInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ComponentRelationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ContainerInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.DeploymentInstanceModelImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.HostingInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.HostingPortInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.PaaSInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ProvidedCommunicationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.ProvidedHostInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.RequiredCommunicationInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.RequiredHostInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.SoftwareComponentInstanceImporter; +import fr.softeam.cameldesigner.exchange.importer.deploymentinstance.VMInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.execution.ActionInstanceImporter; import fr.softeam.cameldesigner.exchange.importer.execution.ApplicationMeasurementImporter; import fr.softeam.cameldesigner.exchange.importer.execution.CauseImporter; @@ -322,7 +355,6 @@ import fr.softeam.cameldesigner.exchange.importer.unit.UnitDimensionImporter; import fr.softeam.cameldesigner.exchange.importer.unit.UnitImporter; import fr.softeam.cameldesigner.exchange.importer.unit.UnitModelImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("40dfef3a-d77a-41ba-9c83-39058a242b09") public interface ICamelImporterVisitor { @@ -489,7 +521,7 @@ public interface ICamelImporterVisitor { Object visitPaaS(PaaSImporter paaSImporter); @objid ("4aab6751-6e87-4d25-b67b-2f7d62273f3f") - Object visitRequiredSet(RequiredSetImporter requiredSetImporter); + Object visitRequirementSet(RequirementSetImporter requiredSetImporter); @objid ("bd305f9b-5b70-4323-ba1e-bf404c770b9b") Object visitScriptConfiguration(ScriptConfiguationImporter scriptConfiguationImporter); @@ -801,6 +833,43 @@ public interface ICamelImporterVisitor { Object visitUnitModel(UnitModelImporter unitModelImporter); @objid ("c2198aa2-5cd9-400b-a4d4-2c30d86ec2e3") - Object visitCamelComponent(CamelComponentImporter camelComponent); + Object visitCamelComponent(ComponentImporter camelComponent); + + Object visitDeploymentInstanceModel(DeploymentInstanceModelImporter deploymentInstanceModelImporter); + + Object visitComponent(ComponentImporter component); + + Object visitComponentInstance(ComponentInstanceImporter componentInstance); + + Object visitSoftwareComponentInstance(SoftwareComponentInstanceImporter softwareComponentInstance); + + Object visitVMInstance(VMInstanceImporter vmInstance); + + Object visitComponentRelationInstance(ComponentRelationInstanceImporter componentRelationInstance); + + Object visitCommunicationInstance(CommunicationInstanceImporter communicationInstance); + + Object visitCommunicationPortInstance(CommunicationPortInstanceImporter communicationPortInstance); + + Object visitProvidedCommunicationInstance( + ProvidedCommunicationInstanceImporter providedCommunicationInstanceImporter); + + Object visitRequiredCommunicationInstance( + RequiredCommunicationInstanceImporter requiredCommunicationInstanceImporter); + + Object visitHostingInstance(HostingInstanceImporter hostingInstance); + + Object visitHostingPortInstance(HostingPortInstanceImporter hostingPortInstance); + + Object visitProvidedHostInstance(ProvidedHostInstanceImporter providedHostInstanceImporter); + + Object visitRequiredHostInstance(RequiredHostInstanceImporter requiredHostInstanceImporter); + + Object visitContainerInstance(ContainerInstanceImporter containerInstance); + + Object visitPaaSInstance(PaaSInstanceImporter paaSInstance); + + Object visitConstraintModel(ConstraintModelImporter constraintModelImporter); + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelVisitor.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelVisitor.java deleted file mode 100644 index 32568945..00000000 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/ICamelVisitor.java +++ /dev/null @@ -1,192 +0,0 @@ -package fr.softeam.cameldesigner.exchange.importer; - -import camel.core.CamelModel; -import camel.core.Feature; -import camel.core.Model; -import camel.core.NamedElement; -import camel.deployment.BuildConfiguration; -import camel.deployment.ClusterConfiguration; -import camel.deployment.Communication; -import camel.deployment.CommunicationPort; -import camel.deployment.ComponentRelation; -import camel.deployment.Configuration; -import camel.deployment.Container; -import camel.deployment.DeploymentModel; -import camel.deployment.DeploymentTypeModel; -import camel.deployment.EventConfiguration; -import camel.deployment.Hosting; -import camel.deployment.HostingPort; -import camel.deployment.LocationCoupling; -import camel.deployment.PaaS; -import camel.deployment.PaaSConfiguration; -import camel.deployment.RequirementSet; -import camel.deployment.ScriptConfiguration; -import camel.deployment.SoftwareComponent; -import camel.deployment.VM; -import camel.mms.MetaDataModel; -import camel.mms.MmsConcept; -import camel.mms.MmsObject; -import camel.organisation.CloudCredentials; -import camel.organisation.CloudProvider; -import camel.organisation.Credentials; -import camel.organisation.DataResourceFilter; -import camel.organisation.Entity; -import camel.organisation.ExternalIdentifier; -import camel.organisation.ModelResourceFilter; -import camel.organisation.Organisation; -import camel.organisation.OrganisationModel; -import camel.organisation.Permission; -import camel.organisation.PlatformCredentials; -import camel.organisation.ResourceFilter; -import camel.organisation.Role; -import camel.organisation.RoleAssignment; -import camel.organisation.ServiceResourceFilter; -import camel.organisation.SoftwareComponentResourceFilter; -import camel.organisation.User; -import camel.organisation.UserGroup; -import com.modeliosoft.modelio.javadesigner.annotations.objid; -import org.eclipse.emf.cdo.CDOObject; - -@objid ("a8b19413-363c-45c2-b062-781347a5179f") -public interface ICamelVisitor { - @objid ("47b2b7ac-40ff-403f-a428-5d50daef663b") - Object visitFeature(Feature feature); - - @objid ("f62b36a3-8219-495d-b0a2-c7d5fa08ff18") - Object visitCamelModel(CamelModel camelModel); - -// METADA - @objid ("8d04ac43-9de3-4004-97ae-bbaadb48aa8b") - Object visitMetaDataModel(MetaDataModel metaDataModel); - - @objid ("fe6417ad-2239-40c2-b19a-a787367e2b55") - Object visitMmsConcept(MmsConcept mmsConcept); - - @objid ("78535d51-26aa-44b0-b3d9-bb6a0ebf53f0") - Object visitMmsObject(MmsObject mmsObject); - - @objid ("43faa31c-f7cd-4f1f-8a0c-7829130cf68c") - Object visitModel(Model model); - - @objid ("206112f4-6089-4bfc-ab1d-03f9b3f57f84") - Object visitNamedElement(NamedElement namedElement); - - @objid ("84bb23e0-7ca5-4e7d-823b-a5e28d32efa6") - Object visitCDOObject(CDOObject object); - -// DEPLOYMENT - @objid ("d772d420-30ab-4feb-8567-fc9b92028802") - Object visitBuildConfiguration(BuildConfiguration buildconfiguration); - - @objid ("d5a7294a-458f-4e1e-b8b8-26628154e7b2") - Object visitClusterConfiguration(ClusterConfiguration clusterconfiguration); - - @objid ("56deafdb-4ff7-4e72-b3a2-0f7d2ac42133") - Object visitCommunication(Communication communication); - - @objid ("6f8ee056-fbd8-4ef9-890f-5dfe8b1d15fb") - Object visitCommunicationPort(CommunicationPort communicationPort); - - @objid ("8af4dfed-2419-4d78-b5df-f3b18cf530a5") - Object visitComponentRelation(ComponentRelation componentRelation); - - @objid ("98abb93c-3b2c-4e54-b8ca-3c1ebe5d9f08") - Object visitConfiguration(Configuration configuration); - - @objid ("f8bc9101-65cc-4fe2-9c63-f56eaabe39b5") - Object visitContainer(Container container); - - @objid ("86d97e60-71b9-4fec-9348-2dba9718cf87") - Object visitDeploymentModel(DeploymentModel deploymentModel); - - @objid ("84fad5d9-580e-4a5b-9e6f-f695ae34e4d4") - Object visitDeploymentTypeModel(DeploymentTypeModel deploymentTypeModel); - - @objid ("e9c3a78e-d871-49a8-8c00-e5f8a42e27ad") - Object visitEventConfiguration(EventConfiguration eventConfiguration); - - @objid ("219041cb-27d6-4399-bf9b-fa3b588208b3") - Object visitHosting(Hosting hosting); - - @objid ("60394b84-30c2-4aad-bfa6-689820414af7") - Object visitHostingPort(HostingPort hostingPort); - - @objid ("1c359770-e620-4d78-8c86-d70555f042a8") - Object visitLocationCoupling(LocationCoupling locationCoupling); - - @objid ("d66dd5b5-c8bc-4a50-8163-d84ede7cb32b") - Object visitPaaSConfiguration(PaaSConfiguration paaSConfiguration); - - @objid ("11476b2d-bfc7-4d64-971d-4f7f8f9aa399") - Object visitPaaS(PaaS paaS); - - @objid ("7d9867f0-ed73-43bb-a7fd-ee0431591158") - Object visitRequiredSet(RequirementSet requiredSet); - - @objid ("0d7c11e3-2675-4e27-a3a0-15e261c5ed5f") - Object visitScriptConfiguration(ScriptConfiguration scriptConfiguration); - - @objid ("f89bb525-8604-4a4a-9913-b3053f86b58a") - Object visitSoftwareComponent(SoftwareComponent softwareComponent); - - @objid ("53a5d859-dee2-474f-8e65-6deb35e7b6af") - Object visitVM(VM vm); - -// ORGANISATION - @objid ("a7ef7f78-deaf-4646-946e-b6b53af3cb3f") - Object visitCloudCredentials(CloudCredentials cloudCredentials); - - @objid ("b9db4964-711e-42b8-bcda-0adfef7f134d") - Object visitCloudProvider(CloudProvider cloudProvider); - - @objid ("597509d1-b9ad-405e-b6ec-e735e1b2be90") - Object visitCrendetials(Credentials credentials); - - @objid ("f588df64-4da7-46fd-a5f9-02344e5b6c4a") - Object visitDataResourceFilter(DataResourceFilter dataResourceFilter); - - @objid ("9614834d-d3b3-4e9f-9d43-c8e93c38b0be") - Object visitEntity(Entity entity); - - @objid ("cd2286f8-694d-4c62-850e-0bfec654f29d") - Object visitExternalIdentifier(ExternalIdentifier externalIdentifier); - - @objid ("4c3a3bff-093c-4d55-9539-4d73a92625bb") - Object visitModelResourceFilter(ModelResourceFilter modelResourceFilter); - - @objid ("bb2fa037-01ce-43fa-b6c1-abc092c0a7d5") - Object visitOrganisation(Organisation organisation); - - @objid ("9cd30c98-e1ae-49c8-9cff-4f7d67f8772c") - Object visitOrganisationModel(OrganisationModel organisationModel); - - @objid ("c6a39a2c-1894-4c30-999a-097ad3f71e15") - Object visitPermission(Permission permission); - - @objid ("9739eea8-1717-4453-b99b-2569c9776b55") - Object visitPlatformCredentials(PlatformCredentials platformCredentials); - - @objid ("48e38888-7e1d-4d34-8390-b624b5f101bc") - Object visitResourceFilter(ResourceFilter resourceFilter); - - @objid ("02ac7f6f-3775-4ea3-8043-3ba136bef4e8") - Object visitRoleAssignment(RoleAssignment roleAssignement); - - @objid ("0a114e28-e0a1-4bb3-b5e0-5765b90bc2d8") - Object visitRole(Role role); - - @objid ("8df884b1-1ae4-4f83-a3e2-21a6b8ee067c") - Object visitServiceResourceFilter(ServiceResourceFilter serviceResourceFilter); - - @objid ("3cbffcd5-8390-404e-b4c0-459aa8326308") - Object visitSoftwareComponentResourceFilter(SoftwareComponentResourceFilter softwareComponentResourceFilter); - - @objid ("546296c1-0781-46e0-86ce-d61ff8ce16c7") - Object visitUserGroup(UserGroup userGroup); - - @objid ("ebd261ab-46ef-4aaa-8199-87618dc3ced3") - Object visitUser(User user); - - -// Object visit(); -} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/IDefaultCamelVisitor.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/IDefaultCamelVisitor.java deleted file mode 100644 index a373615b..00000000 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/IDefaultCamelVisitor.java +++ /dev/null @@ -1,350 +0,0 @@ -package fr.softeam.cameldesigner.exchange.importer; - -import java.util.ArrayList; -import java.util.List; -import camel.core.CamelModel; -import camel.core.Feature; -import camel.core.Model; -import camel.core.NamedElement; -import camel.deployment.BuildConfiguration; -import camel.deployment.ClusterConfiguration; -import camel.deployment.Communication; -import camel.deployment.CommunicationPort; -import camel.deployment.ComponentRelation; -import camel.deployment.Configuration; -import camel.deployment.Container; -import camel.deployment.DeploymentModel; -import camel.deployment.DeploymentTypeModel; -import camel.deployment.EventConfiguration; -import camel.deployment.Hosting; -import camel.deployment.HostingPort; -import camel.deployment.LocationCoupling; -import camel.deployment.PaaS; -import camel.deployment.PaaSConfiguration; -import camel.deployment.RequirementSet; -import camel.deployment.ScriptConfiguration; -import camel.deployment.ServerlessConfiguration; -import camel.deployment.SoftwareComponent; -import camel.deployment.VM; -import camel.mms.MetaDataModel; -import camel.mms.MmsConcept; -import camel.mms.MmsObject; -import camel.organisation.CloudCredentials; -import camel.organisation.CloudProvider; -import camel.organisation.Credentials; -import camel.organisation.DataResourceFilter; -import camel.organisation.Entity; -import camel.organisation.ExternalIdentifier; -import camel.organisation.ModelResourceFilter; -import camel.organisation.Organisation; -import camel.organisation.OrganisationModel; -import camel.organisation.Permission; -import camel.organisation.PlatformCredentials; -import camel.organisation.ResourceFilter; -import camel.organisation.Role; -import camel.organisation.RoleAssignment; -import camel.organisation.ServiceResourceFilter; -import camel.organisation.SoftwareComponentResourceFilter; -import camel.organisation.User; -import camel.organisation.UserGroup; -import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.api.camelcore.standard.package_.SubModel; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.CamelComponent; -import fr.softeam.cameldesigner.exchange.importer.core.CamelElementImporter; -import fr.softeam.cameldesigner.exchange.importer.core.CamelModelImporter; -import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import fr.softeam.cameldesigner.exchange.importer.core.NamedElementImporter; -import fr.softeam.cameldesigner.exchange.importer.core.SubModelImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.BuildConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.CamelComponentImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ClusterConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationPortImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ComponentRelationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ContainerImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.DeploymentModelImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.DeploymentTypeModelImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.EventConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.HostingImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.HostingPortImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.LocationCouplingImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.PaaSConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.PaaSImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredSetImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ScriptConfiguationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.ServerlessConfigurationImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.SoftwareComponentImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.VMImporter; -import fr.softeam.cameldesigner.exchange.importer.metadata.MetaDataModelImporter; -import fr.softeam.cameldesigner.exchange.importer.metadata.MmsConceptImporter; -import fr.softeam.cameldesigner.exchange.importer.metadata.MmsObjectImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.CloudCredentialsImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.CloudProviderImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.CredentialsImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.DataResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.EntityImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ExternalIdentifierImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ModelResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.OrganisationImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.OrganisationModelImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.PermissionImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.PlatformCredentialsImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.RoleAssignmentImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.RoleImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.ServiceResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.SoftwareComponentResourceFilterImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.UserGroupImporter; -import fr.softeam.cameldesigner.exchange.importer.organisation.UserImporter; -import org.eclipse.emf.cdo.CDOObject; - -@objid ("95d27772-cd96-4ee0-9c20-5c6b05231e69") -public interface IDefaultCamelVisitor extends ICamelImporterVisitor { - @objid ("d8679bed-cac7-448a-a256-4116c2c3fca0") - @Override - default Object visitFeature(FeatureImporter feature) { - return visitNamedElement(feature); - } - - @objid ("413623cd-f194-47d4-b365-88cf49900c0b") - @Override - default Object visitCamelElement(CamelElementImporter camelElt) { - return null; - } - - @objid ("c4ae23ff-147f-45b2-8152-4eaace3f3df2") - @Override - default Object visitCamelModel(CamelModelImporter camelModel) { - return visitModel(camelModel); - } - - @objid ("87331245-7ea6-4eff-9417-7fa2cefc4a8b") - @Override - default Object visitMetaDataModel(MetaDataModelImporter metaDataModel) { - return visitModel(metaDataModel); - } - - @objid ("de3712b3-db3c-45de-bf38-272cd41fed53") - @Override - default Object visitMmsConcept(MmsConceptImporter mmsConcept) { - return visitMmsObject(mmsConcept); - } - - @objid ("0a5d2736-c4a5-493a-9b38-e8450cfd3784") - @Override - default Object visitMmsObject(MmsObjectImporter model) { - return null; - } - - @objid ("f5b2ba18-24d4-4e9a-a4d0-8d2bcd34be4d") - @Override - default Object visitModel(SubModelImporter model) { - return visitNamedElement(model); - } - - @objid ("132652c3-4893-4c7e-b78f-d7216ea6e485") - @Override - default Object visitNamedElement(NamedElementImporter namedElement) { - return visitCamelElement(namedElement); - } - - @objid ("0f01147e-8f03-4276-be9c-d27b5a5e347b") - default Object visitBuildConfiguration(BuildConfigurationImporter buildConfiguration) { - return visitCamelElement(buildConfiguration); - } - - @objid ("3257ad53-339f-42f8-838b-a8ad781c1a79") - default Object visitClusterConfiguration(ClusterConfigurationImporter clusterConfiguration) { - return visitCamelElement(clusterConfiguration); - } - - @objid ("88124796-21dd-4a6f-ae48-541771d39cbe") - default Object visitCommunication(CommunicationImporter communication) { - return visitCamelElement(communication); - } - - @objid ("5cea5ae0-01da-452f-ac36-489f2d5f415e") - default Object visitCommunicationPort(CommunicationPortImporter communicationPort) { - return visitCamelElement(communicationPort); - } - - @objid ("1e92e900-839b-461b-8419-2a71be792b63") - default Object visitComponentRelation(ComponentRelationImporter componentRelation) { - return visitCamelElement(componentRelation); - } - - @objid ("f8a10354-e4f8-4cf2-82b1-588b3b6fd840") - default Object visitConfiguration(ConfigurationImporter configuration) { - return visitCamelElement(configuration); - } - - @objid ("75d5e858-3034-4bfc-a346-6a52a9136fb3") - default Object visitContainer(ContainerImporter container) { - return visitCamelElement(container); - } - - @objid ("8eda5b81-c101-43be-ae6c-927788075af8") - default Object visitDeploymentModel(DeploymentModelImporter deploymentModel) { - return visitCamelElement(deploymentModel); - } - - @objid ("25fd6ae8-49e5-45b5-a47c-a1055e8baddd") - default Object visitDeploymentTypeModel(DeploymentTypeModelImporter deploymentTypeModel) { - return visitCamelElement(deploymentTypeModel); - } - - @objid ("54071317-4964-4f18-b8b7-46d5b382c605") - default Object visitEventConfiguration(EventConfigurationImporter eventConfiguration) { - return visitCamelElement(eventConfiguration); - } - - @objid ("c9ff54ce-dea8-43fa-af7b-2a9acde345a4") - default Object visitHosting(HostingImporter hosting) { - return visitCamelElement(hosting); - } - - @objid ("a534a553-02ac-4348-927e-bf97f7ea8e48") - default Object visitHostingPort(HostingPortImporter hostingPort) { - return visitCamelElement(hostingPort); - } - - @objid ("33c61d2f-42a4-46c2-8b1f-64296bc64293") - default Object visitLocationCoupling(LocationCouplingImporter locationCoupling) { - return visitCamelElement(locationCoupling); - } - - @objid ("f37dc69a-c835-4533-b5ce-1c8ff49d4e82") - default Object visitPaaSConfiguration(PaaSConfigurationImporter paaSConfiguration) { - return visitCamelElement(paaSConfiguration); - } - - @objid ("f907aba2-0c14-496a-9044-151417f16ac1") - default Object visitPaaS(PaaSImporter paaS) { - return visitCamelElement(paaS); - } - - @objid ("56730380-d4f9-4769-ac0f-0c18d432d074") - default Object visitRequiredSet(RequiredSetImporter requiredSet) { - return visitCamelElement(requiredSet); - } - - @objid ("3967de87-1b7f-4c64-bdc1-b0a0750d6469") - default Object visitScriptConfiguration(ScriptConfiguationImporter scriptConfiguration) { - return visitCamelElement(scriptConfiguration); - } - - @objid ("18b193b1-48c1-44bf-8588-c9e63f71ad98") - default Object visitServelessConfiguration(ServerlessConfigurationImporter serverlessConfiguration) { - return visitCamelElement(serverlessConfiguration); - } - - @objid ("b1395825-c4c2-494b-952b-29604e72389b") - default Object visitSoftwareComponent(SoftwareComponentImporter softwareComponent) { - return visitCamelElement(softwareComponent); - } - - @objid ("61ad82e3-06d2-4f32-814a-56f1c4bfd5e5") - default Object visitVM(VMImporter vm) { - return visitCamelElement(vm); - } - -//ORGANISATION - @objid ("b2d80c9b-ccda-4ad0-b46c-99f92d49c46f") - default Object visitCloudCredentials(CloudCredentialsImporter cloudCredentials) { - return visitCamelElement(cloudCredentials); - } - - @objid ("907d8cfe-f118-4e5d-9374-bd80b4b630ff") - default Object visitCloudProvider(CloudProviderImporter cloudProvider) { - return visitCamelElement(cloudProvider); - } - - @objid ("def6b337-21a4-4e3a-8754-7194ad2ca9d0") - default Object visitCredentials(CredentialsImporter credentials) { - return visitCamelElement(credentials); - } - - @objid ("2c78755e-b383-4976-9f33-c7eb80efd094") - default Object visitDataResourceFilter(DataResourceFilterImporter dataResourceFilter) { - return visitCamelElement(dataResourceFilter); - } - - @objid ("99bd1574-23b1-460b-a609-0819f4517639") - default Object visitEntity(EntityImporter entity) { - return visitCamelElement(entity); - } - - @objid ("bee8f609-086a-4340-8d70-5ca2a7e7ec0e") - default Object visitExternalIdentifier(ExternalIdentifierImporter externalIdentifier) { - return visitCamelElement(externalIdentifier); - } - - @objid ("a8748b8c-6196-4b51-bc7e-e4905e6a7542") - default Object visitModelResourceFilter(ModelResourceFilterImporter modelResourceFilter) { - return visitCamelElement(modelResourceFilter); - } - - @objid ("4c4be9e8-1e89-42e9-acb7-0fc58aea1906") - default Object visitOrganisation(OrganisationImporter organisation) { - return visitCamelElement(organisation); - } - - @objid ("2e42428e-9edb-4fa9-953b-3e14ae7d5c16") - default Object visitOrganisationModel(OrganisationModelImporter organisationModel) { - return visitCamelElement(organisationModel); - } - - @objid ("c1d1ad4c-ec1a-4555-ad85-3ee796a956fc") - default Object visitPermission(PermissionImporter permission) { - return visitCamelElement(permission); - } - - @objid ("f5c08e57-910e-486d-8e6a-4fd0984f7a55") - default Object visitPlatformCredentials(PlatformCredentialsImporter platformCredentials) { - return visitCamelElement(platformCredentials); - } - - @objid ("e1184071-6904-4c37-9a71-c0d22d7a7f2f") - default Object visitResourceFilter(ResourceFilterImporter resourceFilter) { - return visitCamelElement(resourceFilter); - } - - @objid ("93bbfb83-7c17-415f-9f84-9cf2ff6763ce") - default Object visitRoleAssignment(RoleAssignmentImporter roleAssignment) { - return visitCamelElement(roleAssignment); - } - - @objid ("712d91ed-1be9-4dd8-b28d-4fba06846ef1") - default Object visitRole(RoleImporter role) { - return visitCamelElement(role); - } - - @objid ("887ea456-3e77-4512-b6b0-e6539787cee1") - default Object visitServiceResourceFilter(ServiceResourceFilterImporter serviceResourceFilter) { - return visitCamelElement(serviceResourceFilter); - } - - @objid ("1d64ffb9-7efc-4543-b543-459a7833eba6") - default Object visitSoftwareComponentResourceFilter(SoftwareComponentResourceFilterImporter softwareComponentResourceFilter) { - return visitCamelElement(softwareComponentResourceFilter); - } - - @objid ("d34c65b6-ebe3-403b-922f-d54ae1009247") - default Object visitUserGroup(UserGroupImporter userGroup) { - return visitCamelElement(userGroup); - } - - @objid ("c89eb05d-4fe3-451a-980c-48b6036f5641") - default Object visitUser(UserImporter user) { - return visitCamelElement(user); - } - - @objid ("f04657d6-70f1-4198-8ebe-1ea23b9c6f9a") - @Override - default Object visitCamelComponent(CamelComponentImporter camelComponent) { - return visitCamelElement(camelComponent); - } - -} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/ImporterFactory.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/ImporterFactory.java index afe475a1..952a12ce 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/ImporterFactory.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/ImporterFactory.java @@ -2,8 +2,13 @@ import java.util.HashMap; import java.util.Map; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.core.impl.AttributeImpl; import camel.core.impl.CamelModelImpl; import camel.core.impl.FeatureImpl; +import camel.core.impl.MeasurableAttributeImpl; +import camel.core.impl.QualityAttributeImpl; import camel.deployment.impl.BuildConfigurationImpl; import camel.deployment.impl.ClusterConfigurationImpl; import camel.deployment.impl.CommunicationImpl; @@ -28,6 +33,10 @@ import camel.deployment.impl.ServerlessConfigurationImpl; import camel.deployment.impl.SoftwareComponentImpl; import camel.deployment.impl.VMImpl; +import camel.location.impl.CloudLocationImpl; +import camel.location.impl.GeographicalRegionImpl; +import camel.location.impl.LocationImpl; +import camel.location.impl.LocationModelImpl; import camel.metric.impl.AttributeContextImpl; import camel.metric.impl.CompositeMetricContextImpl; import camel.metric.impl.CompositeMetricImpl; @@ -70,7 +79,6 @@ import camel.organisation.impl.SoftwareComponentResourceFilterImpl; import camel.organisation.impl.UserGroupImpl; import camel.organisation.impl.UserImpl; -import camel.requirement.impl.HardRequirementImpl; import camel.requirement.impl.HorizontalScaleRequirementImpl; import camel.requirement.impl.ImageRequirementImpl; import camel.requirement.impl.LocationRequirementImpl; @@ -82,13 +90,14 @@ import camel.requirement.impl.ResourceRequirementImpl; import camel.requirement.impl.SecurityRequirementImpl; import camel.requirement.impl.ServiceLevelObjectiveImpl; -import camel.requirement.impl.SoftRequirementImpl; import camel.requirement.impl.VerticalScaleRequirementImpl; -import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import camel.type.impl.ValueImpl; +import fr.softeam.cameldesigner.exchange.importer.core.AttributeImporter; import fr.softeam.cameldesigner.exchange.importer.core.CamelElementImporter; import fr.softeam.cameldesigner.exchange.importer.core.CamelModelImporter; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; +import fr.softeam.cameldesigner.exchange.importer.core.MeasurableAttributeImporter; +import fr.softeam.cameldesigner.exchange.importer.core.QualityAttributeImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.BuildConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ClusterConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.CommunicationImporter; @@ -108,11 +117,15 @@ import fr.softeam.cameldesigner.exchange.importer.deployment.ProvidedHostImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredCommunicationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredHostImporter; -import fr.softeam.cameldesigner.exchange.importer.deployment.RequiredSetImporter; +import fr.softeam.cameldesigner.exchange.importer.deployment.RequirementSetImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ScriptConfiguationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.ServerlessConfigurationImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.SoftwareComponentImporter; import fr.softeam.cameldesigner.exchange.importer.deployment.VMImporter; +import fr.softeam.cameldesigner.exchange.importer.location.CloudLocationImporter; +import fr.softeam.cameldesigner.exchange.importer.location.GeographicalRegionImporter; +import fr.softeam.cameldesigner.exchange.importer.location.LocationImporter; +import fr.softeam.cameldesigner.exchange.importer.location.LocationModelImporter; import fr.softeam.cameldesigner.exchange.importer.metadata.MetaDataModelImporter; import fr.softeam.cameldesigner.exchange.importer.metadata.MmsConceptImporter; import fr.softeam.cameldesigner.exchange.importer.metadata.MmsConceptInstanceImporter; @@ -167,7 +180,7 @@ import fr.softeam.cameldesigner.exchange.importer.requirement.SecurityRequirementImporter; import fr.softeam.cameldesigner.exchange.importer.requirement.ServiceLevelObjectiveImporter; import fr.softeam.cameldesigner.exchange.importer.requirement.VerticalScaleRequirementImporter; -import org.eclipse.emf.cdo.CDOObject; +import fr.softeam.cameldesigner.exchange.importer.type.ValueImporter; /** * Factory that instantiates the right importer class for a model element stereotyped by a 'CamelDesigner' module stereotype. @@ -175,125 +188,141 @@ @objid ("7b18247b-a2c1-4fda-8356-d4b90b2cb9f7") public class ImporterFactory { @objid ("c3ea94fe-bede-493a-997a-3217ea1176ee") - private static Map, CamelElementImporter> _factory = new HashMap<>(); + private static Map, Class> _factory = new HashMap<>(); @objid ("c8dc8e2d-b3e2-4418-9f8f-ec583df230cd") public static CamelElementImporter getImporter(CDOObject elt) throws Exception { if (!_factory.containsKey(elt.getClass())) { throw new IllegalArgumentException("Missing Element Factory for Type " + elt.getClass()); } - - CamelElementImporter importer = _factory.get(elt.getClass()); - importer.setElement(elt); - return importer; + + Object obj = _factory.get(elt.getClass()).newInstance(); + if (obj instanceof CamelElementImporter) { + CamelElementImporter importer = (CamelElementImporter) obj; + importer.setElement(elt); + return importer; + } + return null; } static { + //CORE + _factory.put(CamelModelImpl.class, CamelModelImporter.class); + _factory.put(FeatureImpl.class, FeatureImporter.class); + _factory.put(AttributeImpl.class, AttributeImporter.class); + _factory.put(QualityAttributeImpl.class, QualityAttributeImporter.class); + _factory.put(MeasurableAttributeImpl.class, MeasurableAttributeImporter.class); + + // TYPE + _factory.put(ValueImpl.class, ValueImporter.class); + // METADATA - _factory.put(CamelModelImpl.class, new CamelModelImporter<>()); - _factory.put(FeatureImpl.class, new FeatureImporter<>()); - _factory.put(MetaDataModelImpl.class, new MetaDataModelImporter<>()); - _factory.put(MmsConceptImpl.class, new MmsConceptImporter<>()); - _factory.put(MmsConceptInstanceImpl.class, new MmsConceptInstanceImporter<>()); - _factory.put(MmsPropertyInstanceImpl.class, new MmsPropertyInstanceImporter<>()); - _factory.put(MmsPropertyImpl.class, new MmsPropertyImporter<>()); + + _factory.put(MetaDataModelImpl.class, MetaDataModelImporter.class); + _factory.put(MmsConceptImpl.class, MmsConceptImporter.class); + _factory.put(MmsConceptInstanceImpl.class, MmsConceptInstanceImporter.class); + _factory.put(MmsPropertyInstanceImpl.class, MmsPropertyInstanceImporter.class); + _factory.put(MmsPropertyImpl.class, MmsPropertyImporter.class); // DEPLOYMENT - _factory.put(BuildConfigurationImpl.class, new BuildConfigurationImporter<>()); - _factory.put(ClusterConfigurationImpl.class, new ClusterConfigurationImporter<>()); - _factory.put(CommunicationImpl.class, new CommunicationImporter<>()); - _factory.put(CommunicationPortImpl.class, new CommunicationPortImporter<>()); - _factory.put(ComponentRelationImpl.class, new ComponentRelationImporter<>()); - _factory.put(ConfigurationImpl.class, new ConfigurationImporter<>()); - _factory.put(ContainerImpl.class, new ContainerImporter<>()); - _factory.put(DeploymentModelImpl.class, new DeploymentModelImporter<>()); - _factory.put(DeploymentTypeModelImpl.class, new DeploymentTypeModelImporter<>()); - _factory.put(EventConfigurationImpl.class, new EventConfigurationImporter<>()); - _factory.put(HostingImpl.class, new HostingImporter<>()); - _factory.put(HostingPortImpl.class, new HostingPortImporter<>()); - _factory.put(LocationCouplingImpl.class, new LocationCouplingImporter<>()); - _factory.put(PaaSConfigurationImpl.class, new PaaSConfigurationImporter<>()); - _factory.put(PaaSImpl.class, new PaaSImporter<>()); - _factory.put(ProvidedCommunicationImpl.class, new ProvidedCommunicationImporter<>()); - _factory.put(ProvidedHostImpl.class, new ProvidedHostImporter<>()); - _factory.put(RequiredCommunicationImpl.class, new RequiredCommunicationImporter<>()); - _factory.put(RequiredHostImpl.class, new RequiredHostImporter<>()); - _factory.put(RequirementSetImpl.class, new RequiredSetImporter<>()); - _factory.put(ScriptConfigurationImpl.class, new ScriptConfiguationImporter<>()); - _factory.put(ServerlessConfigurationImpl.class, new ServerlessConfigurationImporter<>()); - _factory.put(SoftwareComponentImpl.class, new SoftwareComponentImporter<>()); - _factory.put(VMImpl.class, new VMImporter<>()); + _factory.put(BuildConfigurationImpl.class, BuildConfigurationImporter.class); + _factory.put(ClusterConfigurationImpl.class, ClusterConfigurationImporter.class); + _factory.put(CommunicationImpl.class, CommunicationImporter.class); + _factory.put(CommunicationPortImpl.class, CommunicationPortImporter.class); + _factory.put(ComponentRelationImpl.class, ComponentRelationImporter.class); + _factory.put(ConfigurationImpl.class, ConfigurationImporter.class); + _factory.put(ContainerImpl.class, ContainerImporter.class); + _factory.put(DeploymentModelImpl.class, DeploymentModelImporter.class); + _factory.put(DeploymentTypeModelImpl.class, DeploymentTypeModelImporter.class); + _factory.put(EventConfigurationImpl.class, EventConfigurationImporter.class); + _factory.put(HostingImpl.class, HostingImporter.class); + _factory.put(HostingPortImpl.class, HostingPortImporter.class); + _factory.put(LocationCouplingImpl.class, LocationCouplingImporter.class); + _factory.put(PaaSConfigurationImpl.class, PaaSConfigurationImporter.class); + _factory.put(PaaSImpl.class, PaaSImporter.class); + _factory.put(ProvidedCommunicationImpl.class, ProvidedCommunicationImporter.class); + _factory.put(ProvidedHostImpl.class, ProvidedHostImporter.class); + _factory.put(RequiredCommunicationImpl.class, RequiredCommunicationImporter.class); + _factory.put(RequiredHostImpl.class, RequiredHostImporter.class); + _factory.put(RequirementSetImpl.class, RequirementSetImporter.class); + _factory.put(ScriptConfigurationImpl.class, ScriptConfiguationImporter.class); + _factory.put(ServerlessConfigurationImpl.class, ServerlessConfigurationImporter.class); + _factory.put(SoftwareComponentImpl.class, SoftwareComponentImporter.class); + _factory.put(VMImpl.class, VMImporter.class); // REQUIREMENT - _factory.put(RequirementModelImpl.class, new RequirementModelImporter<>()); - _factory.put(ServiceLevelObjectiveImpl.class, new ServiceLevelObjectiveImporter<>()); - _factory.put(ProviderRequirementImpl.class, new ProviderRequirementImporter<>() ); - _factory.put(OSRequirementImpl.class, new OSRequirementImporter<>()); - _factory.put(SecurityRequirementImpl.class, new SecurityRequirementImporter<>()); - _factory.put(LocationRequirementImpl.class, new LocationRequirementImporter<>()); - _factory.put(ImageRequirementImpl.class, new ImageRequirementImporter<>()); - _factory.put(HorizontalScaleRequirementImpl.class, new HorizontalScaleRequirementImporter<>()); - _factory.put(VerticalScaleRequirementImpl.class, new VerticalScaleRequirementImporter<>() ); - _factory.put(OptimisationRequirementImpl.class, new OptimisationRequirementImporter<>()); - _factory.put(ResourceRequirementImpl.class, new ResourceRequirementImporter<>()); - _factory.put(PaaSRequirementImpl.class, new PaaSRequirementImporter<>()); + _factory.put(RequirementModelImpl.class, RequirementModelImporter.class); + _factory.put(ServiceLevelObjectiveImpl.class, ServiceLevelObjectiveImporter.class); + _factory.put(ProviderRequirementImpl.class, ProviderRequirementImporter.class); + _factory.put(OSRequirementImpl.class, OSRequirementImporter.class); + _factory.put(SecurityRequirementImpl.class, SecurityRequirementImporter.class); + _factory.put(LocationRequirementImpl.class, LocationRequirementImporter.class); + _factory.put(ImageRequirementImpl.class, ImageRequirementImporter.class); + _factory.put(HorizontalScaleRequirementImpl.class, HorizontalScaleRequirementImporter.class); + _factory.put(VerticalScaleRequirementImpl.class, VerticalScaleRequirementImporter.class); + _factory.put(OptimisationRequirementImpl.class, OptimisationRequirementImporter.class); + _factory.put(ResourceRequirementImpl.class, ResourceRequirementImporter.class); + _factory.put(PaaSRequirementImpl.class, PaaSRequirementImporter.class); + - // ORGANISATION - _factory.put(CloudCredentialsImpl.class, new CloudCredentialsImporter<>()); - _factory.put(CloudProviderImpl.class, new CloudProviderImporter<>()); - _factory.put(CredentialsImpl.class, new CredentialsImporter<>() ); - _factory.put(DataResourceFilterImpl.class, new DataResourceFilterImporter<>()); - _factory.put(EntityImpl.class, new EntityImporter<>()); - _factory.put(ExternalIdentifierImpl.class, new ExternalIdentifierImporter<>()); - _factory.put(ModelResourceFilterImpl.class, new ModelResourceFilterImporter<>()); - _factory.put(OrganisationImpl.class, new OrganisationImporter<>()); - _factory.put(OrganisationModelImpl.class, new OrganisationModelImporter<>()); - _factory.put(PermissionImpl.class, new PermissionImporter<>()); - _factory.put(PlatformCredentialsImpl.class, new PlatformCredentialsImporter<>()); - _factory.put(ResourceFilterImpl.class, new ResourceFilterImporter<>()); - _factory.put(RoleAssignmentImpl.class, new RoleAssignmentImporter<>() ); - _factory.put(RoleImpl.class, new RoleImporter<>()); - _factory.put(ServiceResourceFilterImpl.class, new ServiceResourceFilterImporter<>()); - _factory.put(SoftwareComponentResourceFilterImpl.class, new SoftwareComponentResourceFilterImporter<>()); - _factory.put(UserGroupImpl.class, new UserGroupImporter<>()); - _factory.put(UserImpl.class, new UserImporter<>() ); + _factory.put(CloudCredentialsImpl.class, CloudCredentialsImporter.class); + _factory.put(CloudProviderImpl.class, CloudProviderImporter.class); + _factory.put(CredentialsImpl.class, CredentialsImporter.class); + _factory.put(DataResourceFilterImpl.class, DataResourceFilterImporter.class); + _factory.put(EntityImpl.class, EntityImporter.class); + _factory.put(ExternalIdentifierImpl.class, ExternalIdentifierImporter.class); + _factory.put(ModelResourceFilterImpl.class, ModelResourceFilterImporter.class); + _factory.put(OrganisationImpl.class, OrganisationImporter.class); + _factory.put(OrganisationModelImpl.class, OrganisationModelImporter.class); + _factory.put(PermissionImpl.class, PermissionImporter.class); + _factory.put(PlatformCredentialsImpl.class, PlatformCredentialsImporter.class); + _factory.put(ResourceFilterImpl.class, ResourceFilterImporter.class); + _factory.put(RoleAssignmentImpl.class, RoleAssignmentImporter.class); + _factory.put(RoleImpl.class, RoleImporter.class); + _factory.put(ServiceResourceFilterImpl.class, ServiceResourceFilterImporter.class); + _factory.put(SoftwareComponentResourceFilterImpl.class, SoftwareComponentResourceFilterImporter.class); + _factory.put(UserGroupImpl.class, UserGroupImporter.class); + _factory.put(UserImpl.class, UserImporter.class); // METRIC - _factory.put(AttributeContextImpl.class, new AttributeContextImporter<>()); - _factory.put(CompositeMetricContextImpl.class, new CompositeMetricContextImporter<>() ); - _factory.put(CompositeMetricImpl.class, new CompositeMetricImporter<>()); - _factory.put(FunctionImpl.class, new FunctionImporter<>()); - _factory.put(MetricContextImpl.class, new MetricContextImporter<>()); - _factory.put(MetricImpl.class, new MetricImporter<>()); - _factory.put(MetricInstanceImpl.class, new MetricInstanceImporter<>()); - _factory.put(MetricInstanceModelImpl.class, new MetricInstanceModelImporter<>()); - _factory.put(MetricModelImpl.class, new MetricModelImporter<>()); - _factory.put(MetricObjectBindingImpl.class, new MetricObjectBindingImporter<>()); - _factory.put(MetricTemplateImpl.class, new MetricTemplateImporter<>()); - _factory.put(MetricTypeModelImpl.class, new MetricTypeModelImporter<>()); - _factory.put(MetricVariableImpl.class, new MetricVariableImporter<>()); - _factory.put(ObjectContextImpl.class, new ObjectContextImporter<>()); - _factory.put(RawMetricImpl.class, new RawMetricImporter<>()); - _factory.put(RawMetricContextImpl.class, new RawMetricContextImporter<>()); - _factory.put(ScheduleImpl.class, new ScheduleImporter<>()); - _factory.put(SensorImpl.class, new SensorImporter<>() ); - _factory.put(WindowImpl.class, new WindowImporter<>() ); + _factory.put(AttributeContextImpl.class, AttributeContextImporter.class); + _factory.put(CompositeMetricContextImpl.class, CompositeMetricContextImporter.class); + _factory.put(CompositeMetricImpl.class, CompositeMetricImporter.class); + _factory.put(FunctionImpl.class, FunctionImporter.class); + _factory.put(MetricContextImpl.class, MetricContextImporter.class); + _factory.put(MetricImpl.class, MetricImporter.class); + _factory.put(MetricInstanceImpl.class, MetricInstanceImporter.class); + _factory.put(MetricInstanceModelImpl.class, MetricInstanceModelImporter.class); + _factory.put(MetricModelImpl.class, MetricModelImporter.class); + _factory.put(MetricObjectBindingImpl.class, MetricObjectBindingImporter.class); + _factory.put(MetricTemplateImpl.class, MetricTemplateImporter.class); + _factory.put(MetricTypeModelImpl.class, MetricTypeModelImporter.class); + _factory.put(MetricVariableImpl.class, MetricVariableImporter.class); + _factory.put(ObjectContextImpl.class, ObjectContextImporter.class); + _factory.put(RawMetricImpl.class, RawMetricImporter.class); + _factory.put(RawMetricContextImpl.class, RawMetricContextImporter.class); + _factory.put(ScheduleImpl.class, ScheduleImporter.class); + _factory.put(SensorImpl.class, SensorImporter.class); + _factory.put(WindowImpl.class, WindowImporter.class); // LOCATION - - + + _factory.put(LocationModelImpl.class, LocationModelImporter.class); + _factory.put(LocationImpl.class, LocationImporter.class); + _factory.put(CloudLocationImpl.class, CloudLocationImporter.class); + _factory.put(GeographicalRegionImpl.class, GeographicalRegionImporter.class); + // EXECUTION - // _factory.put(.class, new ); - + + // SCALABILITY // SECURITY - // TYPE diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/AttributeConstraintImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/AttributeConstraintImporter.java index ca020477..52b184cd 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/AttributeConstraintImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/AttributeConstraintImporter.java @@ -32,7 +32,6 @@ public CamelElement createCamelElt(CDOObject owner) { @objid ("a1e4941d-9f7c-45a7-815e-e9e95a97c3d5") @Override public void attach(V elt, CamelElement context) { - super.attach(elt, context); } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/ConstraintModelImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/ConstraintModelImporter.java new file mode 100644 index 00000000..8bead2e7 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/ConstraintModelImporter.java @@ -0,0 +1,32 @@ +package fr.softeam.cameldesigner.exchange.importer.constraint; + +import org.eclipse.emf.cdo.CDOObject; +import camel.constraint.ConstraintModel; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; +import fr.softeam.cameldesigner.exchange.importer.core.SubModelImporter; + + +public class ConstraintModelImporter extends SubModelImporter { + + public ConstraintModelImporter() { + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitConstraintModel(this); + } + + + public ConstraintModelImporter(T elt) { + super(elt); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return null; + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/IfThenConstraintImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/IfThenConstraintImporter.java index e84767ef..9641fe75 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/IfThenConstraintImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/IfThenConstraintImporter.java @@ -29,4 +29,10 @@ public CamelElement createCamelElt(CDOObject owner) { return fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.IfThenConstraint.create(); } + @objid ("9d9e8e57-267c-46ff-a1e8-dd37311c1d57") + @Override + public void attach(V elt, CamelElement context) { + // TODO Auto-generated method stub + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/LogicalConstraintImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/LogicalConstraintImporter.java index 94335f19..3994348d 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/LogicalConstraintImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/LogicalConstraintImporter.java @@ -29,4 +29,10 @@ public CamelElement createCamelElt(CDOObject owner) { return fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.LogicalConstraint.create(); } + @objid ("f0b65241-e5b0-4b4b-9ce3-86305a11d065") + @Override + public void attach(V elt, CamelElement context) { + // TODO Auto-generated method stub + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricConstraintImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricConstraintImporter.java index 9e91285e..868acd7c 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricConstraintImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricConstraintImporter.java @@ -29,4 +29,10 @@ public CamelElement createCamelElt(CDOObject owner) { return fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.MetricConstraint.create(); } + @objid ("66493fbf-0f14-4383-902b-667a952d956d") + @Override + public void attach(V elt, CamelElement context) { + // TODO Auto-generated method stub + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricVariableConstraintImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricVariableConstraintImporter.java index 25444d2e..b92dc71f 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricVariableConstraintImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/constraint/MetricVariableConstraintImporter.java @@ -29,4 +29,10 @@ public CamelElement createCamelElt(CDOObject owner) { return fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.MetricVariableConstraint.create(); } + @objid ("4e28e761-59a2-4dfc-bf97-5b8a07f80537") + @Override + public void attach(V elt, CamelElement context) { + // TODO Auto-generated method stub + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/AttributeImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/AttributeImporter.java index 2c15242c..61766a19 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/AttributeImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/AttributeImporter.java @@ -1,10 +1,24 @@ package fr.softeam.cameldesigner.exchange.importer.core; import camel.core.Attribute; +import camel.mms.MmsObject; +import camel.type.BooleanValue; +import camel.type.DoubleValue; +import camel.type.FloatValue; +import camel.type.IntValue; +import camel.type.StringValue; +import camel.type.Value; +import camel.type.ValueType; +import camel.unit.Unit; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.camelcore.standard.attribute.AttributeAttribute; +import fr.softeam.cameldesigner.api.camelcore.standard.classifier.FeatureClassifier; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.common.util.EList; +import org.modelio.metamodel.uml.infrastructure.ModelElement; @objid ("804d7722-af37-42b3-ace8-7102790c372c") public class AttributeImporter extends NamedElementImporter { @@ -21,18 +35,29 @@ public Object accept(ICamelImporterVisitor v) { @objid ("665b14ab-5a4c-4175-aeb0-35fa05bfd588") @Override public CamelElement createCamelElt(CDOObject owner) { - return null; + ModelElement value = this._process.getElement(owner).getElement(); + + if ( value instanceof org.modelio.metamodel.uml.statik.Package) + return fr.softeam.cameldesigner.api.camelcore.standard.class_.AttributeClass.create(); + if ( value instanceof org.modelio.metamodel.uml.statik.Class) + return fr.softeam.cameldesigner.api.camelcore.standard.attribute.AttributeAttribute.create(); + else + return null; } @objid ("8c4f7bea-5e16-4322-a673-3d0db11f72cd") @Override public void setProperties(V elt) { - super.setProperties(elt); + setValueType(elt); + setUnit(elt); + setValue(elt); } @objid ("17db46cd-3cb3-4a60-8e59-469a497c8cea") @Override public void attach(V elt, CamelElement context) { + if ((context instanceof FeatureClassifier) &&( elt instanceof AttributeAttribute)) + ((FeatureClassifier) context).addAttributes((AttributeAttribute) elt); } @objid ("b8229cdb-32b8-4dd8-9bb3-3d64a073a537") @@ -40,4 +65,50 @@ public AttributeImporter(T elt) { super(elt); } + @objid ("db3190ad-fde9-4298-8ae7-f84e26c05f62") + private void setValue(V elt) { + Value value = this._element.getValue(); + if (value != null) { + if (value instanceof IntValue) { + elt.setValue(String.valueOf(((IntValue)value).getValue())); + } + else if (value instanceof BooleanValue) { + elt.setValue(String.valueOf(((BooleanValue)value).isValue())); + } + else if (value instanceof FloatValue) { + elt.setValue(String.valueOf(((FloatValue)value).getValue())); + } + else if (value instanceof DoubleValue) { + elt.setValue(String.valueOf(((DoubleValue)value).getValue())); + } + else if (value instanceof StringValue) { + elt.setValue(((StringValue)value).getValue()); + } + } + } + + @objid ("e0399787-49a9-476a-814f-ef33f0d2c469") + private void setUnit(V elt) { + Unit value = this._element.getUnit(); + if (value != null) { + CamelElement valueElt = this._process.getElement(value); + if (valueElt instanceof fr.softeam.cameldesigner.api.unitmodel.standard.datatype.Unit) { + elt.setUnit( (fr.softeam.cameldesigner.api.unitmodel.standard.datatype.Unit) valueElt); + + } + } + } + + @objid ("a8758e25-a083-4159-b98b-ef6f85ca08be") + private void setValueType(V elt) { + // TODO Auto-generated method stub + ValueType value = this._element.getValueType(); + if (value != null) { + CamelElement valueElt = this._process.getElement(value); + if (valueElt instanceof fr.softeam.cameldesigner.api.typemodel.standard.datatype.ValueType) + elt.setValueType((fr.softeam.cameldesigner.api.typemodel.standard.datatype.ValueType) valueElt); + + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/CamelElementImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/CamelElementImporter.java index 90312806..5439e8ae 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/CamelElementImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/CamelElementImporter.java @@ -1,11 +1,11 @@ package fr.softeam.cameldesigner.exchange.importer.core; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.IImporter; import fr.softeam.cameldesigner.exchange.importer.ImportProcess; -import org.eclipse.emf.cdo.CDOObject; @objid ("a380bcee-5614-4bbb-ae51-4fce0eb8f1fe") public abstract class CamelElementImporter implements IImporter { @@ -24,6 +24,7 @@ public T getElement() { return this._element; } + @objid ("2c5f32c3-07a3-46e4-934d-da8a21604749") public void setProcess(ImportProcess process) { this._process = process; diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/FeatureImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/FeatureImporter.java index ce0f6451..94b8a141 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/FeatureImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/FeatureImporter.java @@ -30,7 +30,7 @@ public void setProperties(V elt) { @Override public void attach(V elt, CamelElement context) { if ((elt instanceof FeatureClassifier) && (context instanceof FeatureClassifier)) - ((FeatureClassifier) elt).getSubFeatures().add((FeatureClassifier)context); + ((FeatureClassifier) context).addSubFeatures((FeatureClassifier)elt); } @objid ("26dbd316-0ffe-469f-94ac-abf7ec73cedb") diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/MeasurableAttributeImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/MeasurableAttributeImporter.java index b4ffc489..d1af1c71 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/MeasurableAttributeImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/MeasurableAttributeImporter.java @@ -1,10 +1,15 @@ package fr.softeam.cameldesigner.exchange.importer.core; -import camel.core.MeasurableAttribute; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import org.modelio.metamodel.uml.statik.Package; +import camel.core.MeasurableAttribute; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.camelcore.standard.attribute.MeasurableAttributeAttribute; +import fr.softeam.cameldesigner.api.camelcore.standard.class_.AttributeClass; +import fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttributeClass; +import fr.softeam.cameldesigner.api.metricmodel.standard.package_.MetricTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("140dee83-8c43-420a-9d7c-64075ff03fc9") public class MeasurableAttributeImporter extends QualityAttributeImporter { @@ -27,6 +32,9 @@ public void setProperties(V elt) { @objid ("0d5f4286-44ea-40ab-8844-9ee213424671") @Override public void attach(V elt, CamelElement context) { + if ((context instanceof MetricTypeModel) && (elt instanceof AttributeClass)) { + ((MetricTypeModel) context).addAttributes((AttributeClass) elt); + } } @objid ("3a82108e-9985-43ab-997d-6d34c05739af") @@ -37,6 +45,16 @@ public MeasurableAttributeImporter(T elt) { @objid ("3314abcb-df01-4214-9cf6-4bfed700c96f") @Override public CamelElement createCamelElt(CDOObject owner) { + CamelElement camOwner = this._process.getElement(owner); + + if (camOwner != null) { + if (camOwner.getElement() instanceof Package) { + return MeasurableAttributeClass.create(); + }else { + return MeasurableAttributeAttribute.create(); + } + } + return null; } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/NamedElementImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/NamedElementImporter.java index 6080bfeb..f082a794 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/NamedElementImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/core/NamedElementImporter.java @@ -1,12 +1,14 @@ package fr.softeam.cameldesigner.exchange.importer.core; -import camel.core.NamedElement; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.common.util.EList; +import camel.core.NamedElement; +import camel.mms.MmsObject; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; @objid ("1841f351-6417-46a7-aa5e-a351bae5ee5c") -public abstract class NamedElementImporter extends CamelElementImporter { +public abstract class NamedElementImporter extends CamelElementImporter { @objid ("0bc330fe-2803-44c9-972d-9415258cddd7") public NamedElementImporter() { } @@ -22,12 +24,7 @@ public Object accept(ICamelImporterVisitor v) { public void setProperties(V elt) { setName(elt); setDescription(elt); - } - - @objid ("762fc7e2-08d2-4286-9ebd-939a94707389") - @Override - public void attach(V elt, CamelElement context) { - // TODO Auto-generated method stub + setAnnotations(elt); } @objid ("bbd61cfc-d9ba-40e5-a08b-8e99cf29dbdb") @@ -51,4 +48,19 @@ private void setName(V elt) { } } + @objid ("a7ccca6d-d449-4f8b-be7c-ef829a33121a") + private void setAnnotations(V elt) { + // TODO Auto-generated method stub + EList value = this._element.getAnnotations(); + if (value != null) { + for (MmsObject obj: value) { + CamelElement valueElt = this._process.getElement(obj); + if (valueElt instanceof fr.softeam.cameldesigner.api.metadatamodel.infrastructure.modelelement.MmsObject) { + elt.addAnnotations((fr.softeam.cameldesigner.api.metadatamodel.infrastructure.modelelement.MmsObject) valueElt); + + } + } + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/data/DataTypeModelImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/data/DataTypeModelImporter.java index 8309cb55..3d5c5d9b 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/data/DataTypeModelImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/data/DataTypeModelImporter.java @@ -1,14 +1,13 @@ package fr.softeam.cameldesigner.exchange.importer.data; -import camel.data.DataTypeModel; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.data.DataTypeModel; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import fr.softeam.cameldesigner.exchange.importer.core.SubModelImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("6829a6c7-60a4-432d-b2ff-a33b5ce4375c") -public class DataTypeModelImporter extends SubModelImporter { +public class DataTypeModelImporter extends DataModelImporter { @objid ("3563043e-6606-4efe-80e5-1c55027df30f") public DataTypeModelImporter() { super(); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ClusterConfigurationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ClusterConfigurationImporter.java index 364274b1..9cd98a52 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ClusterConfigurationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ClusterConfigurationImporter.java @@ -1,17 +1,16 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.ClusterConfiguration; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ClusterConfiguration; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("bf2fffa3-9a4c-46a0-afbc-dfa294627756") public class ClusterConfigurationImporter extends ConfigurationImporter { @objid ("88e77335-560d-42ba-9bce-5972226a8e39") public ClusterConfigurationImporter() { super(); - // TODO Auto-generated constructor stub } @objid ("d77394cb-95ae-4f6f-ba26-5c4f97587e36") @@ -32,6 +31,7 @@ public Object accept(ICamelImporterVisitor v) { return v.visitClusterConfiguration(this); } + @Override @objid ("efde7803-3f3e-4b3c-afe6-09df39c7ffa7") public void setProperties(V elt) { super.setProperties(elt); @@ -40,7 +40,6 @@ public void setProperties(V elt) { @objid ("a20adf1d-023c-48fb-84a7-8f0eb7df82f9") private void setDownloadURL(V elt) { - // TODO Auto-generated method stub String value = this._element.getDownloadURL(); if (value != null) { elt.setDownloadURL(value); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationImporter.java index 610ce3cd..6704a043 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationImporter.java @@ -7,7 +7,10 @@ import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.deploymentmodel.standard.package_.DeploymentTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; +import fr.softeam.cameldesigner.impl.CamelDesignerModule; import org.eclipse.emf.cdo.CDOObject; +import org.modelio.api.modelio.model.IUmlModel; +import org.modelio.metamodel.uml.statik.ConnectorEnd; @objid ("bf909600-1629-4a6b-91f1-d7e2713c2226") public class CommunicationImporter extends ComponentRelationImporter { @@ -42,32 +45,41 @@ public Object accept(ICamelImporterVisitor v) { @Override public void setProperties(V elt) { super.setProperties(elt); - setProvidedCommunication(elt); - setRequiredCommunication(elt); + setProvidedRequiredCommunication(elt); } @objid ("a4449a43-6981-444a-87da-77fb63b55ebe") - private void setProvidedCommunication(V elt) { - // TODO Auto-generated method stub - ProvidedCommunication value = this._element.getProvidedCommunication(); - if (value != null) { - CamelElement valueElt = this._process.getElement(value); - if (valueElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort) { - elt.setProvidedCommunication((fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort) valueElt); + private void setProvidedRequiredCommunication(V elt) { + ProvidedCommunication source = this._element.getProvidedCommunication(); + RequiredCommunication target = this._element.getRequiredCommunication(); - } - } - } - - @objid ("2af66457-a9df-4716-b622-6776a9fc5c4e") - private void setRequiredCommunication(V elt) { - // TODO Auto-generated method stub - RequiredCommunication value = this._element.getRequiredCommunication(); - if (value != null) { - CamelElement valueElt = this._process.getElement(value); - if (valueElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort) { - elt.setRequiredCommunication((fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort) valueElt); + if ((source != null) && (target != null)) { + + CamelElement sourceElt = this._process.getElement(source); + CamelElement targetElt = this._process.getElement(target); + + if ((sourceElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort) + && (targetElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort)){ + + + fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort sourcePort = (fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort) sourceElt; + fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort targetPort = (fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort) targetElt; + + + IUmlModel model = CamelDesignerModule.getInstance().getModuleContext().getModelingSession().getModel(); + ConnectorEnd sourceEnd = (ConnectorEnd) model.createElement("Standard.ConnectorEnd"); + ConnectorEnd targetEnd = (ConnectorEnd) model.createElement("Standard.ConnectorEnd"); + + + sourceEnd.setSource(sourcePort.getElement()); + sourceEnd.setTarget(targetPort.getElement()); + sourceEnd.setOppositeOwner(targetEnd); + sourceEnd.setOpposite(targetEnd); + sourceEnd.setLink(elt.getElement()); + targetEnd.setLink(elt.getElement()); + targetEnd.setOppositeOwner(sourceEnd); + targetEnd.setOpposite(sourceEnd); } } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationPortImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationPortImporter.java index 700de851..52d8523b 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationPortImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CommunicationPortImporter.java @@ -1,20 +1,14 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.CommunicationPort; -import camel.requirement.ImageRequirement; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.CommunicationPort; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.CamelComponent; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.Communication; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.Hosting; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import fr.softeam.cameldesigner.exchange.importer.core.NamedElementImporter; -import org.eclipse.emf.cdo.CDOObject; -import org.modelio.metamodel.uml.statik.PortOrientation; +import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; @objid ("1e999137-4eb2-4263-b173-49bab0707b6c") -public class CommunicationPortImporter extends NamedElementImporter { +public class CommunicationPortImporter extends FeatureImporter { @objid ("7f88d252-b84d-4209-bba7-7dc741b67ee7") public CommunicationPortImporter() { super(); @@ -43,7 +37,6 @@ public void setProperties(V elt) { @objid ("63b2bf6b-62a9-44ad-8a0b-97ded19e4268") private void setHighPortNumber(V elt) { - // TODO Auto-generated method stub Integer value = this._element.getHighPortNumber(); if (value != null) { elt.setHighPortNumber(String.valueOf(value)); @@ -52,7 +45,6 @@ private void setHighPortNumber(V elt) { @objid ("3ab1e897-758e-4e9b-bffc-cc283b60f021") private void setLowPortNumber(V elt) { - // TODO Auto-generated method stub Integer value = this._element.getLowPortNumber(); if (value != null) { elt.setLowPortNumber(String.valueOf(value)); @@ -61,11 +53,16 @@ private void setLowPortNumber(V elt) { @objid ("665b36dc-4d9a-4e3f-98a3-b0c67504f0e2") private void setPortNumber(V elt) { - // TODO Auto-generated method stub Integer value = this._element.getPortNumber(); if (value != null) { - this._element.setPortNumber(value);; + this._element.setPortNumber(value); } } + @objid ("7278f294-fa86-4d92-b7e2-6f3b01c3a342") + @Override + public void attach(V elt, CamelElement context) { + + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CamelComponentImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ComponentImporter.java similarity index 57% rename from src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CamelComponentImporter.java rename to src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ComponentImporter.java index 8b3a6156..f787cce0 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/CamelComponentImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ComponentImporter.java @@ -1,18 +1,18 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.Component; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import camel.deployment.Component; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; @objid ("99e007b7-d2fa-4062-9bfb-31e88f61077c") -public class CamelComponentImporter extends FeatureImporter { +public class ComponentImporter extends FeatureImporter { @objid ("2ae2a5a1-1549-4451-9403-dcd1edad55d2") - public CamelComponentImporter() { - // TODO Auto-generated constructor stub + public ComponentImporter() { + } @objid ("afab7f36-55f1-43b6-b7d9-dd7bc90b40a6") - public CamelComponentImporter(T elt) { + public ComponentImporter(T elt) { super(elt); } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ConfigurationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ConfigurationImporter.java index 81e75c14..45c03ec2 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ConfigurationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ConfigurationImporter.java @@ -1,16 +1,14 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.Configuration; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.Configuration; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.Container; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.VM; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.CamelComponent; import fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.Communication; import fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.Hosting; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("ef4365a9-7a0a-4b43-845b-f8622ad25cbb") public class ConfigurationImporter extends FeatureImporter { @@ -31,4 +29,25 @@ public Object accept(ICamelImporterVisitor v) { return v.visitConfiguration(this); } + @objid ("89621bbe-b803-4d7c-ac9d-e50838d11942") + @Override + public void attach(V elt, CamelElement context) { + if (context instanceof Communication) { + ((Communication)context).setProvidedPortConfiguration(elt); + ((Communication)context).setRequiredPortConfiguration(elt); + } + + if (context instanceof Hosting) { + ((Hosting)context).setProvidedHostConfiguration(elt); + ((Hosting)context).setProvidedHostConfiguration(elt); + } + + if (context instanceof CamelComponent) { + ((CamelComponent)context).addConfigurations(elt); + } + + else + super.attach(elt, context); + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ContainerImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ContainerImporter.java index d11c85e0..9cfe3380 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ContainerImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ContainerImporter.java @@ -8,7 +8,7 @@ import org.eclipse.emf.cdo.CDOObject; @objid ("22031973-9f19-44dc-9d55-cbe2cc996a06") -public class ContainerImporter extends CamelComponentImporter { +public class ContainerImporter extends ComponentImporter { @objid ("63d3c9c6-b68b-446e-81ad-03a32d12662e") public ContainerImporter() { super(); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/DeploymentTypeModelImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/DeploymentTypeModelImporter.java index dce544e2..2359361f 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/DeploymentTypeModelImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/DeploymentTypeModelImporter.java @@ -1,11 +1,10 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.DeploymentTypeModel; -import camel.deployment.RequirementSet; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.DeploymentTypeModel; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("8e8f482f-c03f-4554-81df-09a2d5390037") public class DeploymentTypeModelImporter extends DeploymentModelImporter { @@ -35,7 +34,6 @@ public void setProperties(V elt) { @objid ("3ec97307-e2e6-42ef-ae05-e535359c72cc") private void setGlobalRequirementSet(V elt) { - // TODO Auto-generated method stub fr.softeam.cameldesigner.api.deploymentmodel.standard.class_.RequirementSet value = (fr.softeam.cameldesigner.api.deploymentmodel.standard.class_.RequirementSet) this._element.getGlobalRequirementSet(); if (value != null) { elt.setGlobalRequirementSet(value); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/HostingImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/HostingImporter.java index 908b2dab..03965b12 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/HostingImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/HostingImporter.java @@ -1,16 +1,16 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import org.modelio.api.modelio.model.IUmlModel; +import org.modelio.metamodel.uml.statik.ConnectorEnd; import camel.deployment.Hosting; import camel.deployment.ProvidedHost; import camel.deployment.RequiredHost; -import camel.deployment.SoftwareComponent; -import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.deploymentmodel.standard.package_.DeploymentTypeModel; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; -import org.eclipse.emf.common.util.EList; +import fr.softeam.cameldesigner.impl.CamelDesignerModule; @objid ("a5c688fd-bca0-4912-840f-27cd30663e90") public class HostingImporter extends ComponentRelationImporter { @@ -45,35 +45,40 @@ public Object accept(ICamelImporterVisitor v) { @Override public void setProperties(V elt) { super.setProperties(elt); - setProvidedHost(elt); - setRequiredHosts(elt); + setProvidedRequiredHost(elt); } - @objid ("8765c4e6-f9e6-43f0-a9ca-b1a0a3e7f0d7") - private void setProvidedHost(V elt) { - // TODO Auto-generated method stub - ProvidedHost value = this._element.getProvidedHost(); - if (value != null) { - CamelElement valueElt = this._process.getElement(value); - if (valueElt instanceof HostingPort) { - elt.setProvidedHost((HostingPort) valueElt); - - } - } - } + @objid ("afa18471-ea5a-4fc8-a77d-e45af326cd01") + private void setProvidedRequiredHost(V elt) { + ProvidedHost source = this._element.getProvidedHost(); + RequiredHost target = this._element.getRequiredHosts().get(0); - @objid ("28a60ce3-74b5-4233-bbd8-c397e8577e0b") - private void setRequiredHosts(V elt) { - // TODO Auto-generated method stub - EList value = this._element.getRequiredHosts(); - if (value != null) { - for(RequiredHost obj : value) { - CamelElement valueElt = this._process.getElement(obj); - if (valueElt instanceof HostingPort) { - elt.setRequiredHosts((HostingPort) valueElt); - } - } + if ((source != null) && (target != null)) { + + CamelElement sourceElt = this._process.getElement(source); + CamelElement targetElt = this._process.getElement(target); + + if ((sourceElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort) + && (targetElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort)){ + + fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort sourcePort = (fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort) sourceElt; + fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort targetPort = (fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort) targetElt; + + IUmlModel model = CamelDesignerModule.getInstance().getModuleContext().getModelingSession().getModel(); + ConnectorEnd sourceEnd = (ConnectorEnd) model.createElement("Standard.ConnectorEnd"); + ConnectorEnd targetEnd = (ConnectorEnd) model.createElement("Standard.ConnectorEnd"); + + sourceEnd.setSource(sourcePort.getElement()); + sourceEnd.setTarget(targetPort.getElement()); + sourceEnd.setOppositeOwner(targetEnd); + sourceEnd.setOpposite(targetEnd); + sourceEnd.setLink(elt.getElement()); + + targetEnd.setLink(elt.getElement()); + targetEnd.setOppositeOwner(sourceEnd); + targetEnd.setOpposite(sourceEnd); } + } } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/LocationCouplingImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/LocationCouplingImporter.java index 7f86f71e..e4c0b8f6 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/LocationCouplingImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/LocationCouplingImporter.java @@ -1,21 +1,20 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.common.util.EList; import camel.deployment.LocationCoupling; import camel.deployment.LocationCouplingType; import camel.deployment.SoftwareComponent; -import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.deploymentmodel.standard.package_.DeploymentTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; -import org.eclipse.emf.common.util.EList; @objid ("d8d8c87e-09f4-4575-bfda-f92f94ba9a57") public class LocationCouplingImporter extends ComponentRelationImporter { @objid ("1026e1b0-57ae-4cd3-9abb-49254c04c9dc") public LocationCouplingImporter() { super(); - // TODO Auto-generated constructor stub } @objid ("056b63c0-b586-4770-8a3f-925b13ca1177") @@ -50,16 +49,14 @@ public void setProperties(V elt) { @objid ("5f2c7ab8-dbb7-41c8-a752-2cc2f10d2013") private void setCouplingType(V elt) { - // TODO Auto-generated method stub LocationCouplingType value = this._element.getCouplingType(); if (value != null) { - elt.setCouplingType(value.getName());; + elt.setCouplingType(value.getLiteral());; } } @objid ("31558264-6d27-4990-b4ae-42845f584909") private void setRelaxed(V elt) { - // TODO Auto-generated method stub Boolean value = this._element.isRelaxed(); if (value != null) { elt.setRelaxed(value); @@ -68,19 +65,18 @@ private void setRelaxed(V elt) { @objid ("f5ed8b3a-0c5e-490e-b199-9dd84381925c") private void setSoftwareComponent(V elt) { - // TODO Auto-generated method stub EList sof = this._element.getSoftwareComponents(); + if (sof != null) { for(SoftwareComponent obj : sof) { - if (obj != null) { - CamelElement valueElt = this._process.getElement(obj); - if (valueElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent) { - elt.addSoftwareComponents((fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent) valueElt); - - } - } - } + if (obj != null) { + CamelElement valueElt = this._process.getElement(obj); + if (valueElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent) { + elt.addSoftwareComponents((fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent) valueElt); + } + } } + } } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSConfigurationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSConfigurationImporter.java index 877acdc6..abe5274d 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSConfigurationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSConfigurationImporter.java @@ -1,18 +1,16 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.LocationCouplingType; -import camel.deployment.PaaSConfiguration; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.PaaSConfiguration; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("32cb9057-4659-4987-b9f2-0fea2b969f72") public class PaaSConfigurationImporter extends ConfigurationImporter { @objid ("ccc4904a-a24a-4824-9708-0a5432a96552") public PaaSConfigurationImporter() { super(); - // TODO Auto-generated constructor stub } @objid ("3a00d27e-fc71-497b-aad9-92c3404d0b56") @@ -54,7 +52,6 @@ private void setApi(V elt) { @objid ("21ebc450-57c1-46b1-a352-d5d80e7ed5ca") private void setVersion(V elt) { - // TODO Auto-generated method stub String value = this._element.getApi(); if (value != null) { elt.setVersion(value);; @@ -63,7 +60,6 @@ private void setVersion(V elt) { @objid ("f852bb6d-42a2-4e99-b143-228c985b7e45") private void setEndpoint(V elt) { - // TODO Auto-generated method stub String value = this._element.getEndpoint(); if (value != null) { elt.setEndpoint(value);; @@ -72,7 +68,6 @@ private void setEndpoint(V elt) { @objid ("bb5ce1e1-427e-47db-9db0-1acd412a655b") private void setDownloadURL(V elt) { - // TODO Auto-generated method stub String value = this._element.getDownloadURL(); if (value != null) { elt.setDownloadURL(value);; diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSImporter.java index 8a4f78c5..e379c2f7 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/PaaSImporter.java @@ -8,7 +8,7 @@ import org.eclipse.emf.cdo.CDOObject; @objid ("9fe4fd87-f3ec-43ea-90d6-48e5def5ea68") -public class PaaSImporter extends CamelComponentImporter { +public class PaaSImporter extends ComponentImporter { @objid ("d0ecc2b5-88b3-4280-a1b4-8dbcc9d87371") public PaaSImporter() { super(); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedCommunicationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedCommunicationImporter.java index 26bc6823..69ed3b35 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedCommunicationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedCommunicationImporter.java @@ -1,19 +1,17 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.CommunicationPort; -import camel.deployment.ProvidedCommunication; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ProvidedCommunication; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("0ecf37a1-897f-4fa1-87bc-3668dba17a5b") public class ProvidedCommunicationImporter extends CommunicationPortImporter { @objid ("c5ae3de5-0e68-4222-a5c1-973e47bc0685") public ProvidedCommunicationImporter() { super(); - // TODO Auto-generated constructor stub } @objid ("300e1d09-6e64-4b05-aa1e-7a502aa1782e") @@ -37,4 +35,19 @@ public Object accept(ICamelImporterVisitor v) { return v.visitProvidedCommunication(this); } + @objid ("0156adae-c8f3-49e8-8d88-580cb615a881") + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setPortNumber(elt); + } + + @objid ("0721a858-efc0-46d4-9507-9a6e82e06ab8") + private void setPortNumber(V elt) { + Integer value = this._element.getPortNumber(); + if (value != null) { + this._element.setPortNumber(value);; + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedHostImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedHostImporter.java index 9c36dd71..aab0a6f1 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedHostImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ProvidedHostImporter.java @@ -1,21 +1,19 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.ProvidedHost; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ProvidedHost; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.CamelComponent; import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.Container; import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent; import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.VM; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("5221827d-0a23-49e8-bb2e-da41b27f0d60") public class ProvidedHostImporter extends HostingPortImporter { @objid ("ea6e0950-5642-4979-83ae-3ac1521a5727") public ProvidedHostImporter() { super(); - // TODO Auto-generated constructor stub } @objid ("bad5a679-9ffe-415c-9e1b-5533c84dd559") diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredCommunicationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredCommunicationImporter.java index 26307004..2a213d78 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredCommunicationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredCommunicationImporter.java @@ -1,13 +1,12 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.CommunicationPort; -import camel.deployment.RequiredCommunication; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.RequiredCommunication; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.Container; import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("1fd17f2f-c4f5-4ed4-89dc-7aeff282a5d5") public class RequiredCommunicationImporter extends CommunicationPortImporter { @@ -29,8 +28,6 @@ public void attach(V elt, CamelElement context) { ((SoftwareComponent)context).addRequiredCommunications(elt); else if (context instanceof Container) ((Container)context).addRequiredCommunications(elt); - else - super.attach(elt, context); } @objid ("7526840e-4132-4de7-aae1-d767985076b9") @@ -44,16 +41,24 @@ public Object accept(ICamelImporterVisitor v) { public void setProperties(V elt) { super.setProperties(elt); setIsMandatory(elt); + setPortNumber(elt); } @objid ("d51ff8cb-e908-427c-bff9-96cb58c9b534") private void setIsMandatory(V elt) { - // TODO Auto-generated method stub - + Boolean value = ( this._element).isIsMandatory(); if (value != null) { elt.setIsMandatory(value); } } + @objid ("3a4ba6b9-b5d3-467e-adec-2e9047ff3bd2") + private void setPortNumber(V elt) { + Integer value = this._element.getPortNumber(); + if (value != null) { + this._element.setPortNumber(value); + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredHostImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredHostImporter.java index c0918163..56acb639 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredHostImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredHostImporter.java @@ -1,11 +1,11 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.RequiredHost; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.RequiredHost; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.deploymentmodel.standard.component.SoftwareComponent; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("8a2ae908-8870-4d42-980a-f7c72d0912d4") public class RequiredHostImporter extends HostingPortImporter { @@ -30,6 +30,7 @@ public void attach(V elt, CamelElement context) { } } + @Override @objid ("00cdcef7-1bf3-4b86-968f-1153639136f3") public Object accept(ICamelImporterVisitor v) { return v.visitRequiredHost(this); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredSetImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequirementSetImporter.java similarity index 95% rename from src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredSetImporter.java rename to src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequirementSetImporter.java index 60fd8a7b..b9c22833 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequiredSetImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/RequirementSetImporter.java @@ -1,5 +1,7 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; import camel.deployment.RequirementSet; import camel.requirement.HorizontalScaleRequirement; import camel.requirement.ImageRequirement; @@ -10,17 +12,15 @@ import camel.requirement.ResourceRequirement; import camel.requirement.SecurityRequirement; import camel.requirement.VerticalScaleRequirement; -import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.deploymentmodel.standard.package_.DeploymentTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("8f79c839-8ac1-4479-9e73-483578667521") -public class RequiredSetImporter extends FeatureImporter { +public class RequirementSetImporter extends FeatureImporter { @objid ("5aaa7a6f-6a65-499f-a208-f9111944bed8") - public RequiredSetImporter() { + public RequirementSetImporter() { super(); } @@ -33,7 +33,6 @@ public CamelElement createCamelElt(CDOObject owner) { @objid ("aade0e96-0d6d-4654-a0c8-242f5480a170") @Override public void attach(V elt, CamelElement context) { - super.attach(elt, context); if (context instanceof DeploymentTypeModel) ((DeploymentTypeModel)context).addRequirementSets(elt); } @@ -41,7 +40,7 @@ public void attach(V elt, CamelElement context) { @objid ("2ca44fc1-6974-4cf0-ac14-a5c8f210b3df") @Override public Object accept(ICamelImporterVisitor v) { - return v.visitRequiredSet(this); + return v.visitRequirementSet(this); } @objid ("2a7ff508-1cc7-447f-bd59-4c94b382a34d") @@ -67,7 +66,7 @@ private void setImageRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.enumeration.ImageRequirement) { elt.setImageRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.enumeration.ImageRequirement) valueElt); - + } } } @@ -80,7 +79,7 @@ private void setLocationRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.LocationRequirement) { elt.setLocationRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.LocationRequirement) valueElt); - + } } } @@ -93,7 +92,7 @@ private void setHorizontalScaleRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.HorizontalScaleRequirement) { elt.setHorizontalScaleRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.HorizontalScaleRequirement) valueElt); - + } } } @@ -106,7 +105,7 @@ private void setSecurityRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.SecurityRequirement) { elt.setSecurityRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.SecurityRequirement) valueElt); - + } } } @@ -119,7 +118,7 @@ private void setOsRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.OSRequirement) { elt.setOsRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.OSRequirement) valueElt); - + } } } @@ -132,7 +131,7 @@ private void setVerticalScaleRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.VerticalScaleRequirement) { elt.setVerticalScaleRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.VerticalScaleRequirement) valueElt); - + } } } @@ -145,7 +144,7 @@ private void setProviderRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ProviderRequirement) { elt.setProviderRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ProviderRequirement) valueElt); - + } } } @@ -158,7 +157,7 @@ private void setPaaSRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.PaaSRequirement) { elt.setPaasRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.PaaSRequirement) valueElt); - + } } } @@ -171,7 +170,7 @@ private void setResourceRequirement(V elt) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ResourceRequirement) { elt.setResourceRequirement((fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ResourceRequirement) valueElt); - + } } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ScriptConfiguationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ScriptConfiguationImporter.java index f0c7b6ba..c0964d60 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ScriptConfiguationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ScriptConfiguationImporter.java @@ -1,19 +1,16 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.ProvidedHost; -import camel.deployment.ScriptConfiguration; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ScriptConfiguration; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("4e6223f5-7a07-4578-96d0-376f84f4037d") public class ScriptConfiguationImporter extends ConfigurationImporter { @objid ("2e0aa8ee-a4b9-44f0-9618-90610942a905") public ScriptConfiguationImporter() { super(); - // TODO Auto-generated constructor stub } @objid ("e87736bf-5ad7-40c3-a62e-5df9e33166c4") @@ -47,7 +44,6 @@ public void setProperties(V elt) { @objid ("a7b3871a-80d3-4fd2-9835-53b64a47a302") private void setUpdateCommandNote(V elt) { - // TODO Auto-generated method stub String value = this._element.getUpdateCommand(); if (value != null) { elt.setUpdateCommandNote(value); @@ -56,7 +52,6 @@ private void setUpdateCommandNote(V elt) { @objid ("0babcce4-82ef-48b5-a6ce-84409fe7b884") private void setInstallCommandNote(V elt) { - // TODO Auto-generated method stub String value = this._element.getInstallCommand(); if (value != null) { elt.setInstallCommandNote(value); @@ -65,7 +60,6 @@ private void setInstallCommandNote(V elt) { @objid ("45c3e949-c0e3-4f84-93e7-d6bfe0b8997e") private void setStartCommandNote(V elt) { - // TODO Auto-generated method stub String value = this._element.getStartCommand(); if (value != null) { elt.setStartCommandNote(value); @@ -74,7 +68,6 @@ private void setStartCommandNote(V elt) { @objid ("51b8f225-454d-4b67-be10-7f70fea89856") private void setStopCommandNote(V elt) { - // TODO Auto-generated method stub String value = this._element.getStopCommand(); if (value != null) { elt.setStopCommandNote(value); @@ -83,7 +76,6 @@ private void setStopCommandNote(V elt) { @objid ("d9e5c73b-3c52-441c-9242-e31bbda38f5c") private void setDownloadCommandNote(V elt) { - // TODO Auto-generated method stub String value = this._element.getDownloadCommand(); if (value != null) { elt.setDownloadCommandNote(value); @@ -92,7 +84,6 @@ private void setDownloadCommandNote(V elt) { @objid ("aa1ce7db-baa2-43e4-81b6-ef5bcf31bed5") private void setConfigureCommandNote(V elt) { - // TODO Auto-generated method stub String value = this._element.getConfigureCommand(); if (value != null) { elt.setConfigureCommandNote(value); @@ -101,7 +92,6 @@ private void setConfigureCommandNote(V elt) { @objid ("ce72ec73-db36-412c-bdb2-36c9a68949b7") private void setUploadCommandNote(V elt) { - // TODO Auto-generated method stub String value = this._element.getUploadCommand(); if (value != null) { elt.setUploadCommandNote(value); @@ -110,7 +100,6 @@ private void setUploadCommandNote(V elt) { @objid ("09ddede5-78fd-47aa-9bee-eff582e6d29e") private void setDevopsTool(V elt) { - // TODO Auto-generated method stub String value = this._element.getDevopsTool(); if (value != null) { elt.setDevopsTool(value); @@ -119,7 +108,6 @@ private void setDevopsTool(V elt) { @objid ("24820758-890b-45ba-9410-757cda7b749b") private void setOs(V elt) { - // TODO Auto-generated method stub String value = this._element.getOs(); if (value != null) { elt.setOs(value); @@ -128,7 +116,6 @@ private void setOs(V elt) { @objid ("ae658727-82ef-4cc5-9729-3966aae913cc") private void setImageId(V elt) { - // TODO Auto-generated method stub String value = this._element.getImageId(); if (value != null) { elt.setImageId(value); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ServerlessConfigurationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ServerlessConfigurationImporter.java index 9a9cd5d8..4d14321e 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ServerlessConfigurationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/ServerlessConfigurationImporter.java @@ -1,17 +1,16 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.ServerlessConfiguration; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ServerlessConfiguration; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("7786395d-0312-4b68-8bc9-4b96e908377e") public class ServerlessConfigurationImporter extends ConfigurationImporter { @objid ("986c8210-3fe8-48c5-82d4-2700c70d5b9e") public ServerlessConfigurationImporter() { super(); - // TODO Auto-generated constructor stub } @objid ("174e212a-5a47-4f0b-9c9a-2392501010f6") @@ -36,19 +35,17 @@ public void setProperties(V elt) { @objid ("a6f899a0-d63a-42ef-a9af-9ba113f14b13") private void setBinaryCodeURL(V elt) { - // TODO Auto-generated method stub String value = this._element.getBinaryCodeURL(); if (value != null) { - elt.setBinaryCodeURL(value);; + elt.setBinaryCodeURL(value); } } @objid ("960aa9d4-b5cc-4008-926f-440a2cfe828e") private void setContinuousDeployment(V elt) { - // TODO Auto-generated method stub Boolean value = this._element.isContinuousDeployment(); if (value != null) { - elt.setContinuousDeployment(value);; + elt.setContinuousDeployment(value); } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/SoftwareComponentImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/SoftwareComponentImporter.java index 95beef12..822432a9 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/SoftwareComponentImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/SoftwareComponentImporter.java @@ -1,15 +1,14 @@ package fr.softeam.cameldesigner.exchange.importer.deployment; -import camel.deployment.SoftwareComponent; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.SoftwareComponent; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.api.deploymentmodel.standard.class_.RequirementSet; import fr.softeam.cameldesigner.api.deploymentmodel.standard.package_.DeploymentTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("1f54af6e-e4b6-40f7-9e3d-f18ac70811eb") -public class SoftwareComponentImporter extends CamelComponentImporter { +public class SoftwareComponentImporter extends ComponentImporter { @objid ("6eaceb6b-0a75-4ef0-84d8-1e6bd3fdfa49") public SoftwareComponentImporter() { super(); @@ -50,7 +49,6 @@ public void setProperties(V elt) { @objid ("0f29c5d2-cf7b-43eb-9d90-69eee8e91d6f") private void setCoInstanceHosting(V elt) { - // TODO Auto-generated method stub Boolean value = this._element.isCoInstanceHosting(); if (value != null) { elt.setCoInstanceHosting(value); @@ -59,8 +57,6 @@ private void setCoInstanceHosting(V elt) { @objid ("415b86e2-ce11-4be5-a85c-68f4224c7b7e") private void setLongLived(V elt) { - // TODO Auto-generated method stub - Boolean value = this._element.isLongLived(); if (value != null) { elt.setLongLived(value); @@ -69,13 +65,12 @@ private void setLongLived(V elt) { @objid ("be2a1ea4-e6b4-4041-8928-c775184e5bdf") private void setRequirementSet(V elt) { - // TODO Auto-generated method stub camel.deployment.RequirementSet value = this._element.getRequirementSet(); if (value != null) { CamelElement valueElt = this._process.getElement(value); if (valueElt instanceof fr.softeam.cameldesigner.api.deploymentmodel.standard.class_.RequirementSet) { elt.setRequirementSet((fr.softeam.cameldesigner.api.deploymentmodel.standard.class_.RequirementSet) valueElt); - + } } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/VMImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/VMImporter.java index 341a0b46..31cc4183 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/VMImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deployment/VMImporter.java @@ -8,7 +8,7 @@ import org.eclipse.emf.cdo.CDOObject; @objid ("4c2b911d-7884-4d70-bf7e-0a7d73790134") -public class VMImporter extends CamelComponentImporter { +public class VMImporter extends ComponentImporter { @objid ("0cba22f3-532b-4bfb-92c6-518fb809f69a") public VMImporter() { super(); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationInstanceImporter.java new file mode 100644 index 00000000..e0826019 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationInstanceImporter.java @@ -0,0 +1,27 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.CommunicationInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class CommunicationInstanceImporter extends ComponentRelationInstanceImporter { + + public CommunicationInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.connector.CommunicationInstance.create(); + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitCommunicationInstance(this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationPortInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationPortInstanceImporter.java new file mode 100644 index 00000000..2ad2031d --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/CommunicationPortInstanceImporter.java @@ -0,0 +1,41 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.CommunicationPortInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; +import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; + + +public class CommunicationPortInstanceImporter extends FeatureImporter { + + public CommunicationPortInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort.create(); + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitCommunicationPortInstance(this); + } + + + @Override + public void setProperties(V elt) { + super.setProperties(elt); + } + + + + @Override + public void attach(V elt, CamelElement context) { + + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentInstanceImporter.java new file mode 100644 index 00000000..c990e868 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentInstanceImporter.java @@ -0,0 +1,17 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import camel.deployment.ComponentInstance; +import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; + + +public class ComponentInstanceImporter extends FeatureImporter { + + public ComponentInstanceImporter() { + + } + + public ComponentInstanceImporter(T elt) { + super(elt); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentRelationInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentRelationInstanceImporter.java new file mode 100644 index 00000000..a04d3bf1 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ComponentRelationInstanceImporter.java @@ -0,0 +1,28 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ComponentRelationInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; +import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; + + +public class ComponentRelationInstanceImporter extends FeatureImporter { + + public ComponentRelationInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.connector.ComponentRelationInstance.create(); + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitComponentRelationInstance(this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ContainerInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ContainerInstanceImporter.java new file mode 100644 index 00000000..40cc7ea8 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ContainerInstanceImporter.java @@ -0,0 +1,32 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ContainerInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class ContainerInstanceImporter extends ComponentInstanceImporter { + + public ContainerInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.instance.ContainerInstance.create(); + } + + + @Override + public void attach(V elt, CamelElement context) { + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitContainerInstance(this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/DeploymentInstanceModelImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/DeploymentInstanceModelImporter.java new file mode 100644 index 00000000..25b4f3a9 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/DeploymentInstanceModelImporter.java @@ -0,0 +1,33 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.DeploymentInstanceModel; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; +import fr.softeam.cameldesigner.exchange.importer.deployment.DeploymentModelImporter; + + +public class DeploymentInstanceModelImporter extends DeploymentModelImporter { + + public DeploymentInstanceModelImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel.create(); + } + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitDeploymentInstanceModel(this); + } + + + @Override + public void setProperties(V elt) { + super.setProperties(elt); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingInstanceImporter.java new file mode 100644 index 00000000..b526c0b6 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingInstanceImporter.java @@ -0,0 +1,39 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.HostingInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class HostingInstanceImporter extends ComponentRelationInstanceImporter { + + public HostingInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentmodel.standard.connector.Hosting.create(); + } + + @Override + public void attach(V elt, CamelElement context) { + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitHostingInstance(this); + } + + + @Override + public void setProperties(V elt) { + super.setProperties(elt); + } + + + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingPortInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingPortInstanceImporter.java new file mode 100644 index 00000000..6eb7924b --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/HostingPortInstanceImporter.java @@ -0,0 +1,28 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.HostingPortInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; +import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; + + +public class HostingPortInstanceImporter extends FeatureImporter { + + public HostingPortInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.port.HostingPortInstance.create(); + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitHostingPortInstance(this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/PaaSInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/PaaSInstanceImporter.java new file mode 100644 index 00000000..1399a959 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/PaaSInstanceImporter.java @@ -0,0 +1,32 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.PaaSInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class PaaSInstanceImporter extends ComponentInstanceImporter { + + public PaaSInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentmodel.standard.component.PaaS.create(); + } + + + @Override + public void attach(V elt, CamelElement context) { + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitPaaSInstance(this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedCommunicationInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedCommunicationInstanceImporter.java new file mode 100644 index 00000000..1bdd4247 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedCommunicationInstanceImporter.java @@ -0,0 +1,40 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ProvidedCommunicationInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class ProvidedCommunicationInstanceImporter extends CommunicationPortInstanceImporter { + + public ProvidedCommunicationInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.port.CommunicationPortInstance.create(); + } + + + @Override + public void attach(V elt, CamelElement context) { + + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitProvidedCommunicationInstance(this); + } + + + @Override + public void setProperties(V elt) { + super.setProperties(elt); + } + + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedHostInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedHostInstanceImporter.java new file mode 100644 index 00000000..96f8a18e --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/ProvidedHostInstanceImporter.java @@ -0,0 +1,32 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.ProvidedHostInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class ProvidedHostInstanceImporter extends HostingPortInstanceImporter { + + public ProvidedHostInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort.create(); + } + + + @Override + public void attach(V elt, CamelElement context) { + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitProvidedHostInstance(this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredCommunicationInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredCommunicationInstanceImporter.java new file mode 100644 index 00000000..3d35aff1 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredCommunicationInstanceImporter.java @@ -0,0 +1,38 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.RequiredCommunicationInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class RequiredCommunicationInstanceImporter extends CommunicationPortInstanceImporter { + + public RequiredCommunicationInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.port.CommunicationPortInstance.create(); + } + + + @Override + public void attach(V elt, CamelElement context) { + } + + + @Override + public Object accept(ICamelImporterVisitor v) { + return v.visitRequiredCommunicationInstance(this); + } + + + @Override + public void setProperties(V elt) { + super.setProperties(elt); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredHostInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredHostInstanceImporter.java new file mode 100644 index 00000000..1a1b4acb --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/RequiredHostInstanceImporter.java @@ -0,0 +1,31 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import org.eclipse.emf.cdo.CDOObject; +import camel.deployment.RequiredHostInstance; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; + + +public class RequiredHostInstanceImporter extends HostingPortInstanceImporter { + + public RequiredHostInstanceImporter() { + super(); + } + + + @Override + public CamelElement createCamelElt(CDOObject owner) { + return fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.port.HostingPortInstance.create(); + } + + + @Override + public void attach(V elt, CamelElement context) { + } + + + public Object accept(ICamelImporterVisitor v) { + return v.visitRequiredHostInstance(this); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/SoftwareComponentInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/SoftwareComponentInstanceImporter.java new file mode 100644 index 00000000..4e615d90 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/SoftwareComponentInstanceImporter.java @@ -0,0 +1,16 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import camel.deployment.SoftwareComponentInstance; + + +public class SoftwareComponentInstanceImporter extends ComponentInstanceImporter { + + public SoftwareComponentInstanceImporter() { + + } + + public SoftwareComponentInstanceImporter(T elt) { + super(elt); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/VMInstanceImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/VMInstanceImporter.java new file mode 100644 index 00000000..4d994819 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/deploymentinstance/VMInstanceImporter.java @@ -0,0 +1,15 @@ +package fr.softeam.cameldesigner.exchange.importer.deploymentinstance; + +import camel.deployment.VMInstance; + +public class VMInstanceImporter extends ComponentInstanceImporter { + + public VMInstanceImporter() { + + } + + public VMInstanceImporter(T elt) { + super(elt); + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/RuleTriggerImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/RuleTriggerImporter.java index 83413bd3..77c5e7c3 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/RuleTriggerImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/RuleTriggerImporter.java @@ -1,14 +1,13 @@ package fr.softeam.cameldesigner.exchange.importer.execution; -import camel.execution.RuleTrigger; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.execution.RuleTrigger; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("83254869-325b-42cc-b25d-89abb427dfa8") -public class RuleTriggerImporter extends FeatureImporter { +public class RuleTriggerImporter extends CauseImporter { @objid ("b6654625-4950-4197-bd38-8bc91444c472") public RuleTriggerImporter() { super(); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/SLOViolationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/SLOViolationImporter.java index 955e9bd4..e0b20e52 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/SLOViolationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/execution/SLOViolationImporter.java @@ -1,14 +1,13 @@ package fr.softeam.cameldesigner.exchange.importer.execution; -import camel.execution.SLOViolation; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.execution.SLOViolation; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("36da3370-7025-4299-8b01-655abf9ae8b0") -public class SLOViolationImporter extends FeatureImporter { +public class SLOViolationImporter extends CauseImporter { @objid ("7e472269-4b73-4567-885f-050ed8298dce") public SLOViolationImporter() { super(); diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/CloudLocationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/CloudLocationImporter.java index 95d89922..cf9d6d46 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/CloudLocationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/CloudLocationImporter.java @@ -1,10 +1,12 @@ package fr.softeam.cameldesigner.exchange.importer.location; -import camel.location.CloudLocation; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.location.CloudLocation; +import camel.location.GeographicalRegion; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.locationmodel.standard.package_.LocationModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("8975e2da-976b-45bb-8952-6975571441bd") public class CloudLocationImporter extends LocationImporter { @@ -22,6 +24,31 @@ public CamelElement createCamelElt(CDOObject owner) { @objid ("4c19564c-a4a1-43b2-8c5f-848c303f542f") @Override public void attach(V elt, CamelElement context) { + if (context instanceof LocationModel) + ((LocationModel)context).addCloudLocations(elt); + else if (context instanceof fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.CloudLocation) + ((fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.CloudLocation)context).addSubLocations(elt); + } + + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setIsAssignable(elt); + setGeographicalRegion(elt); + } + + private void setGeographicalRegion(V elt) { + GeographicalRegion reg = this._element.getGeographicalRegion(); + if (reg != null) { + CamelElement modelioReg = this._process.getElement(reg); + if ((modelioReg != null) && (modelioReg instanceof fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.GeographicalRegion)) { + elt.setGeographicalRegion((fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.GeographicalRegion) modelioReg); + } + } + } + + private void setIsAssignable(V elt) { + elt.setIsAssignable(this._element.isIsAssignable()); } @objid ("01303ce1-18a0-4145-869b-8bbbc9160712") diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/GeographicalRegionImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/GeographicalRegionImporter.java index 8c37fefc..c2432b64 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/GeographicalRegionImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/GeographicalRegionImporter.java @@ -1,10 +1,11 @@ package fr.softeam.cameldesigner.exchange.importer.location; -import camel.location.GeographicalRegion; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.location.GeographicalRegion; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.locationmodel.standard.package_.LocationModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("c54f1432-d418-40b0-8add-0dabc029717f") public class GeographicalRegionImporter extends LocationImporter { @@ -22,6 +23,8 @@ public CamelElement createCamelElt(CDOObject owner) { @objid ("133c1eed-422c-4547-a383-97e3b8b3eb4c") @Override public void attach(V elt, CamelElement context) { + if (context instanceof LocationModel) + ((LocationModel)context).addRegions(elt); } @objid ("202bf0a1-b9a4-4304-9ef3-c6c9ad70d7fb") @@ -30,4 +33,26 @@ public Object accept(ICamelImporterVisitor v) { return v.visitGeographicalRegion(this); } + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setParentRegions(elt); + setAlternativeNames(elt); + } + + private void setAlternativeNames(V elt) { + for (String name : this._element.getAlternativeNames()) { + elt.addAlternativeName(name); + } + } + + private void setParentRegions(V elt) { + for (GeographicalRegion region : this._element.getParentRegions()) { + CamelElement modelioRegion = this._process.getElement(region); + if ((modelioRegion != null) && (modelioRegion instanceof fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.GeographicalRegion)) { + elt.addParentRegions((fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.GeographicalRegion) modelioRegion); + } + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/LocationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/LocationImporter.java index 60a59b0b..58b71cfa 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/LocationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/location/LocationImporter.java @@ -1,11 +1,11 @@ package fr.softeam.cameldesigner.exchange.importer.location; -import camel.location.Location; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.location.Location; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("d17f1f8a-50fd-408d-8700-48345c2101ad") public class LocationImporter extends FeatureImporter { @@ -25,6 +25,19 @@ public CamelElement createCamelElt(CDOObject owner) { public void attach(V elt, CamelElement context) { } + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setId(elt); + } + + private void setId(V elt) { + String id = this._element.getId(); + if (id != null) { + elt.setId(id); + } + } + @objid ("1bbed77b-d7fd-4d75-9bfe-b0c61103aee3") @Override public Object accept(ICamelImporterVisitor v) { diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsObjectImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsObjectImporter.java index 275af9b6..71981715 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsObjectImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsObjectImporter.java @@ -39,12 +39,13 @@ public void setProperties(V elt) { @Override public void attach(V elt, CamelElement context) { if (context instanceof MetaDataModel) { - MetaDataModel owner = (MetaDataModel) context; if (elt instanceof MmsConcept) { - owner.addConcept((MmsConcept) elt); + ((MetaDataModel) context).addConcept((MmsConcept) elt); + }else if (elt instanceof MmsConceptInstance) { - owner.addConceptInstance((MmsConceptInstance)elt); + ((MetaDataModel) context).addConceptInstance((MmsConceptInstance)elt); } + } } @@ -82,6 +83,7 @@ private void setDescription(V elt) { String value = this._element.getDescription(); if (value != null) { elt.setDescription(value); + } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsPropertyImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsPropertyImporter.java index 9954eacd..8be1f208 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsPropertyImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metadata/MmsPropertyImporter.java @@ -32,7 +32,6 @@ public void setProperties(V elt) { super.setProperties(elt); setRangeUri(elt); setPropertyType(elt); - // setRange(elt); } @objid ("6b36a532-ed48-4d49-9e38-cc6518dd4687") diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricContextImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricContextImporter.java index 347e9dab..f3225cef 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricContextImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricContextImporter.java @@ -8,6 +8,7 @@ import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule; +import fr.softeam.cameldesigner.api.metricmodel.standard.package_.MetricTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; import org.eclipse.emf.cdo.CDOObject; @@ -38,7 +39,8 @@ public CamelElement createCamelElt(CDOObject owner) { @objid ("9bbc6ea0-5641-4b61-b2eb-fe402d93a129") @Override public void attach(V elt, CamelElement context) { - super.attach(elt, context); + if (context instanceof MetricTypeModel) + ((MetricTypeModel) context).addMetricContexts(elt); } @objid ("5ee5a595-5807-4e93-a616-e99dc72f1d84") diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricImporter.java index 71c366cb..d29c965a 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricImporter.java @@ -5,6 +5,7 @@ import camel.metric.MetricTemplate; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.metricmodel.standard.package_.MetricTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; import org.eclipse.emf.cdo.CDOObject; @@ -35,7 +36,8 @@ public CamelElement createCamelElt(CDOObject owner) { @objid ("0694c937-5ce5-4b3b-a036-75362bd43afb") @Override public void attach(V elt, CamelElement context) { - super.attach(elt, context); + if (context instanceof MetricTypeModel) + ((MetricTypeModel) context).addMetrics(elt); } @objid ("0110e4f7-46a2-41d0-a80d-07e9dc3f40e9") diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricTemplateImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricTemplateImporter.java index e48c9c17..04e80d33 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricTemplateImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/metric/MetricTemplateImporter.java @@ -1,16 +1,16 @@ package fr.softeam.cameldesigner.exchange.importer.metric; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; import camel.core.MeasurableAttribute; import camel.metric.MetricTemplate; import camel.type.ValueType; import camel.unit.Unit; -import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttributeClass; import fr.softeam.cameldesigner.api.metricmodel.standard.package_.MetricTypeModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; -import org.eclipse.emf.cdo.CDOObject; @objid ("91223ee2-8b6b-4c6e-86ac-099ca1c074b8") public class MetricTemplateImporter extends FeatureImporter { @@ -54,10 +54,12 @@ public void setProperties(V elt) { @objid ("36eaa60c-9b33-49f0-a8c6-81d512cc0b8b") private void setValueType(V elt) { - // TODO Auto-generated method stub + ValueType value = this._element.getValueType(); if (value != null) { - elt.setValueType((fr.softeam.cameldesigner.api.typemodel.standard.datatype.ValueType) value); + CamelElement camValue = this._process.getElement(value); + if ((camValue != null) && (camValue instanceof fr.softeam.cameldesigner.api.typemodel.standard.datatype.ValueType)) + elt.setValueType((fr.softeam.cameldesigner.api.typemodel.standard.datatype.ValueType)camValue); } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationImporter.java index 6f89873c..b4df1eb5 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationImporter.java @@ -1,12 +1,14 @@ package fr.softeam.cameldesigner.exchange.importer.organisation; import camel.organisation.Organisation; +import camel.organisation.User; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.camelcore.standard.package_.CamelModel; import fr.softeam.cameldesigner.api.organisationmodel.standard.package_.OrganisationModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.common.util.EList; @objid ("b908a8b5-9acc-43e3-a219-df78186b4474") public class OrganisationImporter extends EntityImporter { @@ -40,4 +42,40 @@ public void attach(V elt, CamelElement context) { super.attach(elt, context); } + @objid ("35988931-26ff-417d-a499-0ea1570ff207") + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setWww(elt); + setPostalAddress(elt); + setEmail(elt); + } + + @objid ("4e6015be-e8ad-4152-98ad-162826a350f9") + private void setPostalAddress(V elt) { + // TODO Auto-generated method stub + String value = this._element.getPostalAddress(); + if (value != null) { + elt.setPostalAddress(value); + } + } + + @objid ("c197a131-f1a7-45af-a10f-3cd7c8dc66f2") + private void setWww(V elt) { + // TODO Auto-generated method stub + String value = this._element.getWww(); + if (value != null) { + elt.setWww(value); + } + } + + @objid ("c0e14678-85ff-4ffc-bc8a-94a67cb1021c") + private void setEmail(V elt) { + // TODO Auto-generated method stub + String value = this._element.getEmail(); + if (value != null) { + elt.setEmail(value); + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationModelImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationModelImporter.java index 7a5e8aea..5ba2674c 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationModelImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/OrganisationModelImporter.java @@ -1,9 +1,12 @@ package fr.softeam.cameldesigner.exchange.importer.organisation; +import camel.deployment.ProvidedHost; import camel.organisation.OrganisationModel; +import camel.organisation.SecurityLevel; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.camelcore.standard.package_.CamelModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.SubModelImporter; import org.eclipse.emf.cdo.CDOObject; @@ -38,4 +41,21 @@ public CamelElement createCamelElt(CDOObject owner) { return fr.softeam.cameldesigner.api.organisationmodel.standard.package_.OrganisationModel.create(); } + @objid ("95d42943-d900-4e43-a94e-7a342d5e3e7a") + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setSecurityLevel(elt); + } + + @objid ("837d06d5-494c-4416-b9aa-3236e2fbc806") + private void setSecurityLevel(V elt) { + // TODO Auto-generated method stub + SecurityLevel value = this._element.getSecurityLevel(); + if (value != null) { + elt.setSecurityLevel( value.getLiteral()); + + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/PlatformCredentialsImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/PlatformCredentialsImporter.java index ed995838..c4851946 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/PlatformCredentialsImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/PlatformCredentialsImporter.java @@ -7,6 +7,7 @@ import fr.softeam.cameldesigner.api.organisationmodel.standard.package_.OrganisationModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.common.util.EList; @objid ("9646e977-6420-4d58-84d2-79106b83cdfe") public class PlatformCredentialsImporter extends CredentialsImporter { @@ -40,4 +41,20 @@ public void attach(V elt, CamelElement context) { super.attach(elt, context); } + @objid ("cd913f8e-ba8e-46de-ae58-9b39ae307a3c") + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setPassword(elt); + } + + @objid ("df7cb5d3-bb3b-485f-b336-602de6a1d398") + private void setPassword(V elt) { + // TODO Auto-generated method stub + String value = this._element.getPassword(); + if (value != null) { + elt.setPassword(value); + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserGroupImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserGroupImporter.java index cbe4a438..8c73a036 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserGroupImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserGroupImporter.java @@ -1,12 +1,15 @@ package fr.softeam.cameldesigner.exchange.importer.organisation; +import camel.organisation.User; import camel.organisation.UserGroup; +import camel.requirement.RequirementModel; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.organisationmodel.standard.package_.OrganisationModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.common.util.EList; @objid ("51e5bafc-51af-4879-b59d-65109a78ab40") public class UserGroupImporter extends FeatureImporter { @@ -40,4 +43,24 @@ public void attach(V elt, CamelElement context) { super.attach(elt, context); } + @objid ("dd6fcbde-1bd7-4a7e-9b22-8089534c4b69") + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setUsers(elt); + } + + @objid ("b0b7c370-55c8-40d1-a20a-ac6c5615782b") + private void setUsers(V elt) { + // TODO Auto-generated method stub + EList value = this._element.getUsers(); + if (value != null) { + CamelElement valueElt = this._process.getElement((CDOObject) value); + if (valueElt instanceof User) { + elt.addUsers( (fr.softeam.cameldesigner.api.organisationmodel.standard.class_.User) valueElt); + + } + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserImporter.java index 3d201bf6..1f41664a 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/organisation/UserImporter.java @@ -1,11 +1,20 @@ package fr.softeam.cameldesigner.exchange.importer.organisation; +import camel.deployment.ProvidedHost; +import camel.deployment.RequiredHost; +import camel.metric.MetricModel; +import camel.organisation.SecurityLevel; import camel.organisation.User; +import camel.requirement.RequirementModel; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.package_.DeploymentModel; +import fr.softeam.cameldesigner.api.deploymentmodel.standard.port.HostingPort; import fr.softeam.cameldesigner.api.organisationmodel.standard.package_.OrganisationModel; +import fr.softeam.cameldesigner.api.scalabilitymodel.standard.package_.ScalabilityModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.common.util.EList; @objid ("6be0a4fe-4098-448a-882c-e358bbbefcdb") public class UserImporter extends EntityImporter { @@ -39,4 +48,113 @@ public void attach(V elt, CamelElement context) { super.attach(elt, context); } + @objid ("889d4d5a-bb9d-4da1-8b7c-4a5382bf581d") + @Override + public void setProperties(V elt) { + super.setProperties(elt); + setEmail(elt); + setFirstName(elt); + setLastName(elt); + setWww(elt); + setRequirementModels(elt); + setDeploymentModels(elt); + setMetricModels(elt); + setScalabilityModels(elt); + } + + @objid ("07084604-f33d-4001-b992-a8ed2cb986bc") + private void setEmail(V elt) { + // TODO Auto-generated method stub + String value = this._element.getEmail(); + if (value != null) { + elt.setEmail(value); + } + } + + @objid ("4e4744f3-0c88-4f6d-bc65-9d9ecfab10a6") + private void setFirstName(V elt) { + // TODO Auto-generated method stub + String value = this._element.getFirstName(); + if (value != null) { + elt.setFirstName(value); + } + } + + @objid ("38c43c38-6330-4f4a-9ec6-6f7945569188") + private void setLastName(V elt) { + // TODO Auto-generated method stub + String value = this._element.getLastName(); + if (value != null) { + elt.setLastName(value); + } + } + + @objid ("6d75da13-30e8-4332-9825-6bf680a58627") + private void setWww(V elt) { + // TODO Auto-generated method stub + String value = this._element.getWww(); + if (value != null) { + elt.setWww(value); + } + } + + @objid ("04919e28-46bb-4643-a276-f4dd2d70d4fc") + private void setRequirementModels(V elt) { + // TODO Auto-generated method stub + EList value = this._element.getRequirementModels(); + if (value != null) { + for(RequirementModel obj : value) { + CamelElement valueElt = this._process.getElement(obj); + if (valueElt instanceof RequirementModel) { + elt.addRequirementModels( (fr.softeam.cameldesigner.api.requirementmodel.standard.package_.RequirementModel) valueElt); + } + } + } + } + + @objid ("3bd3bb61-51d2-406d-a2f0-330bd43dd44d") + private void setDeploymentModels(V elt) { + // TODO Auto-generated method stub + EList value = this._element.getDeploymentModels(); + if (value != null) { + for(camel.deployment.DeploymentModel obj : value) { + CamelElement valueElt = this._process.getElement(obj); + if (valueElt instanceof DeploymentModel) { + elt.addDeploymentModels( (DeploymentModel) valueElt); + + } + } + } + } + + @objid ("025c572b-bb5e-4913-a784-d11e5194e7a8") + private void setMetricModels(V elt) { + // TODO Auto-generated method stub + EList value = this._element.getMetricModels(); + if (value != null) { + for(MetricModel obj : value) { + CamelElement valueElt = this._process.getElement( obj); + if (valueElt instanceof MetricModel) { + elt.addMetricModels( (fr.softeam.cameldesigner.api.metricmodel.standard.package_.MetricModel) valueElt); + + } + } + } + } + + @objid ("1fb3b1a4-fad1-4cd3-af9f-542c3e836293") + private void setScalabilityModels(V elt) { + // TODO Auto-generated method stub + EList value = this._element.getScalabilityModels(); + if (value != null) { + for(camel.scalability.ScalabilityModel obj : value) { + CamelElement valueElt = this._process.getElement((CDOObject) obj); + if (valueElt instanceof ScalabilityModel) { + elt.addScalabilityModels( (ScalabilityModel) valueElt); + + } + } + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/HardRequirementImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/HardRequirementImporter.java index f1ebc04b..2a01109f 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/HardRequirementImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/HardRequirementImporter.java @@ -8,7 +8,7 @@ import org.eclipse.emf.cdo.CDOObject; @objid ("d4809bac-6c0f-42e4-ab2d-7eabc1aa69b2") -public class HardRequirementImporter extends RequirementImporter { +public abstract class HardRequirementImporter extends RequirementImporter { @objid ("3e665e4e-ffda-424e-86dc-b8230bf38906") public HardRequirementImporter() { } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ImageRequirementImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ImageRequirementImporter.java index 0d53b47e..ecc14329 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ImageRequirementImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ImageRequirementImporter.java @@ -4,6 +4,8 @@ import camel.requirement.ImageRequirement; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.requirementmodel.standard.generalclass.Requirement; +import fr.softeam.cameldesigner.api.requirementmodel.standard.package_.RequirementModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.common.util.EList; @@ -47,4 +49,12 @@ private void setImages(V elt) { } } + @objid ("5fbb9577-9e13-4f73-b7f2-79e4591a7b0d") + @Override + public void attach(V elt, CamelElement context) { + if (context instanceof RequirementModel) { + ((RequirementModel)context).addRequirements(elt); + } + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/RequirementImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/RequirementImporter.java index 7a7e2ed0..110783d6 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/RequirementImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/RequirementImporter.java @@ -3,6 +3,8 @@ import camel.requirement.Requirement; import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.api.camelcore.standard.classifier.FeatureClassifier; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ResourceRequirement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import fr.softeam.cameldesigner.exchange.importer.core.FeatureImporter; import org.eclipse.emf.cdo.CDOObject; @@ -30,4 +32,10 @@ public CamelElement createCamelElt(CDOObject owner) { return super.createCamelElt(owner); } + @objid ("e63afe20-bd99-4733-a0ce-cf973f1c7bc1") + @Override + public void attach(V elt, CamelElement context) { + super.attach(elt, context); + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ResourceRequirementImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ResourceRequirementImporter.java index 8782219a..aeb3fd5e 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ResourceRequirementImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ResourceRequirementImporter.java @@ -35,8 +35,6 @@ public CamelElement createCamelElt(CDOObject owner) { public void attach(V elt, CamelElement context) { if (context instanceof RequirementModel) ((RequirementModel)context).addRequirements(elt); - else - super.attach(elt, context); } } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ServiceLevelObjectiveImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ServiceLevelObjectiveImporter.java index f95ba971..16618898 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ServiceLevelObjectiveImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/requirement/ServiceLevelObjectiveImporter.java @@ -6,6 +6,7 @@ import com.modeliosoft.modelio.javadesigner.annotations.objid; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.CamelConstraint; +import fr.softeam.cameldesigner.api.requirementmodel.standard.package_.RequirementModel; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; import org.eclipse.emf.cdo.CDOObject; @@ -58,4 +59,13 @@ private void setViolationEvent(V elt) { } } + @objid ("887d8458-7f68-4cfd-affa-5f83a907f3d5") + @Override + public void attach(V elt, CamelElement context) { + if (context instanceof RequirementModel) + ((RequirementModel)context).addRequirements(elt); + else + super.attach(elt, context); + } + } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/scalability/UnaryEventPatternImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/scalability/UnaryEventPatternImporter.java index 3eaf8106..b7a6b3f0 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/scalability/UnaryEventPatternImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/scalability/UnaryEventPatternImporter.java @@ -1,13 +1,13 @@ package fr.softeam.cameldesigner.exchange.importer.scalability; -import camel.scalability.UnaryEventPattern; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.scalability.UnaryEventPattern; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("0051aedc-9fe9-4c69-a81e-4bcd0e9aef4e") -public class UnaryEventPatternImporter extends EventImporter { +public class UnaryEventPatternImporter extends EventPatternImporter { @objid ("1184492c-1630-4d76-afb4-90d415c4951b") public UnaryEventPatternImporter() { } diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueImporter.java new file mode 100644 index 00000000..f1986dff --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("26c0eb62-a36c-44b2-954c-04c31b819a20") +public class BooleanValueImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueTypeImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueTypeImporter.java new file mode 100644 index 00000000..236d7d79 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/BooleanValueTypeImporter.java @@ -0,0 +1,8 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import camel.type.BooleanValueType; +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("a14729e8-39c6-4f14-9a96-d664a1ffad84") +public class BooleanValueTypeImporter extends ValueTypeImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/DoubleValueImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/DoubleValueImporter.java new file mode 100644 index 00000000..f4735113 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/DoubleValueImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("86a23cac-4293-46e8-aca7-841694a98292") +public class DoubleValueImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/FloatValueImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/FloatValueImporter.java new file mode 100644 index 00000000..ab35154f --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/FloatValueImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("0d1434a3-f5f0-45dd-bb2b-9573e13fb9c9") +public class FloatValueImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/IntValueImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/IntValueImporter.java new file mode 100644 index 00000000..5277024d --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/IntValueImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("a36e095c-608d-40a2-90b5-fb7d5d20476a") +public class IntValueImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/LimitImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/LimitImporter.java new file mode 100644 index 00000000..0ca75d6b --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/LimitImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("777e4bc7-ed5a-4e7c-8896-a4ab534c27f5") +public class LimitImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ListImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ListImporter.java new file mode 100644 index 00000000..6de56091 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ListImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("dc292ff6-4d08-4184-b641-90983cd47a1f") +public class ListImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/NumericValueImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/NumericValueImporter.java new file mode 100644 index 00000000..cbde5c80 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/NumericValueImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("31cca30c-8e59-4b63-b800-8f57109e8b4f") +public class NumericValueImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeImporter.java new file mode 100644 index 00000000..3a9f5008 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("8fea8dba-42d0-494b-a6c9-bc28c611951a") +public class RangeImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeUnionImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeUnionImporter.java new file mode 100644 index 00000000..8519eaed --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/RangeUnionImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("b0e2b089-0d9d-4d0e-b586-146c8ba0ed94") +public class RangeUnionImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueImporter.java new file mode 100644 index 00000000..a4bf5e0b --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("ba0c213d-6339-4bf9-929f-6dcad7dd1d9b") +public class StringValueImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueTypeImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueTypeImporter.java new file mode 100644 index 00000000..761e8b95 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/StringValueTypeImporter.java @@ -0,0 +1,8 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import camel.type.StringValueType; +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("fdeaabed-bf72-4370-8726-1ba78e6ef5cc") +public class StringValueTypeImporter extends ValueTypeImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/TypeModelImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/TypeModelImporter.java new file mode 100644 index 00000000..59ce3446 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/TypeModelImporter.java @@ -0,0 +1,7 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import com.modeliosoft.modelio.javadesigner.annotations.objid; + +@objid ("cce15b7e-83a1-403d-af3d-06e6648d5ffa") +public class TypeModelImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueImporter.java new file mode 100644 index 00000000..e954b8c8 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueImporter.java @@ -0,0 +1,12 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import camel.type.Value; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; +import fr.softeam.cameldesigner.exchange.importer.core.CamelElementImporter; +import org.eclipse.emf.cdo.CDOObject; + +@objid ("1a38cf8c-724b-403c-ae07-6029c1f6ab21") +public class ValueImporter { +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueTypeImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueTypeImporter.java new file mode 100644 index 00000000..5d1dcf42 --- /dev/null +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/type/ValueTypeImporter.java @@ -0,0 +1,24 @@ +package fr.softeam.cameldesigner.exchange.importer.type; + +import camel.type.ValueType; +import com.modeliosoft.modelio.javadesigner.annotations.objid; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.exchange.importer.core.NamedElementImporter; +import org.eclipse.emf.cdo.CDOObject; + +@objid ("ce6299fe-a427-4090-af9b-d08cae38c30d") +public class ValueTypeImporter extends NamedElementImporter { + @objid ("68190a48-d1f9-4990-957a-3b21eb40ec79") + @Override + public CamelElement createCamelElt(CDOObject owner) { + // TODO Auto-generated method stub + return null; + } + + @objid ("64f1dad0-5976-475d-a121-99216b536afd") + @Override + public void attach(V elt, CamelElement context) { + // TODO Auto-generated method stub + } + +} diff --git a/src/main/java/fr/softeam/cameldesigner/exchange/importer/unit/SingleUnitImporter.java b/src/main/java/fr/softeam/cameldesigner/exchange/importer/unit/SingleUnitImporter.java index b987c351..46474d7b 100644 --- a/src/main/java/fr/softeam/cameldesigner/exchange/importer/unit/SingleUnitImporter.java +++ b/src/main/java/fr/softeam/cameldesigner/exchange/importer/unit/SingleUnitImporter.java @@ -1,13 +1,13 @@ package fr.softeam.cameldesigner.exchange.importer.unit; -import camel.unit.SingleUnit; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.eclipse.emf.cdo.CDOObject; +import camel.unit.SingleUnit; import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; import fr.softeam.cameldesigner.exchange.importer.ICamelImporterVisitor; -import org.eclipse.emf.cdo.CDOObject; @objid ("6b8d2c4d-1934-43f3-b941-338280f6580b") -public class SingleUnitImporter extends UnitImporter { +public class SingleUnitImporter extends DimensionedUnitImporter { @objid ("a7d19e14-a95e-4edb-a929-ce968615069f") public SingleUnitImporter() { } diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/core/CamelElementPropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/core/CamelElementPropertyPage.java index b9808b2c..a54479ee 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/core/CamelElementPropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/core/CamelElementPropertyPage.java @@ -4,10 +4,10 @@ import java.util.Iterator; import java.util.List; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; -import fr.softeam.cameldesigner.handlers.propertypages.IPropertyContent; import org.modelio.api.module.propertiesPage.IModulePropertyTable; import org.modelio.metamodel.uml.infrastructure.ModelElement; +import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement; +import fr.softeam.cameldesigner.handlers.propertypages.IPropertyContent; @objid ("d51e7b87-847f-4c69-9032-576d613031b3") public class CamelElementPropertyPage implements IPropertyContent { @@ -21,7 +21,7 @@ public class CamelElementPropertyPage implements IProper private final String _ownerSeparator = "."; @objid ("43e9c34e-77a8-4d44-b0c8-e257d61e5c46") - private final String _eltSeparator = ";"; + protected final String _eltSeparator = "; "; @objid ("34f24e8e-bae0-4a85-bcb7-cf094ac3e86a") protected final String _add = "Add "; @@ -35,7 +35,7 @@ public class CamelElementPropertyPage implements IProper /** * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -46,7 +46,7 @@ public void changeProperty(int row, String value) { /** * This method handles the construction of the property table of a selected element - * + * * @param table : the property table to fulfill */ @objid ("ba1a4d37-3f84-42a7-a42e-adf57260b2c8") @@ -61,7 +61,7 @@ public CamelElementPropertyPage(T elt) { /** * Compute the name of the Camel Element - * + * * @param elt : the Camel Element * @return the computed name */ @@ -76,7 +76,7 @@ protected String getCamelName(CamelElement elt) { /** * Compute the name of the Model Element - * + * * @param elt : the model Element * @return the computed name */ @@ -88,7 +88,7 @@ protected String getCamelName(ModelElement elt) { /** * REturn the array of Camel name * @param elt : the list of Camel Element - * + * * @return the array of Camel name */ @objid ("af1c3c3f-3d4d-42be-b79b-40c1eb82fb07") @@ -104,7 +104,7 @@ protected String[] getCamelNames(List elts) { @objid ("7e9b0167-8353-43df-b788-b62f9fb9fef9") protected ModelElement getModelElt(List elts, String camelName) { String name = camelName.replaceFirst(this._add, "").replaceFirst(this._remove, ""); - + for (ModelElement elt : elts) { if (getCamelName(elt).equals(name)) { return elt; @@ -128,13 +128,13 @@ protected String[] getAddRemove(List allElt, List result = new ArrayList<>(); result.add(""); result.add(this._removeAll); - + //List of already added Elt List addElt = new ArrayList<>(); for (CamelElement elt : added) { addElt.add(elt.getElement()); } - + //Compute the list of Added and Removed Elements for (ModelElement elt : allElt) { if (addElt.contains(elt)) { @@ -150,21 +150,22 @@ protected String[] getAddRemove(List allElt, List elts) { String result = ""; Iterator it = elts.iterator(); - + if (it.hasNext()) { result += getCamelName(it.next()); } - + while (it.hasNext()) { result += this._eltSeparator + getCamelName(it.next()); } + return result; } @objid ("478cb49a-be51-4d1c-9a7a-a9ed4e2f37ae") protected CamelElement getCamelElt(List elts, String camelName) { String name = camelName.replaceFirst(this._add, "").replaceFirst(this._remove, ""); - + for (CamelElement elt : elts) { if (getCamelName(elt).equals(name)) { return elt; diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/CloudLocationPropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/CloudLocationPropertyPage.java index fbfeb636..f30799a6 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/CloudLocationPropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/CloudLocationPropertyPage.java @@ -2,12 +2,12 @@ import java.util.List; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule; -import fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.CloudLocation; -import fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.GeographicalRegion; import org.modelio.api.module.propertiesPage.IModulePropertyTable; import org.modelio.metamodel.uml.infrastructure.ModelElement; import org.modelio.metamodel.uml.statik.Class; +import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule; +import fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.CloudLocation; +import fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.GeographicalRegion; @objid ("6742798b-5010-4709-a1d9-929b26d0ed83") public class CloudLocationPropertyPage extends LocationPropertyPage { @@ -21,7 +21,7 @@ public class CloudLocationPropertyPage extends Location * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. * @param MObject : the selected element - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -29,19 +29,19 @@ public class CloudLocationPropertyPage extends Location @Override public void changeProperty(int row, String value) { super.changeProperty(row, value); - + if(this._currentRow == 1){ this._element.setIsAssignable(Boolean.valueOf(value)); - + } - + else if(this._currentRow == 2){ Class elt = (Class) getModelElt(this._parent, value); if (elt.isStereotyped(ICamelDesignerPeerModule.MODULE_NAME, CloudLocation.STEREOTYPE_NAME)) { this._element.setParent((CloudLocation) elt); } } - + else if(this._currentRow == 3){ ModelElement elt = getModelElt(this._geographicalRegion, value); if (elt.isStereotyped(ICamelDesignerPeerModule.MODULE_NAME, GeographicalRegion.STEREOTYPE_NAME)) { @@ -54,21 +54,21 @@ else if(this._currentRow == 3){ /** * This method handles the construction of the property table of a selected element * @param MObject : the selected element - * + * * @param table : the property table to fulfill */ @objid ("f4858ac1-63d1-4c49-821f-6c05ebec4612") @Override public void update(IModulePropertyTable table) { super.update(table); - + table.addProperty("Is Assignable", this._element.isIsAssignable()); - + //Parent this._parent = CloudLocation.MdaTypes.STEREOTYPE_ELT.getExtendedElement(); table.addProperty("Parent", getCamelName(this._element.getParent()), getCamelNames(this._parent)); - - //Geographical Region + + //Geographical Region this._geographicalRegion = GeographicalRegion.MdaTypes.STEREOTYPE_ELT.getExtendedElement(); table.addProperty("Geographical Region", getCamelName(this._element.getGeographicalRegion()), getCamelNames(this._geographicalRegion)); } diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/GeographicalRegionPropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/GeographicalRegionPropertyPage.java index a7ce2cba..ccbdb05c 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/GeographicalRegionPropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/location/GeographicalRegionPropertyPage.java @@ -1,11 +1,11 @@ package fr.softeam.cameldesigner.handlers.propertypages.location; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.modelio.api.module.propertiesPage.IModulePropertyTable; +import org.modelio.metamodel.uml.statik.Class; import fr.softeam.cameldesigner.api.CamelDesignerProxyFactory; import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule; import fr.softeam.cameldesigner.api.locationmodel.standard.enumeration.GeographicalRegion; -import org.modelio.api.module.propertiesPage.IModulePropertyTable; -import org.modelio.metamodel.uml.statik.Class; @objid ("c4645b49-5a42-4f63-a315-9de67ad4ef1f") public class GeographicalRegionPropertyPage extends LocationPropertyPage { @@ -13,7 +13,7 @@ public class GeographicalRegionPropertyPage extend * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. * @param MObject : the selected element - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -21,7 +21,7 @@ public class GeographicalRegionPropertyPage extend @Override public void changeProperty(int row, String value) { super.changeProperty(row, value); - + if(this._currentRow == 1) { Class elt = (Class) getModelElt(GeographicalRegion.MdaTypes.STEREOTYPE_ELT.getExtendedElement(), value); if ((elt!=null) &&(elt.isStereotyped(ICamelDesignerPeerModule.MODULE_NAME, GeographicalRegion.STEREOTYPE_NAME))) { @@ -33,18 +33,17 @@ public void changeProperty(int row, String value) { } } } - + else if(this._currentRow == 2) { - for (String v: value.split(",")){ - - if (value.startsWith(this._add)) { - this._element.addAlternativeName(value); - }else { - this._element.removeAlternativeName(value); - } + for (String v: value.split(this._eltSeparator)){ + + if (value.startsWith(this._add)) { + this._element.addAlternativeName(value); + }else { + this._element.removeAlternativeName(value); + } } - - + } this._currentRow -= 2; } @@ -52,24 +51,20 @@ else if(this._currentRow == 2) { /** * This method handles the construction of the property table of a selected element * @param MObject : the selected element - * + * * @param table : the property table to fulfill */ @objid ("b8cebff1-008a-461e-bbad-0f3f2d24133a") @Override public void update(IModulePropertyTable table) { super.update(table); - + //Parent Regions table.addProperty("Parent Regions", getCamelValue(this._element.getParentRegions()), getAddRemove(GeographicalRegion.MdaTypes.STEREOTYPE_ELT.getExtendedElement(), this._element.getParentRegions())); - + //Alternative Names - String alternativeNames = ""; - for( String alternativeName: this._element.getAlternativeNames()) { - alternativeNames += alternativeName + ","; - } - table.addProperty("Alternative Names", alternativeNames); - + table.addProperty("Alternative Names", String.join(this._eltSeparator, this._element.getAlternativeNames())); + this._currentRow -= 2; } diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsObjectPropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsObjectPropertyPage.java index 00e3d969..b81946d9 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsObjectPropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsObjectPropertyPage.java @@ -1,9 +1,9 @@ package fr.softeam.cameldesigner.handlers.propertypages.metadata; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.modelio.api.module.propertiesPage.IModulePropertyTable; import fr.softeam.cameldesigner.api.metadatamodel.infrastructure.modelelement.MmsObject; import fr.softeam.cameldesigner.handlers.propertypages.core.NamedElementPropertyPage; -import org.modelio.api.module.propertiesPage.IModulePropertyTable; @objid ("36423306-f950-4d13-ae37-2dc7c8cd2e25") public abstract class MmsObjectPropertyPage extends NamedElementPropertyPage { @@ -11,7 +11,7 @@ public abstract class MmsObjectPropertyPage extends NamedEl * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. * @param MObject : the selected element - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -19,18 +19,34 @@ public abstract class MmsObjectPropertyPage extends NamedEl @Override public void changeProperty(int row, String value) { super.changeProperty(row, value); + + if(this._currentRow == 1){ + this._element.setId(value); + } + + else if(this._currentRow == 2){ + this._element.setUri(value); + } + + this._currentRow -= 2; } /** * This method handles the construction of the property table of a selected element * @param MObject : the selected element - * + * * @param table : the property table to fulfill */ @objid ("398c4a93-4893-45ba-a0e3-23cd1a295bc0") @Override public void update(IModulePropertyTable table) { super.update(table); + + //Id + table.addProperty("Id", this._element.getId()); + + //Uri + table.addProperty("Uri", this._element.getUri()); } @objid ("5e3fbbd0-7dbe-4941-9a5b-c1981cee43d3") diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyInstancePropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyInstancePropertyPage.java index 551b8e03..1eba63d8 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyInstancePropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyInstancePropertyPage.java @@ -2,13 +2,13 @@ import java.util.List; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.modelio.api.module.propertiesPage.IModulePropertyTable; +import org.modelio.metamodel.uml.infrastructure.ModelElement; +import org.modelio.metamodel.uml.statik.Class; import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule; import fr.softeam.cameldesigner.api.metadatamodel.standard.attribute.MmsProperty; import fr.softeam.cameldesigner.api.metadatamodel.standard.attributelink.MmsPropertyInstance; import fr.softeam.cameldesigner.api.metadatamodel.standard.instance.MmsConceptInstance; -import org.modelio.api.module.propertiesPage.IModulePropertyTable; -import org.modelio.metamodel.uml.infrastructure.ModelElement; -import org.modelio.metamodel.uml.statik.Class; @objid ("53f0d1f2-8f76-43b0-b222-759fd70e5b7a") public class MmsPropertyInstancePropertyPage extends MmsObjectPropertyPage { @@ -22,7 +22,7 @@ public class MmsPropertyInstancePropertyPage exte * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. * @param MObject : the selected element - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -30,19 +30,19 @@ public class MmsPropertyInstancePropertyPage exte @Override public void changeProperty(int row, String value) { super.changeProperty(row, value); - + if(this._currentRow == 1){ ModelElement elt = getModelElt(this._isA, value); if (elt.isStereotyped(ICamelDesignerPeerModule.MODULE_NAME, MmsProperty.STEREOTYPE_NAME)) { this._element.setIsA((MmsProperty) elt); } } - + else if(this._currentRow == 2){ this._element.setPropertyValue(value); - + } - + else if(this._currentRow == 3){ Class elt = (Class) getModelElt(this._conceptInstance, value); if (elt.isStereotyped(ICamelDesignerPeerModule.MODULE_NAME, MmsConceptInstance.STEREOTYPE_NAME)) { @@ -55,22 +55,21 @@ else if(this._currentRow == 3){ /** * This method handles the construction of the property table of a selected element * @param MObject : the selected element - * + * * @param table : the property table to fulfill */ @objid ("f4da08a4-956a-45a1-9016-49cf77c3729c") @Override public void update(IModulePropertyTable table) { super.update(table); - - + //Is A this._isA = MmsProperty.MdaTypes.STEREOTYPE_ELT.getExtendedElement(); table.addProperty("Is A", getCamelName(this._element.getIsA()), getCamelNames(this._isA)); - + //Property Value table.addProperty("Property Value", getNotNull(this._element.getPropertyValue())); - + //Concept Instance" this._conceptInstance = MmsConceptInstance.MdaTypes.STEREOTYPE_ELT.getExtendedElement(); table.addProperty("Concept Instance", getCamelName(this._element.getIsA()), getCamelNames(this._conceptInstance)); diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyPropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyPropertyPage.java index 92a92e61..ed547398 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyPropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metadata/MmsPropertyPropertyPage.java @@ -1,12 +1,12 @@ package fr.softeam.cameldesigner.handlers.propertypages.metadata; import java.util.Arrays; -import camel.mms.MmsPropertyType; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.metadatamodel.standard.attribute.MmsProperty; -import fr.softeam.cameldesigner.api.metadatamodel.standard.class_.MmsConcept; import org.modelio.api.module.propertiesPage.IModulePropertyTable; import org.modelio.metamodel.uml.statik.Class; +import camel.mms.MmsPropertyType; +import fr.softeam.cameldesigner.api.metadatamodel.standard.attribute.MmsProperty; +import fr.softeam.cameldesigner.api.metadatamodel.standard.class_.MmsConcept; @objid ("1ccba304-5c60-4898-b98a-19a8261c420f") public class MmsPropertyPropertyPage extends MmsObjectPropertyPage { @@ -14,7 +14,7 @@ public class MmsPropertyPropertyPage extends MmsObjectPro * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. * @param MObject : the selected element - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -22,50 +22,43 @@ public class MmsPropertyPropertyPage extends MmsObjectPro @Override public void changeProperty(int row, String value) { super.changeProperty(row, value); - + if(this._currentRow == 1){ - Class elt = (Class) getModelElt(MmsConcept.MdaTypes.STEREOTYPE_ELT.getExtendedElement(), value); - if (MmsConcept.canInstantiate(elt)) { - this._element.setDomain(MmsConcept.safeInstantiate(elt)); - } - } - else if(this._currentRow == 2){ this._element.setPropertyType(value); } - else if(this._currentRow == 3){ + else if(this._currentRow == 2){ Class elt = (Class) getModelElt(MmsConcept.MdaTypes.STEREOTYPE_ELT.getExtendedElement(), value); if (MmsConcept.canInstantiate(elt)) { this._element.setRange(MmsConcept.safeInstantiate(elt)); } } - else if(this._currentRow == 4){ + else if(this._currentRow == 3){ this._element.setRangeUri(value); } + + this._currentRow -= 3; } /** * This method handles the construction of the property table of a selected element * @param MObject : the selected element - * + * * @param table : the property table to fulfill */ @objid ("afb4dafb-f880-42bc-8a6c-622ffe93886f") @Override public void update(IModulePropertyTable table) { super.update(table); - - //Domain - table.addProperty("Domain", getCamelName(this._element.getDomain()), getCamelNames(MmsConcept.MdaTypes.STEREOTYPE_ELT.getExtendedElement())); - + //PropertyType String[] values = Arrays.stream(MmsPropertyType.values()) // create stream of enum values .map(e -> e.toString()) // convert enum stream to String stream .toArray(String[]::new); table.addProperty("Property Type", getNotNull(this._element.getPropertyType()), values); - + //Range table.addProperty("Range", getCamelName(this._element.getRange()), getCamelNames(MmsConcept.MdaTypes.STEREOTYPE_ELT.getExtendedElement())); - + //RangeUri table.addProperty("Range Uri", getNotNull(this._element.getRangeUri())); } diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metric/FunctionPropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metric/FunctionPropertyPage.java index f94db130..3fd6398b 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metric/FunctionPropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/metric/FunctionPropertyPage.java @@ -2,9 +2,9 @@ import java.util.Arrays; import com.modeliosoft.modelio.javadesigner.annotations.objid; +import org.modelio.api.module.propertiesPage.IModulePropertyTable; import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Function; import fr.softeam.cameldesigner.handlers.propertypages.core.FeaturePropertyPage; -import org.modelio.api.module.propertiesPage.IModulePropertyTable; @objid ("40ddda4f-2a3b-42ce-89b2-c8edc95dcaad") public class FunctionPropertyPage extends FeaturePropertyPage { @@ -12,7 +12,7 @@ public class FunctionPropertyPage extends FeaturePropertyPag * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. * @param MObject : the selected element - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -20,41 +20,37 @@ public class FunctionPropertyPage extends FeaturePropertyPag @Override public void changeProperty(int row, String value) { super.changeProperty(row, value); - + switch (this._currentRow) { - + case 1 : this._element.setExpression(value); break; - + case 2 : - - this._element.setArguments(Arrays.asList(value.split(","))); - + + this._element.setArguments(Arrays.asList(value.split(this._eltSeparator))); + break; - } + } this._currentRow -= 2; } /** * This method handles the construction of the property table of a selected element * @param MObject : the selected element - * + * * @param table : the property table to fulfill */ @objid ("ce97e73c-c69e-4be0-9bb1-fe3c4155779f") @Override public void update(IModulePropertyTable table) { super.update(table); - + table.addProperty("Expression", getNotNull(this._element.getExpression())); - + //Arguments - String arguments = ""; - for( String argument: this._element.getArguments()) { - arguments += argument + ","; - } - table.addProperty("Provider Names", arguments); + table.addProperty("Provider Names", String.join(this._eltSeparator, this._element.getArguments())); } @objid ("379aebb8-0fa5-4022-85b7-18bd29150752") diff --git a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/requirement/ProviderRequirementPropertyPage.java b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/requirement/ProviderRequirementPropertyPage.java index 3cfb5029..bb0030c5 100644 --- a/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/requirement/ProviderRequirementPropertyPage.java +++ b/src/main/java/fr/softeam/cameldesigner/handlers/propertypages/requirement/ProviderRequirementPropertyPage.java @@ -2,8 +2,8 @@ import java.util.Arrays; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ProviderRequirement; import org.modelio.api.module.propertiesPage.IModulePropertyTable; +import fr.softeam.cameldesigner.api.requirementmodel.standard.class_.ProviderRequirement; @objid ("9b9e8414-3daa-4344-ac39-4bcbcb22c147") public class ProviderRequirementPropertyPage extends HardRequirementPropertyPage { @@ -11,7 +11,7 @@ public class ProviderRequirementPropertyPage exte * This method handles the changes of the given property, identified by its row index, of a selected element * to a new value. * @param MObject : the selected element - * + * * @param row : the row of the changed property * @param value : the new value of the property */ @@ -19,42 +19,38 @@ public class ProviderRequirementPropertyPage exte @Override public void changeProperty(int row, String value) { super.changeProperty(row, value); - + if(this._currentRow == 1){ - - this._element.setProviderNames(Arrays.asList(value.split(","))); - + + this._element.setProviderNames(Arrays.asList(value.split(this._eltSeparator))); + } else if(this._currentRow == 2){ - + this._element.setCloudType(value); - + } - + this._currentRow -= 2; } /** * This method handles the construction of the property table of a selected element * @param MObject : the selected element - * + * * @param table : the property table to fulfill */ @objid ("7adce826-e6bc-44c7-b537-34d6b88bf06a") @Override public void update(IModulePropertyTable table) { super.update(table); - + + //Provider Names + table.addProperty("Provider Names", String.join(this._eltSeparator, this._element.getProviderNames())); + //Cloud Type table.addProperty("Cloud Type", this._element.getCloudType()); - - //Provider Names - String providerNames = ""; - for( String providerName: this._element.getProviderNames()) { - providerNames += providerName + ","; - } - - table.addProperty("Provider Names", providerNames); + } @objid ("597d7a59-7bf4-45f6-a629-650371103b6a") diff --git a/src/main/java/fr/softeam/cameldesigner/ui/WizardImport.java b/src/main/java/fr/softeam/cameldesigner/ui/WizardImport.java index 4840f5f8..c4c4fdf7 100644 --- a/src/main/java/fr/softeam/cameldesigner/ui/WizardImport.java +++ b/src/main/java/fr/softeam/cameldesigner/ui/WizardImport.java @@ -2,12 +2,6 @@ import java.io.File; import com.modeliosoft.modelio.javadesigner.annotations.objid; -import fr.softeam.cameldesigner.exchange.importer.AbstractImporterService; -import fr.softeam.cameldesigner.exchange.importer.CamelImporterService; -import fr.softeam.cameldesigner.exchange.importer.XMIImporterService; -import fr.softeam.cameldesigner.impl.CamelDesignerModule; -import fr.softeam.cameldesigner.ui.composite.FileChooserComposite; -import fr.softeam.cameldesigner.ui.composite.ValidationBoutonComposite; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -17,6 +11,12 @@ import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Shell; import org.modelio.api.modelio.model.ITransaction; +import fr.softeam.cameldesigner.exchange.importer.AbstractImporterService; +import fr.softeam.cameldesigner.exchange.importer.CamelImporterService; +import fr.softeam.cameldesigner.exchange.importer.XMIImporterService; +import fr.softeam.cameldesigner.impl.CamelDesignerModule; +import fr.softeam.cameldesigner.ui.composite.FileChooserComposite; +import fr.softeam.cameldesigner.ui.composite.ValidationBoutonComposite; /** * This class provides the Camel export dialog @@ -27,21 +27,21 @@ public class WizardImport extends AbstractSwtWizardWindow { @objid ("60740ef0-15b0-4759-8c52-f220b48c041a") private void createContents() { setLabels(); - + this.shell = new Shell(getParent(), 67696 | SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.TITLE); this.shell.setLayout( new FormLayout()); this.shell.setText(this.frametitle); - + // File chooser composite this.fileChooserComposite = new FileChooserComposite(this.shell, SWT.NONE, SWT.OPEN); - + // Validation Composite this. validateComposite = new ValidationBoutonComposite(this.shell, SWT.NONE, this.cancelButton, this.validateButton); - + this.validateComposite.getValidationButton().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - + if (getFileChooserComposite().getCurrentFile() != null) { validationAction(); } else { @@ -49,7 +49,7 @@ public void widgetSelected(SelectionEvent e) { } } }); - + this.validateComposite.getCancelButton().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -57,32 +57,32 @@ public void widgetSelected(SelectionEvent e) { cancelAction(); } }); - + final FormData fd_fileChooserComposite = new FormData(); fd_fileChooserComposite.right = new FormAttachment(100, 0); - fd_fileChooserComposite.bottom = new FormAttachment(0, 50); + fd_fileChooserComposite.bottom = new FormAttachment(0, 40); fd_fileChooserComposite.top = new FormAttachment(0, 0); fd_fileChooserComposite.left = new FormAttachment(0, 0); this.fileChooserComposite.setLayoutData(fd_fileChooserComposite); - + final FormData fd_validateComposite = new FormData(); fd_validateComposite.top = new FormAttachment(this.fileChooserComposite, 5); fd_validateComposite.bottom = new FormAttachment(100, -5); - fd_validateComposite.left = new FormAttachment(this.fileChooserComposite, 0, SWT.LEFT); + fd_validateComposite.left = new FormAttachment(this.fileChooserComposite, 5, SWT.LEFT); fd_validateComposite.right = new FormAttachment(this.fileChooserComposite, 0, SWT.RIGHT); this.validateComposite.setLayoutData(fd_validateComposite); - + this.fileChooserComposite.getSearch().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { WizardImport.this.fileChooserComposite.searchFile(); } }); - + setDefaultDialog(); this.shell.pack(); this.shell.setMinimumSize(new Point(this.shell.getBounds().width, this.shell.getBounds().height)); - + this.validateComposite.getValidationButton().setFocus(); } @@ -90,31 +90,31 @@ public void widgetSelected(SelectionEvent e) { @Override public void validationAction() { File theFile = getFileChooserComposite().getCurrentFile(); - + if (theFile.exists() && theFile.isFile()) { - + try(ITransaction t = CamelDesignerModule.getInstance().getModuleContext().getModelingSession().createTransaction("Import") ) { - + AbstractImporterService importerService = null; - + if (theFile.getAbsolutePath().endsWith(".xmi")) { importerService = new XMIImporterService(); - + }else { importerService = new CamelImporterService(); } - - + + importerService.importFromFile(this.selectedElt, theFile.getAbsolutePath()); - + t.commit(); completeBox(); - - + + } catch (final Exception e) { CamelDesignerModule.logService.error(e); } - + } else { fileDontExist(); } @@ -145,8 +145,8 @@ public void setPath() { @objid ("4855c49e-cf0f-4bf9-8919-f5730a3666e2") @Override public void setDefaultDialog() { - this.fileChooserComposite.getDialog().setFilterNames(new String[] { "XMI Files", "Camel" }); - this.fileChooserComposite.getDialog().setFilterExtensions(new String[] { "*.xmi", "*.camel" }); + this.fileChooserComposite.getDialog().setFilterNames(new String[] { "All Files (*.camel, *.xmi)", "Camel Files (*.camel)", "XMI Files (*.xmi)" }); + this.fileChooserComposite.getDialog().setFilterExtensions(new String[] { "*.camel; *.xmi", "*.camel", "*.xmi" }); setPath(); } diff --git a/src/main/java/fr/softeam/cameldesigner/utils/StringUtils.java b/src/main/java/fr/softeam/cameldesigner/utils/StringUtils.java index 697a611a..a0047aca 100644 --- a/src/main/java/fr/softeam/cameldesigner/utils/StringUtils.java +++ b/src/main/java/fr/softeam/cameldesigner/utils/StringUtils.java @@ -14,6 +14,9 @@ public class StringUtils { @objid ("e3bc0760-03f7-4781-8121-cf22753a26bd") private static Pattern NUMBER_PATTERN = Pattern.compile("-?\\d+(\\.\\d+)?"); + @objid ("47afe1d6-eefa-47d0-8b84-d2d4075b5bb9") + private static Pattern INT_PATTERN = Pattern.compile("(0|[1-9]\\d*)"); + @objid ("5a9f406f-7a9a-4c97-83e0-9b9aa5bc42e9") public static String capitalizeFirst(String toCap) { return toCap.substring(0, 1).toUpperCase() + toCap.substring(1); @@ -22,7 +25,7 @@ public static String capitalizeFirst(String toCap) { @objid ("b15f69ab-78f3-4533-9d69-32c6310ff6ef") public static boolean isNumeric(String strNum) { if (strNum == null) { - return false; + return false; } return NUMBER_PATTERN.matcher(strNum).matches(); } @@ -32,4 +35,17 @@ public static boolean isBoolean(String strBoolean) { return strBoolean != null && (strBoolean.equals(TRUE_LITERAL) || strBoolean.equals(FALSE_LITERAL)); } + @objid ("83d636ef-e1d7-42c3-9048-69ed4e1a5b50") + public static boolean isInteger(String strNum) { + if (strNum == null) { + return false; + } + return NUMBER_PATTERN.matcher(strNum).matches(); + } + + @objid ("b12022b5-4a3d-4c55-863d-32b2e0ff1c21") + public static boolean isNullOrEmpty(String toTest) { + return ((toTest == null) || (toTest.equals(""))); + } + }