BrightSide Workbench Full Report + Source Code
org.turro.cleanup.IssueCleanup Class Reference
Inheritance diagram for org.turro.cleanup.IssueCleanup:
Collaboration diagram for org.turro.cleanup.IssueCleanup:

Public Member Functions

boolean isMine (Object entity)
 
void cleanEntity (Object entity, CleanupMode mode)
 
void cleanOrphans ()
 
- Public Member Functions inherited from org.turro.cleanup.AbstractCleanup
void setConsole (ICleanupConsole console)
 
void cleanFromCommons (String entityPath, CleanupMode mode, Set< Commons > commons)
 
Set< String > pathsForRoot (String root, Commons common)
 

Additional Inherited Members

- Protected Member Functions inherited from org.turro.cleanup.AbstractCleanup
ICleanupConsole getConsole ()
 
Set< String > getOrphans (Set< String > entities, Set< String > mapped)
 
void cleanOrphansFor (String root, Set< String > entities)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 33 of file IssueCleanup.java.

Member Function Documentation

◆ cleanEntity()

void org.turro.cleanup.IssueCleanup.cleanEntity ( Object  entity,
CleanupMode  mode 
)

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 41 of file IssueCleanup.java.

41  {
42  if(entity instanceof Issue issue) {
43  String entityPath = DossierPU.getObjectPath(issue);
44  Dao dao = new DossierPU();
45  getConsole().addMessage(issue.getDescription());
46  Cleanup.executeForCommons(entityPath, getConsole(), mode, Set.of(Commons.values()));
47  CleanupAction.from("Cleaning duplicates...",
48  () -> cleanupDuplicates(dao, issue))
49  .execute(getConsole(), mode);
50  CleanupAction.from("Removing DW...",
51  () -> DatawarehouseUtil.remove(dao, issue))
52  .execute(getConsole(), mode);
53  CleanupAction.from("Deleting entity...",
54  () -> dao.deleteObject(issue))
55  .execute(getConsole(), mode);
56  }
57  }
void addMessage(String message)
Here is the call graph for this function:

◆ cleanOrphans()

void org.turro.cleanup.IssueCleanup.cleanOrphans ( )

Reimplemented from org.turro.cleanup.AbstractCleanup.

Definition at line 60 of file IssueCleanup.java.

60  {
61  Dao dao = new DossierPU();
62  SqlClause.delete("IssueParticipant")
63  .where().append("issue").isNull()
64  .dao(dao)
65  .execute();
66  cleanOrphansFor("issue", getEntityPaths(dao, Long.class, "Issue", "id", "issue"));
67  }
void cleanOrphansFor(String root, Set< String > entities)
Here is the call graph for this function:

◆ isMine()

boolean org.turro.cleanup.IssueCleanup.isMine ( Object  entity)

Implements org.turro.cleanup.IElephantCleanup.

Definition at line 36 of file IssueCleanup.java.

36  {
37  return entity instanceof Issue;
38  }

The documentation for this class was generated from the following file: