Class ServerApplicationProvisionDelegate
java.lang.Object
com.e1c.g5.dt.internal.applications.wst.ServerApplicationProvisionDelegate
- All Implemented Interfaces:
IManagedService
,IApplicationProvisionDelegate
public class ServerApplicationProvisionDelegate
extends Object
implements IApplicationProvisionDelegate, IManagedService
The WST server application provision delegate implementation.
Produces
IServerApplication
s that do not exist "physically".
Every non deleted visible module on every WST server is an application
optionally referencing
some project.
Since server applications do not "exist", a new instance of IServerApplication
is created every time for the same application each time a caller receives it.
Subscribes to WST server events and IInfobaseSynchronizationManager
and notifies IApplicationProvisionNotifier
about the following:
- Infobase is being synchronized
(
InfobaseSynchronizationState.SYNCHRONIZING
) : application needs incremental update (PublishState.INCREMENTAL_PUBLISH_REQUIRED
). - Infobase was synchronized
(
InfobaseSynchronizationState.SYNCHRONIZED
) : application does not need update (PublishState.FULL_SYNCHRONIZED
). - Infobase was disconnected from application
(
InfobaseSynchronizationState.NOT_CONNECTED
) : application state is unknown (PublishState.UNKNOWN
). - Infobase configuration is different from project configuration
(
InfobaseEqualityState.NOT_EQUAL
) : application needs incremental update (PublishState.INCREMENTAL_PUBLISH_REQUIRED
). - Infobase configuration is same as project configuration
(
InfobaseEqualityState.EQUAL
) : application does not need update (PublishState.FULL_SYNCHRONIZED
). - Application has been created
(
ServerEvent.STATUS_CHANGE
+ServerEvent.MODULE_CHANGE
+ module added) : application state is unknown (PublishState.UNKNOWN
).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
void
findApplicationByInfobase
(InfobaseReference infobaseToFind) Finds an application that uses specified infobase.findApplicationByInfobaseAndProject
(InfobaseReference infobaseToFind, org.eclipse.core.resources.IProject projectToFind) Finds an application for the specified project that uses specified infobase.getApplications
(org.eclipse.core.resources.IProject projectToFind, IApplicationType typeToFind) 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
initialize
(IApplicationProvisionNotifier notifier, IApplicationAttributeRepository attributeRepository, IApplicationType defaultType) Initializes the application provision delegate with the registered application type and provision notifier.
-
Constructor Details
-
ServerApplicationProvisionDelegate
public ServerApplicationProvisionDelegate()
-
-
Method Details
-
initialize
public void initialize(IApplicationProvisionNotifier notifier, IApplicationAttributeRepository attributeRepository, IApplicationType defaultType) 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
defaultType
- 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 projectToFind, IApplicationType typeToFind) throws ApplicationException Description copied from interface:IApplicationProvisionDelegate
Returns a list of all registered project applications.- Specified by:
getApplications
in interfaceIApplicationProvisionDelegate
- Parameters:
projectToFind
- 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
-
findApplicationByInfobaseAndProject
public Optional<IApplication> findApplicationByInfobaseAndProject(InfobaseReference infobaseToFind, org.eclipse.core.resources.IProject projectToFind) 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:
infobaseToFind
- Infobase for which to search application. Must not benull
.projectToFind
- 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.
-
findApplicationByInfobase
public Optional<IApplication> findApplicationByInfobase(InfobaseReference infobaseToFind) 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:
infobaseToFind
- 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.
-
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
-