Package org.alfresco.repo.descriptor
Class DescriptorServiceImpl
java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.descriptor.DescriptorServiceImpl
- All Implemented Interfaces:
EventListener,DescriptorService,LicenseService.LicenseChangeHandler,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class DescriptorServiceImpl
extends org.springframework.extensions.surf.util.AbstractLifecycleBean
implements DescriptorService, org.springframework.beans.factory.InitializingBean, LicenseService.LicenseChangeHandler
Implementation of Descriptor Service.
- Author:
- David Caruana
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase class for Descriptor implementations, provides a default getVersion() implementation. -
Field Summary
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitialise Descriptors.Get current descriptor for the repository.Get descriptor for the repository as it was when first installed.Gets the License DescriptorGet descriptor for the alfresco software installed on the server.booleanIs this service bootstrapped?Attempts to load the license.loadLicense(InputStream licenseStream) Attempts to load the license from the input stream.protected voidonBootstrap(org.springframework.context.ApplicationEvent event) On bootstrap load the special services for LicenseComponent Also set installedRepoDescriptor and update currentvoidonLicenseChange(LicenseDescriptor licenseDescriptor) Notification of a license change.voidNotification that a license have failed to validateprotected voidonShutdown(org.springframework.context.ApplicationEvent event) voidsetCurrentRepoDescriptorDAO(DescriptorDAO currentRepoDescriptorDAO) Sets the current repo descriptor DAO.voidsetHbDataCollectorService(HBDataCollectorService hbDataCollectorService) voidsetInstalledRepoDescriptorDAO(DescriptorDAO installedRepoDescriptorDAO) Sets the installed repo descriptor DAO.voidsetRepoUsageComponent(RepoUsageComponent repoUsageComponent) voidsetServerDescriptorDAO(DescriptorDAO serverDescriptorDAO) Sets the server descriptor DAO.voidsetTransactionService(TransactionService transactionService) Sets the transaction service.Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
DescriptorServiceImpl
public DescriptorServiceImpl()
-
-
Method Details
-
setServerDescriptorDAO
Sets the server descriptor DAO.- Parameters:
serverDescriptorDAO- the new server descriptor DAO
-
setCurrentRepoDescriptorDAO
Sets the current repo descriptor DAO.- Parameters:
currentRepoDescriptorDAO- the new current repo descriptor DAO
-
setInstalledRepoDescriptorDAO
Sets the installed repo descriptor DAO.- Parameters:
installedRepoDescriptorDAO- the new installed repo descriptor DAO
-
setTransactionService
Sets the transaction service.- Parameters:
transactionService- transaction service
-
setHbDataCollectorService
-
setRepoUsageComponent
-
getServerDescriptor
Description copied from interface:DescriptorServiceGet descriptor for the alfresco software installed on the server.The information contained by this descriptor is read from a property file. The following properties are available in the descriptor
- Major
- Minor
- Revision
- Label
- Build
- Edition
- Schema
- id
- licenceKey
- name - unknown
- Specified by:
getServerDescriptorin interfaceDescriptorService- Returns:
- server descriptor
-
getCurrentRepositoryDescriptor
Description copied from interface:DescriptorServiceGet current descriptor for the repository.The information in this descriptor is read from a node in the system store. After the patch process runs successfully, the version Major/Minor/Revision should be equal to the server descriptor.
The "repository id" that uniquely identifies each alfresco repository is available in the "id" property.
The following properties are available in the descriptor
- Major
- Minor
- Revision
- Label
- Build
- Schema
- name
- id
- LicenceKey
- Edition
- Specified by:
getCurrentRepositoryDescriptorin interfaceDescriptorService- Returns:
- repository descriptor
-
getInstalledRepositoryDescriptor
Description copied from interface:DescriptorServiceGet descriptor for the repository as it was when first installed.The information in this descriptor is read from a node in the system store.
- Specified by:
getInstalledRepositoryDescriptorin interfaceDescriptorService- Returns:
- repository descriptor
-
getLicenseDescriptor
Description copied from interface:DescriptorServiceGets the License Descriptor- Specified by:
getLicenseDescriptorin interfaceDescriptorService- Returns:
- the license descriptor
-
loadLicense
Attempts to load the license.- Specified by:
loadLicensein interfaceDescriptorService- Returns:
- Returns a message telling the user what happened
-
loadLicense
Attempts to load the license from the input stream.- Specified by:
loadLicensein interfaceDescriptorService- Returns:
- Returns a message telling the user what happened
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event) On bootstrap load the special services for LicenseComponent Also set installedRepoDescriptor and update current- Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event) - Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
afterPropertiesSet
Initialise Descriptors.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- the exception
-
onLicenseChange
Description copied from interface:LicenseService.LicenseChangeHandlerNotification of a license change.- Specified by:
onLicenseChangein interfaceLicenseService.LicenseChangeHandler- Parameters:
licenseDescriptor- the new license (never null)
-
onLicenseFail
public void onLicenseFail()Notification that a license have failed to validate Restrictions are not changed; previous restrictions remain in place.- Specified by:
onLicenseFailin interfaceLicenseService.LicenseChangeHandler
-
isBootstrapped
public boolean isBootstrapped()Description copied from interface:DescriptorServiceIs this service bootstrapped?- Specified by:
isBootstrappedin interfaceDescriptorService- Returns:
- true, the service is bootstrapped and available
-