All Downloads are FREE. Search and download functionalities are using the official Maven repository.

as.leap.code.LASClassManagerHook Maven / Gradle / Ivy

The newest version!
package as.leap.code;


import as.leap.las.sdk.DeleteMsg;
import as.leap.las.sdk.SaveMsg;
import as.leap.las.sdk.UpdateMsg;

/**
 * The hooks for some db operation.
 */
public interface LASClassManagerHook {

  /**
   * hook before save
   *
   * @param entity operator object
   * @return BeforeResult result of before create entity
   */
  BeforeResult beforeCreate(T entity);

  /**
   * hook after save
   *
   * @param beforeResult result of before create entity
   * @param saveMessage result of create entity
   * @return AfterResult result of after create entity
   */
  AfterResult afterCreate(BeforeResult beforeResult, SaveMsg saveMessage);

  /**
   * hook before delete
   *
   * @param objectId entity object id
   * @return BeforeResult result of before delete entity
   */
  BeforeResult beforeDelete(String objectId);

  /**
   * hook before delete
   *
   * @param objectIds collection of entity objects id
   * @return BeforeResult result of before delete some of entity object by id
   */
  BeforeResult beforeDelete(String[] objectIds);

  /**
   * hook after delete
   * @param beforeResult result of before delete entity
   * @param deleteMessage result of delete entity
   * @return result of after delete entity
   */
  AfterResult afterDelete(BeforeResult beforeResult, DeleteMsg deleteMessage);

  /**
   * do something after completed update operation.
   * @param objectId object id of entity
   * @param updateMessage result of update entity
   * @return result of after delete entity
   */
  AfterResult afterUpdate(String objectId, UpdateMsg updateMessage);


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy