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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICE_NAME
Service lifecycle participation name.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addInfobaseSynchronizationListener(IInfobaseSynchronizationListener listener)
Adds an infobase synchronization listener to the manager.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.void
connectInfobase(org.eclipse.core.resources.IProject project, InfobaseReference infobase, org.eclipse.core.runtime.IProgressMonitor monitor)
Connects the provided project with the provided infobase.String
getConnectionTypeId(org.eclipse.core.resources.IProject project)
Returns the infobase connection type identifier for the provided project.InfobaseEqualityState
getEqualityState(org.eclipse.core.resources.IProject project, InfobaseReference infobase)
Returns current infobase equality state.String
getStrategyId(org.eclipse.core.resources.IProject project)
Returns the synchronization strategy identifier for the provided project.InfobaseSynchronizationState
getSynchronizationState(org.eclipse.core.resources.IProject project, InfobaseReference infobase)
Returns current infobase connection state.boolean
pullInfobaseChanges(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IInfobaseChangesPullCallback changesPullCallback, boolean failIfUnavailable, org.eclipse.core.runtime.IProgressMonitor monitor)
Pulls infobase configuration changes of the the provided infobase for the provided project.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.boolean
reloadInfobase(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IInfobaseUpdateCallback updateCallback, boolean keepConnected, org.eclipse.core.runtime.IProgressMonitor monitor)
Fully reloads and synchronizes the provided project with the provided infobase.void
removeInfobaseSynchronizationListener(IInfobaseSynchronizationListener listener)
Removes the registered access settings listener from service.void
setSynchronizationState(org.eclipse.core.resources.IProject project, InfobaseReference infobase, InfobaseSynchronizationState state)
Sets synchronization state for the provided infobase.void
suppressSynchronization(org.eclipse.core.resources.IProject project, boolean suppress)
Suppresses project synchronization with infobases.Map<InfobaseReference,Boolean>
updateAllInfobases(org.eclipse.core.resources.IProject project, IInfobaseUpdateCallback updateCallback, org.eclipse.core.runtime.IProgressMonitor monitor)
Synchronizes the provided project with all connected infobases.boolean
updateInfobase(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IInfobaseUpdateCallback updateCallback, boolean keepConnected, org.eclipse.core.runtime.IProgressMonitor monitor)
Synchronizes the provided project with the provided infobase.-
Methods inherited from interface com._1c.g5.wiring.IManagedService
activate, deactivate
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
Service lifecycle participation name.- See Also:
- Constant Field Values
-
-
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 benull
updateCallback
- the callback executed when database structure changes or update conflict are received, cannot benull
; callback may not be executed if there is matching conditionsmonitor
- the progress monitor to report progress to, cannot benull
- 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 benull
infobase
- the infobase to synchronize with the provided project, cannot benull
updateCallback
- the callback executed when database structure changes or update conflict are received, cannot benull
; callback may not be executed if there is matching conditionskeepConnected
- whether need to keep connection of the provided project with the provided infobase and start synchronization, if not connected yetmonitor
- the progress monitor to report progress to, cannot benull
- Returns:
- whether infobase configuration was successfully updated and synchronized with the project
- Throws:
InfobaseSynchronizationException
- if the infobase update process failedUnsupportedVersionException
- 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 benull
infobase
- the infobase to fully synchronize with the provided project, cannot benull
updateCallback
- the callback executed when database structure changes or update conflict are received, cannot benull
; callback may not be executed if there is matching conditionskeepConnected
- whether need to keep connection of the provided project with the provided infobase and start synchronization, if not connected yetmonitor
- the progress monitor to report progress to, cannot benull
- Returns:
- whether infobase configuration was successfully updated and synchronized with the project
- Throws:
InfobaseSynchronizationException
- if the infobase update process failedUnsupportedVersionException
- if the provided project has unsupported version
-
pullInfobaseChanges
boolean pullInfobaseChanges(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IInfobaseChangesPullCallback changesPullCallback, boolean failIfUnavailable, 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 benull
infobase
- the infobase to get and pull infobase changes, cannot benull
changesPullCallback
- the callback executed when infobase changes are received, cannot benull
; callback may not be executed if there is matching conditionsfailIfUnavailable
- whether need to fail if changes pull is unavailable, cannot benull
monitor
- the progress monitor to report progress to, cannot benull
- 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 benull
infobase
- the infobase to get and pull infobase changes, cannot benull
monitor
- the progress monitor to report progress to, cannot benull
- Throws:
InfobaseSynchronizationException
- if the infobase update process failedUnsupportedVersionException
- 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 benull
infobase
- the infobase to set state for, cannot benull
state
- the infobase synchronization state to use, cannot benull
- Throws:
org.eclipse.core.runtime.CoreException
- if set failedInfobaseSynchronizationException
-
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.Restart of the project clears synchronization suppression.
- Parameters:
project
- the project to suppress synchronization, cannot benull
suppress
- need to suppress synchronization, iffalse
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 benull
- 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 benull
- 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 benull
infobase
- the infobase to get connection state for, cannot benull
- 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 benull
infobase
- the infobase to get equality state for, cannot benull
- 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 benull
connectionTypeId
- connection type identifier to set, cannot benull
strategyId
- synchronization strategy identifier to set, cannot benull
monitor
- the progress monitor to report progress to, cannot benull
- 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 benull
-
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 benull
-
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 benull
infobase
- the infobase to synchronize with the provided project, cannot benull
settings
- the new infobase access settings to reconnect, cannot benull
-
-