forked from viatra/org.eclipse.viatra.examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CPS] updated generated code with copyright and other refinements
- Loading branch information
1 parent
b32e148
commit 6c0de74
Showing
35 changed files
with
1,407 additions
and
32 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
...eclipse/viatra/examples/cps/model/validation/AvailableGreaterThanTotalCpuConstraint0.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
91 changes: 91 additions & 0 deletions
91
...eclipse/viatra/examples/cps/model/validation/AvailableGreaterThanTotalHddConstraint0.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
91 changes: 91 additions & 0 deletions
91
...eclipse/viatra/examples/cps/model/validation/AvailableGreaterThanTotalRamConstraint0.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
91 changes: 91 additions & 0 deletions
91
...on/src-gen/org/eclipse/viatra/examples/cps/model/validation/IdIsNotUniqueConstraint0.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
Oops, something went wrong.