Commit af6915d0 authored by Paff's avatar Paff
Browse files

version is now cpe

parent d5496f70
......@@ -174,12 +174,12 @@ grammar MontiSecArc extends mc.umlp.arc.MontiArc {
"accesscontrol" ( ["on"] | ["off"] ) ";";
/**
* SecArcVersion represent the version of a 3rd party component.
* SecArcCPE represent the cpe of a 3rd party component.
*/
/SecArcVersion
implements(Stereotype? "version") => ArcElement =
/SecArcCPE
implements(Stereotype? "cpe") => ArcElement =
Stereotype?
"version" nameVersion:StringLiteral ";";
"cpe" nameCPE:StringLiteral ";";
/**
* SecArcConfigration represent the configuration of a 3rd party component.
......@@ -216,7 +216,7 @@ grammar MontiSecArc extends mc.umlp.arc.MontiArc {
/mc.umlp.common._ast.UMLPNode;
ast SecArcPEP astextends
/mc.umlp.common._ast.UMLPNode;
ast SecArcVersion astextends
ast SecArcCPE astextends
/mc.umlp.common._ast.UMLPNode;
ast SecArcConfiguration astextends
/mc.umlp.common._ast.UMLPNode;
......
......@@ -37,7 +37,7 @@ import secarc.ets.deserializers.SecPortEntryDeserializer;
import secarc.ets.deserializers.SecSubComponentEntryDeserializer;
import secarc.ets.deserializers.TrustlevelEntryDeserializer;
import secarc.ets.deserializers.TrustlevelRelationEntryDeserializer;
import secarc.ets.deserializers.VersionEntryDeserializer;
import secarc.ets.deserializers.CPEEntryDeserializer;
import secarc.ets.entries.SecComponentEntry;
import secarc.ets.resolvers.RoleResolverClient;
import secarc.ets.resolvers.ConfigurationResolverClient;
......@@ -46,7 +46,7 @@ import secarc.ets.resolvers.IdentityResolverClient;
import secarc.ets.resolvers.PEPResolverClient;
import secarc.ets.resolvers.TrustlevelRelationResolverClient;
import secarc.ets.resolvers.TrustlevelResolverClient;
import secarc.ets.resolvers.VersionResolverClient;
import secarc.ets.resolvers.CPEResolverClient;
import interfaces2.language.LanguageComponent;
import interfaces2.workflows.ConcreteASTAndNameSpaceVisitor;
......@@ -91,7 +91,7 @@ public class MontiSecArcComponent extends LanguageComponent {
addDeserializer(new SecPortEntryDeserializer(arcdFactory));
addDeserializer(new SecSubComponentEntryDeserializer(arcdFactory));
addDeserializer(new TrustlevelEntryDeserializer(arcdFactory));
addDeserializer(new VersionEntryDeserializer(arcdFactory));
addDeserializer(new CPEEntryDeserializer(arcdFactory));
addDeserializer(new TrustlevelRelationEntryDeserializer(arcdFactory));
addQualifierClient(new ComponentQualifier());
addQualifierClient(new ArcdTypeQualifier());
......@@ -109,7 +109,7 @@ public class MontiSecArcComponent extends LanguageComponent {
addResolverClient(new RoleResolverClient());
addResolverClient(new ConfigurationResolverClient());
addResolverClient(new FilterResolverClient());
addResolverClient(new VersionResolverClient());
addResolverClient(new CPEResolverClient());
addResolverClient(new PEPResolverClient());
addResolverClient(new TrustlevelResolverClient());
addResolverClient(new TrustlevelRelationResolverClient());
......
......@@ -61,6 +61,11 @@ public final class MontiSecArcConstants extends Interfaces2Constants {
*/
public static final String DEFAULT_MONTI_ARC_CONFIG_FILE = "ma.cfg";
/**
* Argument for Analysis configuration
*/
public static final String ARG_ANALYSISCONFPATH = "-analsisconf";
/**
* name for pep entry
*/
......
......@@ -9,7 +9,7 @@ import secarc.ets.entries.IPEPEntryFactory;
import secarc.ets.entries.IRoleEntryFactory;
import secarc.ets.entries.ITrustlevelEntryFactory;
import secarc.ets.entries.ITrustlevelRelationEntryFactory;
import secarc.ets.entries.IVersionEntryFactory;
import secarc.ets.entries.ICPEEntryFactory;
import secarc.ets.entries.IdentityEntryFactory;
import secarc.ets.entries.PEPEntryFactory;
import secarc.ets.entries.RoleEntryFactory;
......@@ -20,7 +20,7 @@ import secarc.ets.entries.SecPortEntryFactory;
import secarc.ets.entries.SecSubComponentEntryFactory;
import secarc.ets.entries.TrustlevelEntryFactory;
import secarc.ets.entries.TrustlevelRelationEntryFactory;
import secarc.ets.entries.VersionEntryFactory;
import secarc.ets.entries.CPEEntryFactory;
import secarc.ets.visitor.MontiSecArcSymtabVisitor;
import interfaces2.language.ILanguage;
import interfaces2.language.LanguageComponent;
......@@ -104,7 +104,7 @@ public class MontiSecArcDefaultModule extends MontiArcDefaultModule {
bind(IPEPEntryFactory.class).to(PEPEntryFactory.class);
bind(ITrustlevelEntryFactory.class).to(TrustlevelEntryFactory.class);
bind(IConfigurationEntryFactory.class).to(ConfigurationEntryFactory.class);
bind(IVersionEntryFactory.class).to(VersionEntryFactory.class);
bind(ICPEEntryFactory.class).to(CPEEntryFactory.class);
bind(IRoleEntryFactory.class).to(RoleEntryFactory.class);
bind(IIdentityEntryFactory.class).to(IdentityEntryFactory.class);
bind(ITrustlevelRelationEntryFactory.class).to(TrustlevelRelationEntryFactory.class);
......
......@@ -10,7 +10,7 @@ import mc.umlp.arcd._ast.ASTArcComponent;
* @version $Revision$, $Date$
*
*/
public class ASTSecArcVersion extends PrototypeASTSecArcVersion {
public class ASTSecArcCPE extends PrototypeASTSecArcCPE {
/*
* (non-Javadoc)
......
......@@ -9,12 +9,12 @@ import mc.ast.ASTNode;
* @version $Revision$, $Date$
*
*/
public class ASTSecArcVersionList extends PrototypeASTSecArcVersionList {
public class ASTSecArcCPEList extends PrototypeASTSecArcCPEList {
/**
* Default constructor
*/
public ASTSecArcVersionList() {
public ASTSecArcCPEList() {
super();
}
......@@ -23,7 +23,7 @@ public class ASTSecArcVersionList extends PrototypeASTSecArcVersionList {
*
* @param strictlyOrdered true, if this list should be strictly ordered.
*/
public ASTSecArcVersionList(boolean strictlyOrdered) {
public ASTSecArcCPEList(boolean strictlyOrdered) {
super(strictlyOrdered);
}
......
......@@ -23,7 +23,7 @@ public enum MontiSecArcErrorCodes implements IErrorCode {
/**
* For a component exists a unique version
*/
UniqueVersion,
UniqueCPE,
/**
* For a component exists a unique trustlevel
......
......@@ -29,7 +29,7 @@ import secarc._ast.ASTSecArcIdentity;
import secarc._ast.ASTSecArcRefRole;
import secarc._ast.ASTSecArcRole;
import secarc._ast.ASTSecArcTrustlevelRelation;
import secarc._ast.ASTSecArcVersion;
import secarc._ast.ASTSecArcCPE;
import secarc._ast.ASTSecArcPEP;
import secarc.ets.cocos.checkers.ISecComponentBodyChecker;
import secarc.ets.cocos.checkers.ISecComponentChecker;
......@@ -43,7 +43,7 @@ import secarc.ets.cocos.checkers.ISecRefRoleChecker;
import secarc.ets.cocos.checkers.ISecRoleChecker;
import secarc.ets.cocos.checkers.ISecSubComponentChecker;
import secarc.ets.cocos.checkers.ISecTrustlevelRelationChecker;
import secarc.ets.cocos.checkers.ISecVersionChecker;
import secarc.ets.cocos.checkers.ISecCPEChecker;
import secarc.ets.entries.ConfigurationEntry;
import secarc.ets.entries.FilterEntry;
import secarc.ets.entries.IdentityEntry;
......@@ -54,7 +54,7 @@ import secarc.ets.entries.SecConnectorEntry;
import secarc.ets.entries.SecPortEntry;
import secarc.ets.entries.SecSubComponentEntry;
import secarc.ets.entries.TrustlevelRelationEntry;
import secarc.ets.entries.VersionEntry;
import secarc.ets.entries.CPEEntry;
import secarc.ets.graph.ArchitectureGraph;
import secarc.ets.graph.ArchitectureGraphBuilder;
......@@ -101,7 +101,7 @@ public class MontiSecArcCheckVisitor extends MontiArcCheckCoCoVisitor {
/**
* Cocos that check the version related conditions
*/
private Set<ISecVersionChecker> secVersionChecker;
private Set<ISecCPEChecker> secVersionChecker;
/**
* Cocos that check the body of a component
......@@ -153,7 +153,7 @@ public class MontiSecArcCheckVisitor extends MontiArcCheckCoCoVisitor {
secConnectorChecker = new HashSet<ISecConnectorChecker>();
secComponentChecker = new HashSet<ISecComponentChecker>();
secSubComponentChecker = new HashSet<ISecSubComponentChecker>();
secVersionChecker = new HashSet<ISecVersionChecker>();
secVersionChecker = new HashSet<ISecCPEChecker>();
secComponentBodyChecker = new HashSet<ISecComponentBodyChecker>();
secIdentityChecker = new HashSet<ISecIdentityChecker>();
secPepChecker = new HashSet<ISecPepChecker>();
......@@ -192,8 +192,8 @@ public class MontiSecArcCheckVisitor extends MontiArcCheckCoCoVisitor {
if(coco instanceof ISecSubComponentChecker) {
secSubComponentChecker.add((ISecSubComponentChecker) coco);
}
if(coco instanceof ISecVersionChecker) {
secVersionChecker.add((ISecVersionChecker) coco);
if(coco instanceof ISecCPEChecker) {
secVersionChecker.add((ISecCPEChecker) coco);
}
if(coco instanceof ISecComponentBodyChecker) {
secComponentBodyChecker.add((ISecComponentBodyChecker) coco);
......@@ -312,11 +312,11 @@ public class MontiSecArcCheckVisitor extends MontiArcCheckCoCoVisitor {
*
* @param node ast node to visit
*/
public void visit(ASTSecArcVersion node) {
public void visit(ASTSecArcCPE node) {
try {
VersionEntry entry = (VersionEntry) resolver.resolve(MontiSecArcConstants.VERSION_NAME, VersionEntry.KIND, getNameSpaceFor(node.getMainParent()));
CPEEntry entry = (CPEEntry) resolver.resolve(MontiSecArcConstants.VERSION_NAME, CPEEntry.KIND, getNameSpaceFor(node.getMainParent()));
if (entry != null) {
for (ISecVersionChecker cc : secVersionChecker) {
for (ISecCPEChecker cc : secVersionChecker) {
cc.check(node, entry);
}
}
......
......@@ -46,7 +46,7 @@ public final class MontiSecArcContextConditionConstants {
public static final String ACCESS_CONTROL_ON = "Checks if accesscontrol is on.";
public static final String UNIQUE_VERSION = "Checks if for a component exists a unique version.";
public static final String UNIQUE_CPE = "Checks if for a component exists a unique version.";
public static final String UNIQUE_TRUSTLEVEL = "Checks if for a component exists a unique trustlevel.";
......
......@@ -10,6 +10,7 @@ import secarc.ets.cocos.common.NamingConventions;
import secarc.ets.cocos.common.UniqueDefinitionWithFullQualifiedNames;
import secarc.ets.cocos.component.CompletenessThirdPartyComponent;
import secarc.ets.cocos.configuration.UniqueConfiguration;
import secarc.ets.cocos.cpe.UniqueCPE;
import secarc.ets.cocos.identity.IdentityCycleCheck;
import secarc.ets.cocos.pep.AccessControlCoCo;
import secarc.ets.cocos.pep.RoleDefintionInSubcomponents;
......@@ -21,7 +22,6 @@ import secarc.ets.cocos.role.UniqueRoleDefinitionForComponent;
import secarc.ets.cocos.role.UniqueRoleDefinitionForPort;
import secarc.ets.cocos.trustlevel.UniqueTrustlevel;
import secarc.ets.cocos.trustlevelrelation.CorrectRelationBetweenTrustlevel;
import secarc.ets.cocos.version.UniqueVersion;
import mc.ProblemReport;
import mc.ProblemReport.Type;
......@@ -119,7 +119,7 @@ public final class MontiSecArcContextConditionCreator {
uniqueCoCo.setLevel(Type.ERROR);
//Unique Version in AST
uniqueCoCo.addChild(new UniqueVersion());
uniqueCoCo.addChild(new UniqueCPE());
//Unique Trustlevel in AST
uniqueCoCo.addChild(new UniqueTrustlevel());
......
package secarc.ets.cocos.checkers;
import secarc._ast.ASTSecArcVersion;
import secarc.ets.entries.VersionEntry;
import secarc._ast.ASTSecArcCPE;
import secarc.ets.entries.CPEEntry;
/**
* Context condition checker interface for checking SecVersion
......@@ -16,13 +16,13 @@ import secarc.ets.entries.VersionEntry;
* $Revision$
*
*/
public interface ISecVersionChecker {
public interface ISecCPEChecker {
/**
*
* @param node ast node to be checked
* @param entry entry related version entry to be checked
*/
void check(ASTSecArcVersion node, VersionEntry entry);
void check(ASTSecArcCPE node, CPEEntry entry);
}
......@@ -27,7 +27,7 @@ public class CompletenessThirdPartyComponent extends ContextCondition implements
ISecComponentChecker {
/** Third party component definition literal. */
private static final String THIRD_PARTY_COMPONET_DEFINTION = "A third party component consists of a version and configuration.";
private static final String THIRD_PARTY_COMPONET_DEFINTION = "A third party component consists of a cpe and configuration.";
public CompletenessThirdPartyComponent() {
......@@ -42,13 +42,13 @@ public class CompletenessThirdPartyComponent extends ContextCondition implements
public void check(ASTArcComponent node, SecComponentEntry entry, ArchitectureGraph graph)
throws AmbigousException {
if(entry.getVersion() != null && entry.getConfiguration() == null) {
if(entry.getCPE() != null && entry.getConfiguration() == null) {
addReport("The component " + NameHelper.getSimplenameFromComplexname(entry.getName()) + " has a version, but the configration is missing. " +
THIRD_PARTY_COMPONET_DEFINTION, node.get_SourcePositionStart());
}
if(entry.getVersion() == null && entry.getConfiguration() != null) {
addReport("The component " + NameHelper.getSimplenameFromComplexname(entry.getName()) + " has a configuration, but the version is missing." +
if(entry.getCPE() == null && entry.getConfiguration() != null) {
addReport("The component " + NameHelper.getSimplenameFromComplexname(entry.getName()) + " has a configuration, but the cpe is missing." +
THIRD_PARTY_COMPONET_DEFINTION, node.get_SourcePositionStart());
}
......
package secarc.ets.cocos.version;
package secarc.ets.cocos.cpe;
import mc.IErrorCode;
import mc.helper.NameHelper;
......@@ -6,7 +6,7 @@ import mc.umlp.arcd._ast.ASTArcComponent;
import mc.umlp.arcd._ast.ASTArcComponentBody;
import mc.umlp.arcd._ast.ASTArcElement;
import interfaces2.coco.ContextCondition;
import secarc._ast.ASTSecArcVersion;
import secarc._ast.ASTSecArcCPE;
import secarc.error.MontiSecArcErrorCodes;
import secarc.ets.check.MontiSecArcContextConditionConstants;
import secarc.ets.cocos.checkers.ISecComponentBodyChecker;
......@@ -23,10 +23,10 @@ import secarc.ets.cocos.checkers.ISecComponentBodyChecker;
* $Revision$
*
*/
public class UniqueVersion extends ContextCondition implements ISecComponentBodyChecker {
public class UniqueCPE extends ContextCondition implements ISecComponentBodyChecker {
public UniqueVersion() {
super(MontiSecArcContextConditionConstants.UNIQUE_VERSION);
public UniqueCPE() {
super(MontiSecArcContextConditionConstants.UNIQUE_CPE);
}
/*
......@@ -38,7 +38,7 @@ public class UniqueVersion extends ContextCondition implements ISecComponentBody
int count = 0;
for(ASTArcElement children : node.getArcElement()) {
if(children instanceof ASTSecArcVersion) {
if(children instanceof ASTSecArcCPE) {
count++;
}
}
......@@ -46,7 +46,7 @@ public class UniqueVersion extends ContextCondition implements ISecComponentBody
ASTArcComponent parent = (ASTArcComponent) node.get_Parent();
if(count > 1) {
addReport("The component " + NameHelper.getSimplenameFromComplexname(parent.getName()) + " has more than one version definition.", node.get_SourcePositionStart());
addReport("The component " + NameHelper.getSimplenameFromComplexname(parent.getName()) + " has more than one cpe definition.", node.get_SourcePositionStart());
}
}
......@@ -56,7 +56,7 @@ public class UniqueVersion extends ContextCondition implements ISecComponentBody
*/
@Override
public IErrorCode getErrorCode() {
return MontiSecArcErrorCodes.UniqueVersion;
return MontiSecArcErrorCodes.UniqueCPE;
}
}
......@@ -6,7 +6,7 @@ import com.google.inject.Inject;
import secarc.ets.entries.SecComponentEntry;
import secarc.ets.entries.SecEntryFactory;
import secarc.ets.entries.VersionEntry;
import secarc.ets.entries.CPEEntry;
import mc.ast.ASTNode;
import mc.ets.serialization._ast.ASTObject;
import mc.umlp.arcd.ArcdConstants;
......@@ -16,7 +16,7 @@ import interfaces2.STEntryState;
import interfaces2.loaders.STEntryDeserializer;
/**
* Deserializer for {@link VersionEntry}s. <br>
* Deserializer for {@link CPEEntry}s. <br>
* <br>
* Copyright (c) 2011 RWTH Aachen. All rights reserved.
*
......@@ -24,7 +24,7 @@ import interfaces2.loaders.STEntryDeserializer;
* @version $Date: $<br>
* $Revision: $
*/
public class VersionEntryDeserializer extends STEntryDeserializer {
public class CPEEntryDeserializer extends STEntryDeserializer {
private final IArcdEntryFactory arcdFactory;
......@@ -33,7 +33,7 @@ public class VersionEntryDeserializer extends STEntryDeserializer {
* @param arcdFactory
*/
@Inject
public VersionEntryDeserializer(IArcdEntryFactory arcdFactory) {
public CPEEntryDeserializer(IArcdEntryFactory arcdFactory) {
this.arcdFactory = arcdFactory;
}
......@@ -43,7 +43,7 @@ public class VersionEntryDeserializer extends STEntryDeserializer {
*/
@Override
public String getKind() {
return VersionEntry.KIND;
return CPEEntry.KIND;
}
/*
......@@ -54,13 +54,13 @@ public class VersionEntryDeserializer extends STEntryDeserializer {
public ISTEntry deserialize(ASTNode node) {
checkArgument(node instanceof ASTObject);
ASTObject object = (ASTObject) node;
VersionEntry version = ((SecEntryFactory) arcdFactory).createVersion();
CPEEntry cpe = ((SecEntryFactory) arcdFactory).createCPE();
String name = object.<String> getAttributeValue("version").or("");
String name = object.<String> getAttributeValue("cpe").or("");
version.setName(name);
version.setEntryState(STEntryState.FULL, version);
return version;
cpe.setName(name);
cpe.setEntryState(STEntryState.FULL, cpe);
return cpe;
}
/*
......@@ -69,11 +69,11 @@ public class VersionEntryDeserializer extends STEntryDeserializer {
*/
@Override
public ISTEntry deserialize(ASTNode description, ISTEntry parent) {
VersionEntry version = (VersionEntry) deserialize(description);
CPEEntry version = (CPEEntry) deserialize(description);
if (parent instanceof SecComponentEntry) {
SecComponentEntry comp = (SecComponentEntry) parent;
version.addKind(ArcdConstants.ST_KIND_PROTECTED);
comp.setVersion(version);
comp.setCPE(version);
}
return version;
}
......
......@@ -6,7 +6,7 @@ import secarc.ets.entries.IdentityEntry;
import secarc.ets.entries.PEPEntry;
import secarc.ets.entries.RoleEntry;
import secarc.ets.entries.TrustlevelEntry;
import secarc.ets.entries.VersionEntry;
import secarc.ets.entries.CPEEntry;
import com.google.common.collect.ImmutableSet;
......@@ -46,7 +46,7 @@ public class MontiSecArcInterfaceExtender extends STEntryDescriptionParserExtend
ArcdTypeEntry.KIND,
ArcdTypeReferenceEntry.KIND,
PEPEntry.KIND,
VersionEntry.KIND,
CPEEntry.KIND,
ConfigurationEntry.KIND,
IdentityEntry.KIND,
RoleEntry.KIND,
......
......@@ -6,7 +6,7 @@ import mc.umlp.arcd.ArcdConstants;
import mc.umlp.arcd.ets.entries.AbstractSTEntry;
/**
* MontiSecArc version entry.
* MontiSecArc cpe entry.
*
* <br>
* <br>
......@@ -16,38 +16,38 @@ import mc.umlp.arcd.ets.entries.AbstractSTEntry;
* @version $Date$<br>
* $Revision$
*/
public class VersionEntry extends AbstractSTEntry<VersionEntry>{
public class CPEEntry extends AbstractSTEntry<CPEEntry>{
/**
* Entry kind of Version.
* Entry kind of cpe.
*/
public static final String KIND = "SecArcVersion";
public static final String KIND = "SecArcCPE";
/**
* version of 3rd party component
* cpe of 3rd party component
*/
@Serialized
private String version;
private String cpe;
/**
* @param version Version of 3rd party component
*/
public void setVersion(String version) {
this.version = version;
public void setCPE(String cpe) {
this.cpe = cpe;
}
/**
* @return Version of 3rd party component
*/
public String getVersion() {
return version;
public String getCPE() {
return cpe;
}
/**
* Default constructor. Creates a new {@link VersionEntry}
* Default constructor. Creates a new {@link CPEEntry}
* with {@link ArcdConstants.ST_KIND_PROTECTED} visibility.
*/
public VersionEntry() {
public CPEEntry() {
super(ArcdConstants.ST_KIND_PROTECTED);
}
......
......@@ -3,7 +3,7 @@ package secarc.ets.entries;
import secarc.MontiSecArcConstants;
/**
* Creates Creates {@link TrustlevelEntry}s.
* Creates Creates {@link CPEEntry}s.
*
* <br>
* <br>
......@@ -13,15 +13,15 @@ import secarc.MontiSecArcConstants;
* @version $Date$<br>
* $Revision$
*/
public class VersionEntryFactory implements IVersionEntryFactory {
public class CPEEntryFactory implements ICPEEntryFactory {
/*
* (non-Javadoc)
* @see secarc.ets.entries.IVersionEntryFactory#createVersion()
* @see secarc.ets.entries.ICPEEntryFactory#createCPE()
*/
@Override
public VersionEntry createVersion() {
VersionEntry entry = new VersionEntry();
public CPEEntry createCPE() {
CPEEntry entry = new CPEEntry();
entry.setName(MontiSecArcConstants.VERSION_NAME);
return entry;
......
package secarc.ets.entries;
/**
* Creates Creates {@link VersionEntry}s.
* Creates Creates {@link CPEEntry}s.
*
* <br>
* <br>
......@@ -11,13 +11,13 @@ package secarc.ets.entries;
* @version $Date$<br>
* $Revision$
*/
public interface IVersionEntryFactory {
public interface ICPEEntryFactory {
/**
* Create a new {@link VersionEntry}
* Create a new {@link CPEEntry}
*
* @return a new {@link VersionEntry}
* @return a new {@link CPEEntry}
*/
VersionEntry createVersion();
CPEEntry createCPE();
}
......@@ -66,11 +66,11 @@ public class SecComponentEntry extends MAComponentEntry {
private PEPEntry pep;
/**
* Version for 3rd party component
* CPE for 3rd party component
*/
@Serialized
@EmbeddedEntry
private VersionEntry version;
private CPEEntry cpe;
/**
* Configuration for 3rd party component
......@@ -137,17 +137,17 @@ public class SecComponentEntry extends MAComponentEntry {
}
/**
* @param version Version for 3rd party component
* @param cpe for 3rd party component
*/
public void setVersion(VersionEntry version) {
this.version = version;
public void setCPE(CPEEntry cpe) {