Interface IInfobaseSynchronizationManager

  • All Superinterfaces:
    IManagedService

    public interface IInfobaseSynchronizationManager
    extends IManagedService
    Manages synchronizations between projects and associated infobases. The manager listens workspace BM models changes and infobase associations changes. Manager allows to update associated or not associated infobases by the EDT projects content.
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Method Detail

      • updateAllInfobases

        Map<InfobaseReference,​Boolean> updateAllInfobases​(org.eclipse.core.resources.IProject project,
                                                                IInfobaseUpdateCallback updateCallback,
                                                                org.eclipse.core.runtime.IProgressMonitor monitor)
                                                         throws InfobaseSynchronizationException
        Synchronizes the provided project with all connected infobases. All previously changed objects will be loaded to infobases and infobase databases will be updated. Infobase update callback may be called for each updating infobase. Returns a map whether connected infobases successfully updated and synchronized with the project.
        Parameters:
        project - the project to synchronize with connected infobases, cannot be null
        updateCallback - the callback executed when database structure changes or update conflict are received, cannot be null; callback may not be executed if there is matching conditions
        monitor - the progress monitor to report progress to, cannot be null
        Returns:
        a map whether connected infobases successfully updated and synchronized with the project, never null
        Throws:
        InfobaseSynchronizationException - if the infobase update process failed
      • updateInfobase

        boolean updateInfobase​(org.eclipse.core.resources.IProject project,
                               InfobaseReference infobase,
                               IInfobaseUpdateCallback updateCallback,
                               boolean keepConnected,
                               org.eclipse.core.runtime.IProgressMonitor monitor)
                        throws InfobaseSynchronizationException
        Synchronizes the provided project with the provided infobase. All previously changed objects will be loaded to the provided infobase and infobase database will be updated. Method can be executed even if the project was not connected with any infobases, then full load of project configuration will be performed. Returns whether infobase configuration was successfully updated and synchronized with the project.

        Flag keepConnected defines whether need to keep the provided project connected with the provided infobase after synchronization, if they were not connected yet (based on default or saved synchronization strategy and infobase connection type).

        Parameters:
        project - the project to synchronize with the provided infobase, cannot be null
        infobase - the infobase to synchronize with the provided project, cannot be null
        updateCallback - the callback executed when database structure changes or update conflict are received, cannot be null; callback may not be executed if there is matching conditions
        keepConnected - whether need to keep connection of the provided project with the provided infobase and start synchronization, if not connected yet
        monitor - the progress monitor to report progress to, cannot be null
        Returns:
        whether infobase configuration was successfully updated and synchronized with the project
        Throws:
        InfobaseSynchronizationException - if the infobase update process failed
        UnsupportedVersionException - if the provided project has unsupported version
      • reloadInfobase

        boolean reloadInfobase​(org.eclipse.core.resources.IProject project,
                               InfobaseReference infobase,
                               IInfobaseUpdateCallback updateCallback,
                               boolean keepConnected,
                               org.eclipse.core.runtime.IProgressMonitor monitor)
                        throws InfobaseSynchronizationException
        Fully reloads and synchronizes the provided project with the provided infobase. Entire project configuration will be loaded to the provided infobase and infobase database will be updated. Method can be executed even if the project was not connected with the provided infobase. Returns whether infobase configuration was successfully updated and synchronized with the project.

        Flag keepConnected defines whether need to keep the provided project connected with the provided infobase after synchronization, if they were not connected yet (based on default or saved synchronization strategy and infobase connection type).

        Parameters:
        project - the project to fully synchronize with the provided infobase, cannot be null
        infobase - the infobase to fully synchronize with the provided project, cannot be null
        updateCallback - the callback executed when database structure changes or update conflict are received, cannot be null; callback may not be executed if there is matching conditions
        keepConnected - whether need to keep connection of the provided project with the provided infobase and start synchronization, if not connected yet
        monitor - the progress monitor to report progress to, cannot be null
        Returns:
        whether infobase configuration was successfully updated and synchronized with the project
        Throws:
        InfobaseSynchronizationException - if the infobase update process failed
        UnsupportedVersionException - if the provided project has unsupported version
      • pullInfobaseChanges

        boolean pullInfobaseChanges​(org.eclipse.core.resources.IProject project,
                                    InfobaseReference infobase,
                                    IInfobaseChangesPullCallback changesPullCallback,
                                    org.eclipse.core.runtime.IProgressMonitor monitor)
                             throws InfobaseSynchronizationException
        Pulls infobase configuration changes of the the provided infobase for the provided project. Received changes will be processed with the provided changes pull callback, if there are any. Method can be executed only if the project is already connected with the provided infobase. Returns whether infobase configuration changes was successfully resolved and pulled to the project.
        Parameters:
        project - the project to get and pull infobase changes for, cannot be null
        infobase - the infobase to get and pull infobase changes, cannot be null
        changesPullCallback - the callback executed when infobase changes are received, cannot be null; callback may not be executed if there is matching conditions
        monitor - the progress monitor to report progress to, cannot be null
        Returns:
        whether infobase configuration changes was successfully resolved and pulled to the project, false if resolve was aborted
        Throws:
        InfobaseSynchronizationException - if the pull changes process failed
      • connectInfobase

        void connectInfobase​(org.eclipse.core.resources.IProject project,
                             InfobaseReference infobase,
                             org.eclipse.core.runtime.IProgressMonitor monitor)
                      throws InfobaseSynchronizationException
        Connects the provided project with the provided infobase. Does nothing if project is alrady connected to the infobase.
        Parameters:
        project - the project to synchronize with the provided infobase, cannot be null
        infobase - the infobase to get and pull infobase changes, cannot be null
        monitor - the progress monitor to report progress to, cannot be null
        Throws:
        InfobaseSynchronizationException - if the infobase update process failed
        UnsupportedVersionException - if the provided project has unsupported version
      • setSynchronizationState

        void setSynchronizationState​(org.eclipse.core.resources.IProject project,
                                     InfobaseReference infobase,
                                     InfobaseSynchronizationState state)
                              throws InfobaseSynchronizationException
        Sets synchronization state for the provided infobase.
        Parameters:
        project - the project to synchronize with the provided infobase, cannot be null
        infobase - the infobase to set state for, cannot be null
        state - the infobase synchronization state to use, cannot be null
        Throws:
        org.eclipse.core.runtime.CoreException - if set failed
        InfobaseSynchronizationException
      • suppressSynchronization

        void suppressSynchronization​(org.eclipse.core.resources.IProject project,
                                     boolean suppress)
                              throws InfobaseSynchronizationException
        Suppresses project synchronization with infobases. Any changes and synchronizations between project and infobase will be ignored until suppression wil be cancelled with second method call. After that infobase synchronization will be restored.
        Parameters:
        project - the project to suppress synchronization, cannot be null
        suppress - need to suppress synchronization, if false then suppression will be cancelled
        Throws:
        InfobaseSynchronizationException - if request failed
      • getStrategyId

        String getStrategyId​(org.eclipse.core.resources.IProject project)
        Returns the synchronization strategy identifier for the provided project. Can return default strategy identifier, if specific strategy for the project is not set.
        Parameters:
        project - the project to get synchronization strategy identifier for, cannot be null
        Returns:
        the synchronization strategy identifier for the provided project, never null
        Throws:
        UnsupportedVersionException - if the provided project has unsupported version
      • getConnectionTypeId

        String getConnectionTypeId​(org.eclipse.core.resources.IProject project)
        Returns the infobase connection type identifier for the provided project. Can return default connection type identifier, if specific connection type for the project is not set.
        Parameters:
        project - the project to get infobase connection type identifier for, cannot be null
        Returns:
        the infobase connection type identifier for the provided project, never null
        Throws:
        UnsupportedVersionException - if the provided project has unsupported version
      • getSynchronizationState

        InfobaseSynchronizationState getSynchronizationState​(org.eclipse.core.resources.IProject project,
                                                             InfobaseReference infobase)
        Returns current infobase connection state.
        Parameters:
        project - the project to get infobase connection state for, cannot be null
        infobase - the infobase to get connection state for, cannot be null
        Returns:
        current infobase connection state, never null
        Throws:
        UnsupportedVersionException - if the provided project has unsupported version
      • getEqualityState

        InfobaseEqualityState getEqualityState​(org.eclipse.core.resources.IProject project,
                                               InfobaseReference infobase)
        Returns current infobase equality state.
        Parameters:
        project - the project to get infobase equality state for, cannot be null
        infobase - the infobase to get equality state for, cannot be null
        Returns:
        current infobase equality state, never null
        Throws:
        UnsupportedVersionException - if the provided project has unsupported version
      • changeSynchronizationSettings

        void changeSynchronizationSettings​(org.eclipse.core.resources.IProject project,
                                           String connectionTypeId,
                                           String strategyId,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
        Changes the infobase synchronization settings: the connection type and the synchronization strategy for the provided project.
        Parameters:
        project - the project to change connection type and synchronization strategy for, cannot be null
        connectionTypeId - connection type identifier to set, cannot be null
        strategyId - synchronization strategy identifier to set, cannot be null
        monitor - the progress monitor to report progress to, cannot be null
        Throws:
        UnsupportedVersionException - if the provided project has unsupported version
        See Also:
        IInfobaseSynchronizationSettings
      • addInfobaseSynchronizationListener

        void addInfobaseSynchronizationListener​(IInfobaseSynchronizationListener listener)
        Adds an infobase synchronization listener to the manager. Listener will be notified about infobase synchronization state changes.

        Causes no effect if provided listener is already registered.

        Parameters:
        listener - the infobase synchronization listener to add, cannot be null
      • removeInfobaseSynchronizationListener

        void removeInfobaseSynchronizationListener​(IInfobaseSynchronizationListener listener)
        Removes the registered access settings listener from service. Listener will no longer be notified about infobase synchronization state changes.
        Parameters:
        listener - the infobase synchronization listener to remove, cannot be null
      • reconnectIfConnected

        void reconnectIfConnected​(org.eclipse.core.resources.IProject project,
                                  InfobaseReference infobase,
                                  IInfobaseAccessSettings settings)
        Checks infobase assotiation with projects and reconnects to them with new access settings if connected.
        Parameters:
        project - the project to synchronize with the provided infobase, cannot be null
        infobase - the infobase to synchronize with the provided project, cannot be null
        settings - the new infobase access settings to reconnect, cannot be null