Interface IInfobaseManager


  • public interface IInfobaseManager
    Manager service to manage infobase references and some other infobase actions.

    Manager allows:

    • Manage infobase references: load and store them
    • Manage infobase associations with project: associate and disassociate them
    • Listen infobase references and associations changes
    • Obtain infobase locks for the exclusion infobase access

    Instances of IInfobaseManager are stateful.

    See Also:
    InfobaseReferences
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Method Detail

      • isPersistenceSupported

        boolean isPersistenceSupported()
        Returns whether the manager supports persisting (saving or loading) infobases. Result is based on registered infobase references presistence store.

        Method must be tested before infobase references managing.

        Returns:
        whether the manager supports infobase references managing
      • getAll

        List<Section> getAll()
        Returns persisted registered infobase references sections. Infobase reference and group sections are stored as tree and root section list will be returned.

        This is shortcut method for the getAll(false) execution.

        Returns:
        a list of loaded infobases sections, never null
      • getAll

        List<Section> getAll​(boolean reload)
        Returns persisted registered infobase references sections. Infobase reference and group sections are stored as tree and root section list will be returned.

        Flag reload can be used to force loading sections from persisting store.

        Parameters:
        reaload - whether need to reload sections from the persistence store
        Returns:
        a list of loaded root infobases sections, never null
        Throws:
        IllegalStateException - if persistence not available
      • getLoadStatus

        org.eclipse.core.runtime.IStatus getLoadStatus()
        Returns a status of infobase references load from reference store file. May return OK status if load was successful, WARNING status with store file warnings or ERROR status if loading error was occurred.
        Returns:
        a status of infobase references load from reference store file.
      • getInfobasesResource

        org.eclipse.emf.ecore.resource.Resource getInfobasesResource​(boolean reload)
        Returns a resource, that contains all root sections. Never returns null.
        Parameters:
        reload - whether need to reload sections from the persistence store
        Returns:
        a resource, that contains all root sections, never null
      • save

        void save​(List<Section> sections)
        Save given infobase references sections in the persistence store.
        Parameters:
        sections - list of infobase references sections to save, cannot be null
        Throws:
        IllegalStateException - if persistence not available
      • add

        void add​(List<Section> rootSections,
                 List<Section> parentSubsections,
                 Section section)
        Add and persist the given section in the given parent subsections list.
        Parameters:
        rootSections - the root of all sections hierarchy, cannot be null
        parentSubsections - list of parent subsections to add created or added section, cannot be null
        section - section to add, cannot be null
      • add

        void add​(Section section,
                 String referenceFolder)
          throws InfobaseReferenceException
        Add and persist the provided infobase section in the infobase reference folder in terms of 1C:Enterprise infobases list.
        Parameters:
        section - the infobase section to add, cannot be null
        referenceFolder - the reference folder or null to create top level infobase section
        Throws:
        InfobaseReferenceException - if section add failed
      • edit

        void edit​(Section section)
        Save a single existing section (infobase reference or group). Method delegates execution to registered infobase references presistence store. Target infobase to replace will be found by UUID.
        Parameters:
        section - the section (infobase or group) to save, cannot be null
        Throws:
        IllegalStateException - if persistence not available
      • get

        InfobaseReference get​(UUID infobaseUuid)
        Returns an infobase by the given infobase UUID. Can return null if not found.
        Parameters:
        infobaseUuid - the infobase UUID, cannot be null
        Returns:
        a found infobase or null if not found
      • isSortByName

        boolean isSortByName()
        Returns whether need to sort infobases by infobase name.
        Returns:
        whether need to ssort infobases by infobase name
      • setSortByName

        void setSortByName​(boolean sortByName)
        Set boolean flag whether needto sort infobases by infobase name.
        Parameters:
        showRecent - boolean flag whether need to sort infobases by infobase name
      • isShowRecent

        boolean isShowRecent()
        Returns whether need to show recent used infobases.
        Returns:
        whether need to show recent used infobases
      • setShowRecent

        void setShowRecent​(boolean showRecent)
        Set boolean flag whether need to show recent used infobases.
        Parameters:
        showRecent - boolean flag whether need to show recent used infobases
      • getRecentInfobasesCount

        int getRecentInfobasesCount()
        Returns count of recent used infobases to remember.
        Returns:
        count of recent used infobases to remember
      • setRecentInfobasesCount

        void setRecentInfobasesCount​(int count)
        Set new count of recent used infobases to remember.
        Parameters:
        count - new count of recent used infobases to remember, must be between 0 and 10
      • markInfobaseAsRecent

        void markInfobaseAsRecent​(InfobaseReference infobase)
        Marks the given infobase as recent used.
        Parameters:
        infobase - the infobase to mark as recent used, cannot be null
      • getLock

        Lock getLock​(InfobaseReference infobase)
        Returns a lock instance, that can be used to synchronize the given infobase access.

        Already obtained locks are unique by the given infobase in every time of usage while strong references to locks are reachable.

        Parameters:
        infobase - the infobase to get lock for, cannot be null
        Returns:
        a lock instance, that can be used to synchronize given infobase access, never null
      • getInternalInfobaseLock

        Lock getInternalInfobaseLock()
        Returns a lock instance, that can be used to synchronize the internal infobase access.

        Some actions with 1C:Enterprise Runtime are performed on some internal infobase and may block it, for example external processor dump generation.

        Returns:
        a lock instance, that can be used to synchronize internal infobase access, never null
      • generateInfobaseName

        String generateInfobaseName()
        Generate name for an infobase. Name will be unique.
        Returns:
        generated unique name for infobase, never null
      • generateGroupName

        String generateGroupName()
        Generate name for a group. Name will be unique.
        Returns:
        generated unique name for group, never null
      • generateDefaultInfobaseLocation

        Path generateDefaultInfobaseLocation()
        Generate the default location for infobase creation, including generated new infobase name. Can return null if none.
        Returns:
        the default location for infobase creation or null if none
      • addInfobaseChangeListener

        void addInfobaseChangeListener​(IInfobaseChangeListener infobaseChangeListener)
        Add infobase references change listener to service. Listener will be notified about infobases changes.

        Causes no effect if given listener is already registered.

        Parameters:
        infobaseChangeListener - the infobase references change listener to add, cannot be null
        See Also:
        IInfobaseChangeListener
      • removeInfobaseChangeListener

        void removeInfobaseChangeListener​(IInfobaseChangeListener infobaseChangeListener)
        Remove registered listener from service. Listener will no longer be notified about infobase references changes.
        Parameters:
        infobaseChangeListener - the infobase references change listener to remove, cannot be null
        See Also:
        IInfobaseChangeListener