Interface ContributionPersistenceManager
-
- All Known Implementing Classes:
ContributionPersistenceComponent
public interface ContributionPersistenceManager
- Author:
- Bogdan Stefanescu
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Contribution
addContribution(Contribution contrib)
Persists a new contribution.Contribution
getContribution(String name)
Gets a contribution given its name.List<Contribution>
getContributions()
Gets a list with all persisted contributions.boolean
installContribution(Contribution contrib)
Installs the contribution given its name.boolean
isInstalled(Contribution contrib)
Checks whether a contribution is currently installed.boolean
isPersisted(Contribution contrib)
Checks whether a contribution is currently persisted.boolean
removeContribution(Contribution contrib)
Removes a persisted contribution given its name.void
start()
Starts the service.void
stop()
Stops the service.boolean
uninstallContribution(Contribution contrib)
Uninstalls a contribution given is name.Contribution
updateContribution(Contribution contribution)
Updates in the storage the given contribution modifications.
-
-
-
Method Detail
-
getContributions
List<Contribution> getContributions()
Gets a list with all persisted contributions.
-
getContribution
Contribution getContribution(String name)
Gets a contribution given its name.
-
addContribution
Contribution addContribution(Contribution contrib)
Persists a new contribution. The contribution will not be installed. You need to explicitly callinstallContribution(Contribution)
to install the contribution.
-
removeContribution
boolean removeContribution(Contribution contrib)
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
boolean installContribution(Contribution contrib)
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
boolean uninstallContribution(Contribution contrib)
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
Contribution updateContribution(Contribution contribution)
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
boolean isInstalled(Contribution contrib)
Checks whether a contribution is currently installed.
-
isPersisted
boolean isPersisted(Contribution contrib)
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.
-
-