Interface ISynchronizationStrategy
-
- All Known Subinterfaces:
IPersistableSynchronizationStrategy
public interface ISynchronizationStrategy
Describes a strategy of the synchronization between projects and connected infobases. Infobase synchronization strategies are defined by extensions. An infobase synchronization strategy extension is defined inplugin.xml
.Following is an example definition of an infobase synchronization strategy extension:
<extension point="com._1c.g5.v8.dt.platform.services.core.infobaseSynchronizationStrategies"> <strategy id="com._1c.g5.v8.dt.platform.services.core.synchronizationStrategy.ExampleStrategy" class="com.example.ExampleStrategyClass"> name="Example Strategy"> description="This is example strategy" <supportedRuntimes runtime="com._1c.g5.v8.dt.platform.runtime.8.3.8"> </supportedRuntimes> </strategy> </extension>
Synchronization strategy defines when to load project metadata objects changes to connected infobases. Strategy can perform one-to-one and one-to-many connections with infobases. Synchronization strategies can be stateful, can buffers changes, errors, etc.
Clients may implement
IPersistableSynchronizationStrategy
to save and restore synchronization strategy state between DT IDE sessions.Strategies may be contained in
IInfobaseSynchronizationSettings
and then will be available to be selected by the user of DT IDE.This interface is intended to be implemented and registered by clients. Instances of strategies are not intended to be explicitly created or used by client.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
fullReloadRequested(InfobaseReference infobase, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifiess the strategy that full reload of the project configuration content to the provided infobase is required.Set<org.eclipse.emf.ecore.EObject>
getChangedObjects(InfobaseReference infobase)
Returns a set of changes metadata objects that is bufferred by this strategy and intended to be loaded to the infobase, when required.IInfobaseConnection
getConnection(InfobaseReference infobase)
Returns connection of this strategy for the given infobase.Map<InfobaseReference,IInfobaseConnection>
getConnections()
Returns a map of all connected infobases and infobase connections.InfobaseEqualityState
getEqualityState(InfobaseReference infobase)
Returns the infobase equality state for the provided infobase.InfobaseSynchronizationState
getSynchronizationState(InfobaseReference infobase)
Returns the infobase synchronization state for the provided infobase.void
infobaseConnected(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IInfobaseConnection connection, InfobaseSynchronizationState state)
Notifies the strategy that the project was connected with the provided infobase using the provided infobase connection.boolean
infobaseDatabaseUpdateRequested(InfobaseReference infobase, IInfobaseUpdateCallback updateCallback, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifiess the strategy that database update of the provided infobase is requested.void
infobaseDisconnected(org.eclipse.core.resources.IProject project, InfobaseReference infobase)
Notifiess the strategy that the project was disconnected with the provided infobase.boolean
infobasePullChangesRequested(InfobaseReference infobase, IInfobaseChangesPullCallback changesPullCallback, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifies the strategy that infobase configuration changes pull is requested.void
infobaseSynchronizationStateChangeRequested(InfobaseReference infobase, InfobaseSynchronizationState state)
Notifiess the strategy that the infobase synchronization state change is requested for the provided infobase.boolean
isConnected(InfobaseReference infobase)
Returns whether the porvided infobase is connected with the strategy.void
objectsChanged(Collection<org.eclipse.emf.common.util.URI> changedObjects, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifiess the strategy that a set of metadata objects were changed in the project, this strategy belongs to.void
objectsDeleted(Set<org.eclipse.emf.ecore.EObject> deletedObjects, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifiess the strategy that a set of metadata objects were deleted in the project, this strategy belongs to.
-
-
-
Method Detail
-
isConnected
boolean isConnected(InfobaseReference infobase)
Returns whether the porvided infobase is connected with the strategy.- Parameters:
infobase
- the infobase to check, cannot benull
- Returns:
- whether the porvided infobase is connected with the strategy
-
getConnections
Map<InfobaseReference,IInfobaseConnection> getConnections()
Returns a map of all connected infobases and infobase connections. Returned map is immutable.- Returns:
- a map of all connected infobases and infobase connections, never
null
, can be empty
-
getConnection
IInfobaseConnection getConnection(InfobaseReference infobase)
Returns connection of this strategy for the given infobase. Can returnnull
, if not connected with the provided infobase.- Parameters:
infobase
- the infobase to get connection for, cannot benull
- Returns:
- the infobase connection or
null
, if not connected
-
getSynchronizationState
InfobaseSynchronizationState getSynchronizationState(InfobaseReference infobase)
Returns the infobase synchronization state for the provided infobase.- Parameters:
infobase
- the infobase to get synchronization state for, cannot benull
- Returns:
- the infobase synchronization state, never
null
-
getEqualityState
InfobaseEqualityState getEqualityState(InfobaseReference infobase)
Returns the infobase equality state for the provided infobase.- Parameters:
infobase
- the infobase to get equality state for, cannot benull
- Returns:
- the infobase equality state, never
null
-
getChangedObjects
Set<org.eclipse.emf.ecore.EObject> getChangedObjects(InfobaseReference infobase)
Returns a set of changes metadata objects that is bufferred by this strategy and intended to be loaded to the infobase, when required.- Parameters:
infobase
- the infobase that is connected, cannot benull
- Returns:
- a set of changes objects that is bufferred by this strategy, neveer
null
-
infobaseConnected
void infobaseConnected(org.eclipse.core.resources.IProject project, InfobaseReference infobase, IInfobaseConnection connection, InfobaseSynchronizationState state)
Notifies the strategy that the project was connected with the provided infobase using the provided infobase connection.One strategy instance can be connected with many infobases - then loads and updates will be performed for all connected infobases.
- Parameters:
project
- the project, that was connected, cannot benull
infobase
- the infobase that was connected, cannot benull
connection
- the connection to infobases, cannot benull
state
- the infobase connection state, cannot benull
-
infobaseDisconnected
void infobaseDisconnected(org.eclipse.core.resources.IProject project, InfobaseReference infobase)
Notifiess the strategy that the project was disconnected with the provided infobase.- Parameters:
project
- the project, that was disconnected, cannot benull
infobase
- the infobase that was disconnected, cannot benull
-
infobaseSynchronizationStateChangeRequested
void infobaseSynchronizationStateChangeRequested(InfobaseReference infobase, InfobaseSynchronizationState state)
Notifiess the strategy that the infobase synchronization state change is requested for the provided infobase.- Parameters:
infobase
- the infobase to change synchronization state for, cannot benull
state
- new infobase synchronization state, cannot benull
-
objectsChanged
void objectsChanged(Collection<org.eclipse.emf.common.util.URI> changedObjects, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifiess the strategy that a set of metadata objects were changed in the project, this strategy belongs to.Strategy can load them to connected infobases using stored infobase connection, or buffer them for later usage.
- Parameters:
changedObjects
- a set of changed objects, cannot benull
monitor
- the progress monitor to report progress to, cannot benull
-
objectsDeleted
void objectsDeleted(Set<org.eclipse.emf.ecore.EObject> deletedObjects, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifiess the strategy that a set of metadata objects were deleted in the project, this strategy belongs to.Strategy can load them to connected infobases using stored infobase connection, or buffer them for later usage.
- Parameters:
deletedObjects
- a set of deleted objects, cannot benull
monitor
- the progress monitor to report progress to, cannot benull
-
fullReloadRequested
void fullReloadRequested(InfobaseReference infobase, org.eclipse.core.runtime.IProgressMonitor monitor)
Notifiess the strategy that full reload of the project configuration content to the provided infobase is required.- Parameters:
infobase
- the infobase to request full load for, cannot benull
monitor
- the progress monitor to report progress to, cannot benull
-
infobaseDatabaseUpdateRequested
boolean infobaseDatabaseUpdateRequested(InfobaseReference infobase, IInfobaseUpdateCallback updateCallback, org.eclipse.core.runtime.IProgressMonitor monitor) throws InfobaseSynchronizationException
Notifiess the strategy that database update of the provided infobase is requested. Strategy is intended to load all previously buffered changes before database update execution (if there are any).Update must be performed synchronously.
- Parameters:
infobase
- the infobase to request update for, 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:
- whether infobase configuration was successfully updated and synchronized with the project,
false
if update was aborted - Throws:
InfobaseSynchronizationException
- if infobase database update fails
-
infobasePullChangesRequested
boolean infobasePullChangesRequested(InfobaseReference infobase, IInfobaseChangesPullCallback changesPullCallback, org.eclipse.core.runtime.IProgressMonitor monitor) throws InfobaseSynchronizationException
Notifies the strategy that infobase configuration changes pull is requested. Changes must be processed with the provide changes pull callback.Pull changes request must be performed synchronously.
- Parameters:
infobase
- the infobase to request update for, cannot benull
changesPullCallback
- the callback executed when infobase changes are received, cannot benull
; callback may not be executed if there is matching conditionsmonitor
- 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 infobase database update fails
-
-