Class MaintainService

java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.MaintainService
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class MaintainService extends ServiceConfig
Provides methods to insert/update/delete application data
Author:
Pablo GARCIA
  • Field Details

    • ERROR_MESSAGE_LAUNCHING_UNAUTHORIZED_MAINTAIN

      public static final String ERROR_MESSAGE_LAUNCHING_UNAUTHORIZED_MAINTAIN
      See Also:
  • Constructor Details

    • MaintainService

      public MaintainService(MaintainLauncher maintainLauncher, AccessService accessService, QueryUtil queryUtil, DatabaseConfigProperties databaseConfigProperties)
      Autowired constructor
      Parameters:
      maintainLauncher - Maintain launcher
      accessService - Access service
      queryUtil - Query utilities
      databaseConfigProperties - Database configuration properties
  • Method Details

    • launchMaintainAction

      public ServiceData launchMaintainAction() throws AWException
      Launch maintain action (from services)
      Returns:
      Service data
      Throws:
      AWException - AWE exception
    • getMaintainList

      public ServiceData getMaintainList(String search)
      Retrieve maintain list
      Parameters:
      search - Search text
      Returns:
      Maintain list
    • launchMaintain

      public ServiceData launchMaintain(String maintainId) throws AWException
      Launches a maintain
      Parameters:
      maintainId - Maintain identifier
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchMaintain

      public ServiceData launchMaintain(String maintainId, String alias) throws AWException
      Launches a maintain with an alias
      Parameters:
      maintainId - Maintain identifier
      alias - Connection alias
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchMaintain

      public ServiceData launchMaintain(String maintainId, com.fasterxml.jackson.databind.node.ObjectNode parameters) throws AWException
      Launches one maintain with parameters
      Parameters:
      maintainId - Maintain identifier
      parameters - Launch parameters
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchMaintain

      public ServiceData launchMaintain(String maintainId, DatabaseConnection databaseConnection, boolean keepAliveConnection) throws AWException
      Launches one maintain with a connection
      Parameters:
      maintainId - Maintain identifier
      databaseConnection - Database connection
      keepAliveConnection - Keep alive connection (for treatments)
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchMaintain

      public ServiceData launchMaintain(String maintainId, com.fasterxml.jackson.databind.node.ObjectNode parameters, DatabaseConnection databaseConnection, boolean keepAliveConnection) throws AWException
      Launches one maintain with a connection
      Parameters:
      maintainId - Maintain identifier
      databaseConnection - Database connection
      keepAliveConnection - Keep alive connection (for treatments)
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchPrivateMaintain

      public ServiceData launchPrivateMaintain(String maintainId) throws AWException
      Launches a maintain
      Parameters:
      maintainId - Maintain identifier
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchPrivateMaintain

      public ServiceData launchPrivateMaintain(String maintainId, String alias) throws AWException
      Launches a maintain with an alias
      Parameters:
      maintainId - Maintain identifier
      alias - Connection alias
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchPrivateMaintain

      public ServiceData launchPrivateMaintain(String maintainId, com.fasterxml.jackson.databind.node.ObjectNode parameters) throws AWException
      Launches one maintain with parameters
      Parameters:
      maintainId - Maintain identifier
      parameters - Launch parameters
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchPrivateMaintain

      public ServiceData launchPrivateMaintain(String maintainId, DatabaseConnection databaseConnection, boolean keepAliveConnection) throws AWException
      Launches one maintain with a connection without checking session
      Parameters:
      maintainId - Maintain identifier
      databaseConnection - Database connection
      keepAliveConnection - Keep alive connection (for treatments)
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • launchPrivateMaintain

      public ServiceData launchPrivateMaintain(String maintainId, com.fasterxml.jackson.databind.node.ObjectNode parameters, DatabaseConnection databaseConnection, boolean keepAliveConnection) throws AWException
      Launches one maintain with a connection without checking session
      Parameters:
      maintainId - Maintain identifier
      parameters - Parameters
      databaseConnection - Database connection
      keepAliveConnection - Keep alive connection (for treatments)
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • getDatabaseConnection

      public DatabaseConnection getDatabaseConnection(com.fasterxml.jackson.databind.node.ObjectNode parameters) throws AWException
      Retrieve database connection from parameters
      Parameters:
      parameters - Parameters
      Returns:
      Database connection
      Throws:
      AWException - Error retrieving database connection
    • getDatabaseConnection

      public DatabaseConnection getDatabaseConnection() throws AWException
      Retrieve database connection
      Returns:
      Database connection
      Throws:
      AWException - Error retrieving database connection
    • getDatabaseConnection

      public DatabaseConnection getDatabaseConnection(String alias) throws AWException
      Get database connection
      Parameters:
      alias - Alias
      Returns:
      Database connection
      Throws:
      AWException - AWE exception
    • getDatabaseConnection

      public DatabaseConnection getDatabaseConnection(DataSource dataSource) throws AWException
      Get database connection
      Parameters:
      dataSource - Datasource
      Returns:
      Database connection
      Throws:
      AWException - AWE exception
    • launchMaintain

      public ServiceData launchMaintain(Target maintainTarget, com.fasterxml.jackson.databind.node.ObjectNode parameters, DatabaseConnection databaseConnection, boolean keepAliveConnection) throws AWException
      Launches a maintain
      Parameters:
      maintainTarget - Maintain target
      databaseConnection - Database connection
      keepAliveConnection - Keep alive connection (for treatments)
      Returns:
      Service output
      Throws:
      AWException - Error launching maintain
    • getNextSequenceValue

      public Integer getNextSequenceValue(String sequence) throws AWException
      Retrieve next sequence value (and increase sequence)
      Parameters:
      sequence - Sequence identifier
      Returns:
      Sequence value
      Throws:
      AWException - Error retrieving next sequence value
    • getNextSequenceValue

      public Integer getNextSequenceValue(String sequence, String databaseAlias) throws AWException
      Retrieve next sequence value (and increase sequence)
      Parameters:
      sequence - Sequence identifier
      databaseAlias - Database alias
      Returns:
      Sequence value
      Throws:
      AWException - Error retrieving next sequence value
    • getNextSequenceValue

      public Integer getNextSequenceValue(String sequence, DatabaseConnection databaseConnection) throws AWException
      Retrieve next sequence value (and increase sequence)
      Parameters:
      sequence - Sequence identifier
      databaseConnection - Database alias
      Returns:
      Sequence value
      Throws:
      AWException - Error retrieving next sequence value
    • doRollback

      public void doRollback(DatabaseConnection databaseConnection, String statementList, boolean manageConnection) throws AWException
      Do maintain rollback
      Parameters:
      databaseConnection - Database connection
      statementList - Statement list
      manageConnection - Manage connection
      Throws:
      AWException - Error doing rollback
    • doCommit

      public void doCommit(DatabaseConnection databaseConnection, String statementList, boolean manageConnection) throws AWException
      Do maintain rollback
      Parameters:
      databaseConnection - Database connection
      statementList - Statement list
      manageConnection - Manage connection
      Throws:
      AWException - Error doing rollback