public void toString(ToStringBuilder toStringBuilder) { { List<Artifact> theArtifact; theArtifact = this.getArtifact(); toStringBuilder.append("artifact", theArtifact); } }
public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getArtifact()); }
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof Artifacts)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final Artifacts that = ((Artifacts) object); equalsBuilder.append(this.getArtifact(), that.getArtifact()); }
/** * orphan artifacts are those that are in the graph but are never used neither generated. this * indicates some problem with the graph structure. this method is used for diagnostics after import has finished * @return */ public List<String> getOrphanArtifacts() { List<String> allwgb = new ArrayList<String>(); List<String> allUsed = new ArrayList<String>(); List<String> orphans = new ArrayList<String>(); if (graph == null) { logger.warn("null graph while attempting to count orphan artifacts -- giving up"); return orphans; } Artifacts allArtifacts = graph.getArtifacts(); for ( Map.Entry<String, Map<String,List<String>>>entry: wgbArtifactsByAccount.entrySet()) { allwgb.addAll(entry.getValue().keySet()); } for ( Map.Entry<String, Map<String,List<String>>>entry: usedArtifactsByAccount.entrySet()) { allUsed.addAll(entry.getValue().keySet()); } List<Artifact> artifacts = allArtifacts.getArtifact(); for (Artifact a:artifacts) { if (!allwgb.contains(a.getId()) && !allUsed.contains(a.getId())) { orphans.add(a.getId()); } } return orphans; }
public Artifact addArtifact(String name, Artifact artifact) { Artifact existing=artifactMap.get(name); if (existing!=null) { return existing; } else { artifactMap.put(name,artifact); Artifacts artifacts=getArtifacts(); if (artifacts==null) { artifacts=of.createArtifacts(); setArtifacts(artifacts); } artifacts.getArtifact().add(artifact); return artifact; } }
public List<Node> getNodes(OPMGraph g) { List<Node> res=new LinkedList(); res.addAll(g.getArtifacts().getArtifact()); res.addAll(g.getProcesses().getProcess()); res.addAll(g.getAgents().getAgent()); return res; }
for (Artifact a: gr.getArtifacts().getArtifact()) { as.add(register(a.getId(),newArtifact(a)));
aas.getArtifact().addAll(as); res.setArtifacts(aas);
void populateGraph(OPMGraph graph) { Set<String> artifactUris=artifactTable.keySet(); for (String uri: artifactUris) { graph.getArtifacts().getArtifact().add(artifactTable.get(uri));
for (Artifact a: graph.getArtifacts().getArtifact()) { Resource res=Resource.uriRef(urify(a.getId())); ProvenanceArtifact rdfArtifact;
public void noAnnotation(OPMGraph graph) { graph.setAnnotations(null); destroy(graph.getAnnotation()); if (graph.getProcesses()!=null && graph.getProcesses().getProcess()!=null) { for (Process p: graph.getProcesses().getProcess()) { destroy(p.getAnnotation()); } } if (graph.getArtifacts()!=null && graph.getArtifacts().getArtifact()!=null) { for (Artifact a: graph.getArtifacts().getArtifact()) { destroy(a.getAnnotation()); } } if (graph.getAgents()!=null && graph.getAgents().getAgent()!=null) { for (Agent a: graph.getAgents().getAgent()) { destroy(a.getAnnotation()); } } for (Object e: graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()) { destroy(((Edge)e).getAnnotation()); } }
for (Artifact a: graph.getArtifacts().getArtifact()) { Resource res=Resource.uriRef(urify(a.getId())); ProvenanceArtifact rdfArtifact;
Set<String> artifactUris=artifactTable.keySet(); for (String uri: artifactUris) { graph.getArtifacts().getArtifact().add(artifactTable.get(uri));
public void convert(OPMGraph graph, PrintStream out) { List<Edge> edges=u.getEdges(graph); prelude(out); if (graph.getProcesses()!=null) { for (Process p: graph.getProcesses().getProcess()) { emitProcess(p,out); } } if (graph.getArtifacts()!=null) { for (Artifact p: graph.getArtifacts().getArtifact()) { emitArtifact(p,out); } } if (graph.getAgents()!=null) { for (Agent p: graph.getAgents().getAgent()) { emitAgent(p,out); } } for (Edge e: edges) { emitDependency(e,out); } postlude(out); }
if (graph.getArtifacts()!=null && graph.getArtifacts().getArtifact()!=null) { for (Artifact a: graph.getArtifacts().getArtifact()) { List<AccountRef> accRefs=a.getAccount();
public void sortGraph(OPMGraph graph) { graph.setAnnotations(oFactory.getObjectFactory().createAnnotations()); sortById((List)graph.getAccounts().getAccount()); if (graph.getProcesses()!=null && graph.getProcesses().getProcess()!=null) { sortById((List)graph.getProcesses().getProcess()); for (Process p: graph.getProcesses().getProcess()) { sortAnnotations(p.getAnnotation()); sortByRef(p.getAccount()); } } if (graph.getArtifacts()!=null && graph.getArtifacts().getArtifact()!=null) { sortById((List)graph.getArtifacts().getArtifact()); for (Artifact a: graph.getArtifacts().getArtifact()) { sortAnnotations(a.getAnnotation()); sortByRef(a.getAccount()); } } if (graph.getAgents()!=null && graph.getAgents().getAgent()!=null) { sortById((List)graph.getAgents().getAgent()); for (Agent a: graph.getAgents().getAgent()) { sortAnnotations(a.getAnnotation()); sortByRef(a.getAccount()); } } for (Object e: graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()) { sortAnnotations(((Edge)e).getAnnotation()); sortByRef(((Edge)e).getAccount()); } sortEdges(graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()); }
for (Artifact acc: graph.getArtifacts().getArtifact()) { addArtifact(acc);