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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Section section, String referenceFolder)
Add and persist the provided infobase section in the infobase reference folder in terms of 1C:Enterprise infobases list.void
add(List<Section> rootSections, List<Section> parentSubsections, Section section)
Add and persist the given section in the given parent subsections list.void
addInfobaseChangeListener(IInfobaseChangeListener infobaseChangeListener)
Add infobase references change listener to service.void
delete(Section section)
Removes and persists the provided infobase section.void
edit(Section section)
Save a single existing section (infobase reference or group).Path
generateDefaultInfobaseLocation()
Generate the default location for infobase creation, including generated new infobase name.String
generateGroupName()
Generate name for a group.String
generateInfobaseName()
Generate name for an infobase.InfobaseReference
get(UUID infobaseUuid)
Returns an infobase by the given infobaseUUID
.List<Section>
getAll()
Returns persisted registered infobase references sections.List<Section>
getAll(boolean reload)
Returns persisted registered infobase references sections.org.eclipse.emf.ecore.resource.Resource
getInfobasesResource(boolean reload)
Returns a resource, that contains all root sections.Lock
getInternalInfobaseLock()
Returns a lock instance, that can be used to synchronize the internal infobase access.org.eclipse.core.runtime.IStatus
getLoadStatus()
Returns a status of infobase references load from reference store file.Lock
getLock(InfobaseReference infobase)
Returns a lock instance, that can be used to synchronize the given infobase access.List<InfobaseReference>
getRecent()
Reutnrns list of recent used infobases.int
getRecentInfobasesCount()
Returns count of recent used infobases to remember.boolean
isPersistenceSupported()
Returns whether the manager supports persisting (saving or loading) infobases.boolean
isShowRecent()
Returns whether need to show recent used infobases.boolean
isSortByName()
Returns whether need to sort infobases by infobase name.void
markInfobaseAsRecent(InfobaseReference infobase)
Marks the given infobase as recent used.void
removeInfobaseChangeListener(IInfobaseChangeListener infobaseChangeListener)
Remove registered listener from service.void
save(List<Section> sections)
Save given infobase references sections in the persistence store.void
setRecentInfobasesCount(int count)
Set new count of recent used infobases to remember.void
setShowRecent(boolean showRecent)
Setboolean
flag whether need to show recent used infobases.void
setSortByName(boolean sortByName)
Setboolean
flag whether needto sort infobases by infobase name.
-
-
-
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
-
getRecent
List<InfobaseReference> getRecent()
Reutnrns list of recent used infobases. List size isgetRecentInfobasesCount()
.- Returns:
- list of recent used infobases, never
null
, can be empty
-
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 returnOK
status if load was successful,WARNING
status with store file warnings orERROR
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 returnsnull
.- 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 benull
- 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 benull
parentSubsections
- list of parent subsections to add created or added section, cannot benull
section
- section to add, cannot benull
-
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 benull
referenceFolder
- the reference folder ornull
to create top level infobase section- Throws:
InfobaseReferenceException
- if section add failed
-
delete
void delete(Section section) throws InfobaseReferenceException
Removes and persists the provided infobase section.- Parameters:
section
- the infobase section to remove, cannot benull
- Throws:
InfobaseReferenceException
- if section delete 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 byUUID
.- Parameters:
section
- the section (infobase or group) to save, cannot benull
- Throws:
IllegalStateException
- if persistence not available
-
get
InfobaseReference get(UUID infobaseUuid)
Returns an infobase by the given infobaseUUID
. Can returnnull
if not found.- Parameters:
infobaseUuid
- the infobase UUID, cannot benull
- 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)
Setboolean
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)
Setboolean
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 between0
and10
-
markInfobaseAsRecent
void markInfobaseAsRecent(InfobaseReference infobase)
Marks the given infobase as recent used.- Parameters:
infobase
- the infobase to mark as recent used, cannot benull
-
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 benull
- 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 returnnull
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 benull
- 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 benull
- See Also:
IInfobaseChangeListener
-
-