java.lang.Object
com.atlassian.confluence.impl.space.deletion.backgrounddeletion.erasers.SpaceEraser
All Implemented Interfaces:
EntityEraser

public class SpaceEraser extends Object implements EntityEraser
Removes records from the space table and all dependant tables. The space eraser works similar way to the generic eraser, however, it should perform additional actions (for example, clearing circular links to the space description and home page). Therefore, it will use generic eraser delegate to remove space object and its dependant. All additional logic will be done by this SpaceEraser class. TODO work in progress
Since:
9.1.0
  • Field Details

  • Constructor Details

  • Method Details

    • deleteSpaceAndAllDependantEntities

      public DeletionResult deleteSpaceAndAllDependantEntities(long spaceId, Map<String,Object> currentJobState)
      It removes data of a space. This method is entry point for space deletion.
      Parameters:
      spaceId - space id
      currentJobState - the state of the job that is persisted between runs
      Returns:
      new state which will be stored in the background task
    • getEntityClass

      public Class<?> getEntityClass()
      Description copied from interface: EntityEraser
      Get the class name of the Hibernate entity, for example, Label.class, Space.class etc. Pages, blogpost etc use just one class, ConfluenceEntityObject.
      Specified by:
      getEntityClass in interface EntityEraser
      Returns:
      hibernate entity class.
    • deleteDataRecursively

      public DeletionResult deleteDataRecursively(String columnName, Collection<Long> ids)
      Description copied from interface: EntityEraser
      Deletes records in the table where ids in columnName are in ids list. Before this, it will call other erasers to remove their dependent data. For example, for space permissions, columnName will be SPACEID and ids will contain the list of space ids. In this case, this method will remove all space permissions where SPACEID in (ids)
      Specified by:
      deleteDataRecursively in interface EntityEraser
      Parameters:
      columnName - column name (referencing to some other parent entity)
      ids - ids for removal (parent ids actually)
      Returns:
      deletion result (number of deleted objects and finished/not finished state)