-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from PalladioSimulator/teammates_rules
Add supporting structure for Teammates project-specific rules
- Loading branch information
Showing
7 changed files
with
269 additions
and
26 deletions.
There are no files selected for viewing
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
69 changes: 69 additions & 0 deletions
69
...rers/src/org/palladiosimulator/retriever/extraction/discoverers/DockerfileDiscoverer.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,69 @@ | ||
package org.palladiosimulator.retriever.extraction.discoverers; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
|
||
import org.eclipse.core.runtime.IProgressMonitor; | ||
import org.eclipse.emf.common.CommonPlugin; | ||
import org.palladiosimulator.retriever.services.Discoverer; | ||
import org.palladiosimulator.retriever.services.RetrieverConfiguration; | ||
import org.palladiosimulator.retriever.services.blackboard.RetrieverBlackboard; | ||
|
||
import de.uka.ipd.sdq.workflow.jobs.AbstractBlackboardInteractingJob; | ||
import de.uka.ipd.sdq.workflow.jobs.CleanupFailedException; | ||
import de.uka.ipd.sdq.workflow.jobs.IBlackboardInteractingJob; | ||
import de.uka.ipd.sdq.workflow.jobs.JobFailedException; | ||
import de.uka.ipd.sdq.workflow.jobs.UserCanceledException; | ||
|
||
public class DockerfileDiscoverer implements Discoverer { | ||
|
||
private static final String DISCOVERER_ID = "org.palladiosimulator.retriever.extraction.discoverers.docker"; | ||
|
||
@Override | ||
public IBlackboardInteractingJob<RetrieverBlackboard> create(final RetrieverConfiguration configuration, | ||
final RetrieverBlackboard blackboard) { | ||
return new AbstractBlackboardInteractingJob<>() { | ||
|
||
@Override | ||
public void cleanup(final IProgressMonitor monitor) throws CleanupFailedException { | ||
} | ||
|
||
@Override | ||
public void execute(final IProgressMonitor monitor) throws JobFailedException, UserCanceledException { | ||
final Path root = Paths.get(CommonPlugin.asLocalURI(configuration.getInputFolder()) | ||
.devicePath()); | ||
this.setBlackboard(Objects.requireNonNull(blackboard)); | ||
final Map<Path, Object> dockerfiles = new HashMap<>(); | ||
Discoverer.find(root, "Dockerfile", this.logger) | ||
.forEach(p -> dockerfiles.put(p, null)); | ||
this.getBlackboard() | ||
.putDiscoveredFiles(DISCOVERER_ID, dockerfiles); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "Dockerfile Discoverer Job"; | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public Set<String> getConfigurationKeys() { | ||
return Collections.emptySet(); | ||
} | ||
|
||
@Override | ||
public String getID() { | ||
return DISCOVERER_ID; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "Dockerfile Discoverer"; | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.