Interface ContributionPersistenceManager
- All Known Implementing Classes:
ContributionPersistenceComponent
public interface ContributionPersistenceManager
- Author:
- Bogdan Stefanescu
-
Method Summary
Modifier and TypeMethodDescriptionaddContribution(Contribution contrib) Persists a new contribution.getContribution(String name) Gets a contribution given its name.Gets a list with all persisted contributions.booleaninstallContribution(Contribution contrib) Installs the contribution given its name.booleanisInstalled(Contribution contrib) Checks whether a contribution is currently installed.booleanisPersisted(Contribution contrib) Checks whether a contribution is currently persisted.booleanremoveContribution(Contribution contrib) Removes a persisted contribution given its name.voidstart()Starts the service.voidstop()Stops the service.booleanuninstallContribution(Contribution contrib) Uninstalls a contribution given is name.updateContribution(Contribution contribution) Updates in the storage the given contribution modifications.
-
Method Details
-
getContributions
List<Contribution> getContributions()Gets a list with all persisted contributions. -
getContribution
Gets a contribution given its name. -
addContribution
Persists a new contribution. The contribution will not be installed. You need to explicitly callinstallContribution(Contribution)to install the contribution. -
removeContribution
Removes a persisted contribution given its name. The contribution will not be uninstalled before being removed. You need to explicitly calluninstallContribution(Contribution)to uninstall it.- Returns:
- true if the contribution was removed, false if the contribution was not found in persistence.
-
installContribution
Installs the contribution given its name. Return true if contribution install succeeds, false if the contribution is already installed.To be able to install a contribution you need to persist it first.
-
uninstallContribution
Uninstalls a contribution given is name. If not already installed return false otherwise return true. The contribution persisted state is not modified by this operation. -
updateContribution
Updates in the storage the given contribution modifications.A contribution cannot be renamed. The only permitted modifications are changing the description and the auto start status.
Return back the contribution object.
-
isInstalled
Checks whether a contribution is currently installed. -
isPersisted
Checks whether a contribution is currently persisted. -
start
void start()Starts the service. This will install all persisted contributions that are marked as auto-install. SeeContribution.isDisabled() -
stop
void stop()Stops the service. This will uninstall all installed contributions.
-