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 InfobaseAssociationContextchanges:LifecycleState.STOPPEDand/orLifecycleState.CREATED- Infobase equality or synchronization state changed: application publishing state changed.
- Infobase disassociated:
LifecycleState.DELETED
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassListens for changes ofInfobaseAssociationContexts and when infobases are associated or disassociated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidfindApplicationByInfobase(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.voidinfobasesReloaded(List<Section> newInput) Called when list of registered infobases has been reloaded.voidinitialize(IApplicationProvisionNotifier notifier, IApplicationAttributeRepository attributeRepository, IApplicationType type) Initializes the application provision delegate with the registered application type and provision notifier.voidsectionAdded(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:IApplicationProvisionDelegateInitializes the application provision delegate with the registered application type and provision notifier.- Specified by:
initializein interfaceIApplicationProvisionDelegate- Parameters:
notifier- the application provision notifier, cannot benullattributeRepository- the application attribute repository to use if needed, cannot benulltype- the application type, cannot benull
-
activate
public void activate()- Specified by:
activatein interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivatein interfaceIManagedService
-
getApplications
public List<IApplication> getApplications(org.eclipse.core.resources.IProject project, IApplicationType type) throws ApplicationException Description copied from interface:IApplicationProvisionDelegateReturns a list of all registered project applications.- Specified by:
getApplicationsin 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:IApplicationProvisionDelegateReturns the application lifecycle state for the provided application or lifecycle aware artifact. May be unkown.- Specified by:
getLifecycleStatein 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:IApplicationProvisionDelegateReturns the application publish state for the provided application. May be unkown.- Specified by:
getPublishStatein 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:IInfobaseChangeListenerNotification that new section was added and persisted.- Specified by:
sectionAddedin interfaceIInfobaseChangeListener- Parameters:
section- the added section, cannot benull
-
infobasesReloaded
Description copied from interface:IInfobaseChangeListenerCalled 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:
infobasesReloadedin interfaceIInfobaseChangeListener- Parameters:
newInput- a new input (tree of sections), cannot benull
-
findApplicationByInfobase
public Optional<IApplication> findApplicationByInfobase(InfobaseReference infobase) throws ApplicationException Description copied from interface:IApplicationProvisionDelegateFinds 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:
findApplicationByInfobasein 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:IApplicationProvisionDelegateFinds 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:
findApplicationByInfobaseAndProjectin 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.
-