use of org.iobserve.model.privacy.EDataProtectionLevel in project iobserve-analysis by research-iobserve.
the class ReturnTypeDataProtectionImpl method setLevel.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLevel(EDataProtectionLevel newLevel) {
EDataProtectionLevel oldLevel = level;
level = newLevel == null ? LEVEL_EDEFAULT : newLevel;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PrivacyPackage.RETURN_TYPE_DATA_PROTECTION__LEVEL, oldLevel, level));
}
use of org.iobserve.model.privacy.EDataProtectionLevel in project iobserve-analysis by research-iobserve.
the class DataProtectionWarner method computePrivacyLevelsAndAddEdge.
private void computePrivacyLevelsAndAddEdge(final PrivacyGraph graph, final OperationInterface operationInterface, final RepositoryComponent providingComponent, final RepositoryComponent requiringComponent) throws InvocationException, DBException {
for (final OperationSignature operationSignature : operationInterface.getSignatures__OperationInterface()) {
final IDataProtectionAnnotation operationSignaturePrivacyAnnotation = this.returntypeprivacy.get(operationSignature.getId());
EDataProtectionLevel inEdgeDataProtectionLevel = null;
EDataProtectionLevel outEdgePrivacyLevel = null;
/**
* Check parameter.
*/
for (final Parameter proxyParameter : operationSignature.getParameters__OperationSignature()) {
final Parameter parameter = this.repositoryResource.resolve(proxyParameter);
final ParameterModifier mod = parameter.getModifier__Parameter();
if (mod == ParameterModifier.IN || mod == ParameterModifier.INOUT) {
final String parameterName = parameter.getParameterName();
outEdgePrivacyLevel = this.updateDataProtectionLevel(outEdgePrivacyLevel, this.parameterprivacy.get(parameterName).getLevel());
}
if (mod == ParameterModifier.OUT || mod == ParameterModifier.INOUT) {
inEdgeDataProtectionLevel = this.updateDataProtectionLevel(inEdgeDataProtectionLevel, this.parameterprivacy.get(parameter.getParameterName()).getLevel());
}
}
/**
* Check return type.
*/
if (operationSignaturePrivacyAnnotation != null) {
inEdgeDataProtectionLevel = this.updateDataProtectionLevel(inEdgeDataProtectionLevel, operationSignaturePrivacyAnnotation.getLevel());
}
final Vertex providingComponentVertex = this.vertices.get(providingComponent.getId());
final Vertex requiringComponentVertex = this.vertices.get(requiringComponent.getId());
if (providingComponentVertex != null && requiringComponentVertex != null) {
// Add Edges
if (inEdgeDataProtectionLevel != null) {
final Edge edge = new Edge(providingComponentVertex, requiringComponentVertex);
edge.setDPC(Policy.getDataClassification(inEdgeDataProtectionLevel));
edge.setOperationSignature(operationSignature);
graph.addEdge(edge);
}
if (outEdgePrivacyLevel != null) {
final Edge edge = new Edge(requiringComponentVertex, providingComponentVertex);
edge.setDPC(Policy.getDataClassification(outEdgePrivacyLevel));
edge.setOperationSignature(operationSignature);
graph.addEdge(edge);
}
if (inEdgeDataProtectionLevel == null && outEdgePrivacyLevel == null) {
this.logger.error("Missing privacy level");
}
}
}
}
use of org.iobserve.model.privacy.EDataProtectionLevel in project iobserve-analysis by research-iobserve.
the class ParameterDataProtectionImpl method setLevel.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLevel(EDataProtectionLevel newLevel) {
EDataProtectionLevel oldLevel = level;
level = newLevel == null ? LEVEL_EDEFAULT : newLevel;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PrivacyPackage.PARAMETER_DATA_PROTECTION__LEVEL, oldLevel, level));
}
Aggregations