Skip to content

Commit

Permalink
[CPS] updated generated code with copyright and other refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
abelhegedus committed Jun 6, 2016
1 parent b32e148 commit 6c0de74
Show file tree
Hide file tree
Showing 35 changed files with 1,407 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**
Copyright (c) 2014, 2016 IncQuery Labs Ltd.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Akos Horvath, Abel Hegedus, Akos Menyhert, Zoltan Ujhelyi - initial API and implementation
*/
package org.eclipse.viatra.examples.cps.model.validation;

import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import org.eclipse.viatra.addon.validation.core.api.Severity;
import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification;
import org.eclipse.viatra.query.runtime.api.IPatternMatch;
import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;

import org.eclipse.viatra.examples.cps.model.validation.util.AvailableGreaterThanTotalCpuQuerySpecification;

public class AvailableGreaterThanTotalCpuConstraint0 implements IConstraintSpecification {

private AvailableGreaterThanTotalCpuQuerySpecification querySpecification;

public AvailableGreaterThanTotalCpuConstraint0() throws ViatraQueryException {
querySpecification = AvailableGreaterThanTotalCpuQuerySpecification.instance();
}

@Override
public String getMessageFormat() {
return "The available CPU ($host.availableCpu$) of $host.identifier$ is greater than the total ($host.totalCpu$)";
}


@Override
public Map<String,Object> getKeyObjects(IPatternMatch signature) {
Map<String,Object> map = ImmutableMap.of(
"host",signature.get("host")
);
return map;
}

@Override
public List<String> getKeyNames() {
List<String> keyNames = ImmutableList.of(
"host"
);
return keyNames;
}

@Override
public List<String> getPropertyNames() {
List<String> propertyNames = ImmutableList.of(
);
return propertyNames;
}

@Override
public Set<List<String>> getSymmetricPropertyNames() {
Set<List<String>> symmetricPropertyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricPropertyNamesSet;
}

@Override
public Set<List<String>> getSymmetricKeyNames() {
Set<List<String>> symmetricKeyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricKeyNamesSet;
}

@Override
public Severity getSeverity() {
return Severity.ERROR;
}

@Override
public IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> getQuerySpecification() {
return querySpecification;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**
Copyright (c) 2014, 2016 IncQuery Labs Ltd.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Akos Horvath, Abel Hegedus, Akos Menyhert, Zoltan Ujhelyi - initial API and implementation
*/
package org.eclipse.viatra.examples.cps.model.validation;

import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import org.eclipse.viatra.addon.validation.core.api.Severity;
import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification;
import org.eclipse.viatra.query.runtime.api.IPatternMatch;
import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;

import org.eclipse.viatra.examples.cps.model.validation.util.AvailableGreaterThanTotalHddQuerySpecification;

public class AvailableGreaterThanTotalHddConstraint0 implements IConstraintSpecification {

private AvailableGreaterThanTotalHddQuerySpecification querySpecification;

public AvailableGreaterThanTotalHddConstraint0() throws ViatraQueryException {
querySpecification = AvailableGreaterThanTotalHddQuerySpecification.instance();
}

@Override
public String getMessageFormat() {
return "The available HDD ($host.availableHdd$) of $host.identifier$ is greater than the total ($host.totalHdd$)";
}


@Override
public Map<String,Object> getKeyObjects(IPatternMatch signature) {
Map<String,Object> map = ImmutableMap.of(
"host",signature.get("host")
);
return map;
}

@Override
public List<String> getKeyNames() {
List<String> keyNames = ImmutableList.of(
"host"
);
return keyNames;
}

@Override
public List<String> getPropertyNames() {
List<String> propertyNames = ImmutableList.of(
);
return propertyNames;
}

@Override
public Set<List<String>> getSymmetricPropertyNames() {
Set<List<String>> symmetricPropertyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricPropertyNamesSet;
}

@Override
public Set<List<String>> getSymmetricKeyNames() {
Set<List<String>> symmetricKeyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricKeyNamesSet;
}

@Override
public Severity getSeverity() {
return Severity.ERROR;
}

@Override
public IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> getQuerySpecification() {
return querySpecification;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**
Copyright (c) 2014, 2016 IncQuery Labs Ltd.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Akos Horvath, Abel Hegedus, Akos Menyhert, Zoltan Ujhelyi - initial API and implementation
*/
package org.eclipse.viatra.examples.cps.model.validation;

import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import org.eclipse.viatra.addon.validation.core.api.Severity;
import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification;
import org.eclipse.viatra.query.runtime.api.IPatternMatch;
import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;

import org.eclipse.viatra.examples.cps.model.validation.util.AvailableGreaterThanTotalRamQuerySpecification;

public class AvailableGreaterThanTotalRamConstraint0 implements IConstraintSpecification {

private AvailableGreaterThanTotalRamQuerySpecification querySpecification;

public AvailableGreaterThanTotalRamConstraint0() throws ViatraQueryException {
querySpecification = AvailableGreaterThanTotalRamQuerySpecification.instance();
}

@Override
public String getMessageFormat() {
return "The available RAM ($host.availableRam$) of $host.identifier$ is greater than the total ($host.totalRam$)";
}


@Override
public Map<String,Object> getKeyObjects(IPatternMatch signature) {
Map<String,Object> map = ImmutableMap.of(
"host",signature.get("host")
);
return map;
}

@Override
public List<String> getKeyNames() {
List<String> keyNames = ImmutableList.of(
"host"
);
return keyNames;
}

@Override
public List<String> getPropertyNames() {
List<String> propertyNames = ImmutableList.of(
);
return propertyNames;
}

@Override
public Set<List<String>> getSymmetricPropertyNames() {
Set<List<String>> symmetricPropertyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricPropertyNamesSet;
}

@Override
public Set<List<String>> getSymmetricKeyNames() {
Set<List<String>> symmetricKeyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricKeyNamesSet;
}

@Override
public Severity getSeverity() {
return Severity.ERROR;
}

@Override
public IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> getQuerySpecification() {
return querySpecification;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**
Copyright (c) 2014, 2016 IncQuery Labs Ltd.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Akos Horvath, Abel Hegedus, Akos Menyhert, Zoltan Ujhelyi - initial API and implementation
*/
package org.eclipse.viatra.examples.cps.model.validation;

import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import org.eclipse.viatra.addon.validation.core.api.Severity;
import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification;
import org.eclipse.viatra.query.runtime.api.IPatternMatch;
import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;

import org.eclipse.viatra.examples.cps.model.validation.util.IdIsNotUniqueQuerySpecification;

public class IdIsNotUniqueConstraint0 implements IConstraintSpecification {

private IdIsNotUniqueQuerySpecification querySpecification;

public IdIsNotUniqueConstraint0() throws ViatraQueryException {
querySpecification = IdIsNotUniqueQuerySpecification.instance();
}

@Override
public String getMessageFormat() {
return "The ID of $identifiable.identifier$ is not unique";
}


@Override
public Map<String,Object> getKeyObjects(IPatternMatch signature) {
Map<String,Object> map = ImmutableMap.of(
"identifiable",signature.get("identifiable")
);
return map;
}

@Override
public List<String> getKeyNames() {
List<String> keyNames = ImmutableList.of(
"identifiable"
);
return keyNames;
}

@Override
public List<String> getPropertyNames() {
List<String> propertyNames = ImmutableList.of(
);
return propertyNames;
}

@Override
public Set<List<String>> getSymmetricPropertyNames() {
Set<List<String>> symmetricPropertyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricPropertyNamesSet;
}

@Override
public Set<List<String>> getSymmetricKeyNames() {
Set<List<String>> symmetricKeyNamesSet = ImmutableSet.<List<String>>of(
);
return symmetricKeyNamesSet;
}

@Override
public Severity getSeverity() {
return Severity.ERROR;
}

@Override
public IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> getQuerySpecification() {
return querySpecification;
}

}
Loading

0 comments on commit 6c0de74

Please sign in to comment.