Interface TaskanaEngine

  • All Known Implementing Classes:
    TaskanaEngineImpl

    public interface TaskanaEngine
    The TaskanaEngine represents an overall set of all needed services.
    • Method Detail

      • getTaskService

        TaskService getTaskService()
        The TaskService can be used for operations on all Tasks.
        Returns:
        the TaskService
      • getMonitorService

        MonitorService getMonitorService()
        The MonitorService can be used for monitoring Tasks.
        Returns:
        the MonitorService
      • getWorkbasketService

        WorkbasketService getWorkbasketService()
        The WorkbasketService can be used for operations on all Workbaskets.
        Returns:
        the WorbasketService
      • getClassificationService

        ClassificationService getClassificationService()
        The ClassificationService can be used for operations on all Categories.
        Returns:
        the ClassificationService
      • getJobService

        JobService getJobService()
        The JobService can be user for all job operations.
        Returns:
        the JobService
      • getWorkingDaysToDaysConverter

        WorkingDaysToDaysConverter getWorkingDaysToDaysConverter()
        The WorkingDaysToDaysConverter used to compute holidays.
        Returns:
        the converter
      • isHistoryEnabled

        boolean isHistoryEnabled()
        Checks if the history plugin is enabled.
        Returns:
        true if the history is enabled. Otherwise false.
      • getConnectionManagementMode

        TaskanaEngine.ConnectionManagementMode getConnectionManagementMode()
        gets the current connection management mode.
        Returns:
        the current connection management mode.
      • setConnectionManagementMode

        void setConnectionManagementMode​(TaskanaEngine.ConnectionManagementMode mode)
        sets the connection management mode.
        Parameters:
        mode - the connection management mode Valid values are:
        • PARTICIPATE - taskana participates in global transaction. This is the default mode.
        • AUTOCOMMIT - taskana commits each API call separately
        • EXPLICIT - commit processing is managed explicitly by the client
      • setConnection

        void setConnection​(Connection connection)
                    throws SQLException
        Set the connection to be used by TASKANA in mode TaskanaEngine.ConnectionManagementMode.EXPLICIT. If this Api is called, taskana uses the connection passed by the client for all subsequent API calls until the client resets this connection. Control over commit and rollback of the connection is the responsibility of the client. In order to close the connection, closeConnection() or setConnection(null) has to be called.
        Parameters:
        connection - - The java.sql.Connection that is controlled by the client
        Throws:
        SQLException - if a database access error occurs
      • closeConnection

        void closeConnection()
        Closes the client's connection, sets it to null and switches to mode PARTICIPATE. Only applicable in mode EXPLICIT. Has the same effect as setConnection(null).
      • isUserInRole

        boolean isUserInRole​(TaskanaRole... roles)
        check whether the current user is member of one of the roles specified.
        Parameters:
        roles - The roles that are checked for membership of the current user
        Returns:
        true if the current user is a member of at least one of the specified groups
      • checkRoleMembership

        void checkRoleMembership​(TaskanaRole... roles)
                          throws NotAuthorizedException
        Checks whether current user is member of any of the specified roles.
        Parameters:
        roles - The roles that are checked for membership of the current user
        Throws:
        NotAuthorizedException - If the current user is not member of any specified role
      • runAsAdmin

        <T> T runAsAdmin​(Supplier<T> supplier)
        Executes a given supplier with admin privileges and thus skips further permission checks. With great power comes great responsibility.
        Type Parameters:
        T - defined with the supplier return value
        Parameters:
        supplier - will be executed with admin privileges
        Returns:
        output from supplier
      • runAsAdmin

        default void runAsAdmin​(Runnable runnable)
        Executes a given runnable with admin privileges and thus skips further permission checks. With great power comes great responsibility.
        See Also:
        runAsAdmin(Supplier)
      • getCurrentUserContext

        pro.taskana.common.api.security.CurrentUserContext getCurrentUserContext()
        Returns the CurrentUserContext class.
        Returns:
        the CurrentUserContext