Class InfobaseApplicationProvisionDelegate
java.lang.Object
com.e1c.g5.dt.internal.applications.infobases.InfobaseApplicationProvisionDelegate
- All Implemented Interfaces:
IInfobaseChangeListener
,IManagedService
,IApplicationProvisionDelegate
public class InfobaseApplicationProvisionDelegate
extends Object
implements IApplicationProvisionDelegate, IManagedService, IInfobaseChangeListener
The infobase application provision delegate implementation.
For infobase applications their lifecycle state is always
LifecycleState.UNKNOWN
.
IApplicationProvisionNotifier
is notified about the following application changes:
- Infobase is associated:
LifecycleState.CREATED
InfobaseAssociationContext
changes:LifecycleState.STOPPED
and/orLifecycleState.CREATED
- Infobase equality or synchronization state changed: application publishing state changed.
- Infobase disassociated:
LifecycleState.DELETED
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Listens for changes ofInfobaseAssociationContext
s and when infobases are associated or disassociated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
void
findApplicationByInfobase
(InfobaseReference infobase) Finds an application that uses specified infobase.findApplicationByInfobaseAndProject
(InfobaseReference infobase, org.eclipse.core.resources.IProject project) Finds an application for the specified project that uses specified infobase.getApplications
(org.eclipse.core.resources.IProject project, IApplicationType type) Returns a list of all registered project applications.getLifecycleState
(ILifecycleAware object) Returns the application lifecycle state for the provided application or lifecycle aware artifact.getPublishState
(IApplication application) Returns the application publish state for the provided application.void
infobasesReloaded
(List<Section> newInput) Called when list of registered infobases has been reloaded.void
initialize
(IApplicationProvisionNotifier notifier, IApplicationAttributeRepository attributeRepository, IApplicationType type) Initializes the application provision delegate with the registered application type and provision notifier.void
sectionAdded
(Section section) Notification that new section was added and persisted.
-
Constructor Details
-
InfobaseApplicationProvisionDelegate
public InfobaseApplicationProvisionDelegate()
-
-
Method Details
-
initialize
public void initialize(IApplicationProvisionNotifier notifier, IApplicationAttributeRepository attributeRepository, IApplicationType type) Description copied from interface:IApplicationProvisionDelegate
Initializes the application provision delegate with the registered application type and provision notifier.- Specified by:
initialize
in interfaceIApplicationProvisionDelegate
- Parameters:
notifier
- the application provision notifier, cannot benull
attributeRepository
- the application attribute repository to use if needed, cannot benull
type
- the application type, cannot benull
-
activate
public void activate()- Specified by:
activate
in interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivate
in interfaceIManagedService
-
getApplications
public List<IApplication> getApplications(org.eclipse.core.resources.IProject project, IApplicationType type) throws ApplicationException Description copied from interface:IApplicationProvisionDelegate
Returns a list of all registered project applications.- Specified by:
getApplications
in interfaceIApplicationProvisionDelegate
- Parameters:
project
- the project to get applications for, cannot benull
- Returns:
- a list of all registered project applications, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
getLifecycleState
Description copied from interface:IApplicationProvisionDelegate
Returns the application lifecycle state for the provided application or lifecycle aware artifact. May be unkown.- Specified by:
getLifecycleState
in interfaceIApplicationProvisionDelegate
- Parameters:
object
- the object to get state for, cannot benull
- Returns:
- the application lifecycle state, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
getPublishState
Description copied from interface:IApplicationProvisionDelegate
Returns the application publish state for the provided application. May be unkown.- Specified by:
getPublishState
in interfaceIApplicationProvisionDelegate
- Parameters:
application
- the application to get state for, cannot benull
- Returns:
- the application publish state, never
null
- Throws:
ApplicationException
- if method call failed with some reason
-
sectionAdded
Description copied from interface:IInfobaseChangeListener
Notification that new section was added and persisted.- Specified by:
sectionAdded
in interfaceIInfobaseChangeListener
- Parameters:
section
- the added section, cannot benull
-
infobasesReloaded
Description copied from interface:IInfobaseChangeListener
Called when list of registered infobases has been reloaded. This could happen not only when registered infobases list is explicitly reloaded by user or there are changes made outside of EDT (for example, using 1C Starter) but also when infobases are added or deleted by user using EDT or automatically by EDT itself. Moreover, the method could be called when there are no actual changes but infobases list has been reloaded (triggered manually by user or automatically).- Specified by:
infobasesReloaded
in interfaceIInfobaseChangeListener
- Parameters:
newInput
- a new input (tree of sections), cannot benull
-
findApplicationByInfobase
public Optional<IApplication> findApplicationByInfobase(InfobaseReference infobase) throws ApplicationException Description copied from interface:IApplicationProvisionDelegate
Finds an application that uses specified infobase. If project is known then consider usingIApplicationProvisionDelegate.findApplicationByInfobaseAndProject(com._1c.g5.v8.dt.platform.services.model.InfobaseReference, org.eclipse.core.resources.IProject)
which could much faster.- Specified by:
findApplicationByInfobase
in interfaceIApplicationProvisionDelegate
- Parameters:
infobase
- Infobase for which to find application. Must not benull
.- Returns:
- Application that uses specified infobase or an empty value if infobase is not used by any application.
Never
null
. - Throws:
ApplicationException
- If an error occured while searching for matching application.
-
findApplicationByInfobaseAndProject
public Optional<IApplication> findApplicationByInfobaseAndProject(InfobaseReference infobase, org.eclipse.core.resources.IProject project) throws ApplicationException Description copied from interface:IApplicationProvisionDelegate
Finds an application for the specified project that uses specified infobase. The method is similar toIApplicationProvisionDelegate.findApplicationByInfobase(com._1c.g5.v8.dt.platform.services.model.InfobaseReference)
but could be much faster.- Specified by:
findApplicationByInfobaseAndProject
in interfaceIApplicationProvisionDelegate
- Parameters:
infobase
- Infobase for which to search application. Must not benull
.project
- Project for which to search application. Must not benull
.- Returns:
- Application that uses specified infobase and project
or an empty value if infobase is not used by any application in the specified project.
Never
null
. - Throws:
ApplicationException
- If an error occured while searching for matching application.
-