Package org.alfresco.repo.descriptor
Class DescriptorServiceImpl
- java.lang.Object
-
- org.springframework.extensions.surf.util.AbstractLifecycleBean
-
- org.alfresco.repo.descriptor.DescriptorServiceImpl
-
- All Implemented Interfaces:
java.util.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 Classes Modifier and Type Class Description static classDescriptorServiceImpl.BaseDescriptorBase class for Descriptor implementations, provides a default getVersion() implementation.
-
Constructor Summary
Constructors Constructor Description DescriptorServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Initialise Descriptors.DescriptorgetCurrentRepositoryDescriptor()Get current descriptor for the repository.DescriptorgetInstalledRepositoryDescriptor()Get descriptor for the repository as it was when first installed.LicenseDescriptorgetLicenseDescriptor()Gets the License DescriptorDescriptorgetServerDescriptor()Get descriptor for the alfresco software installed on the server.booleanisBootstrapped()Is this service bootstrapped?java.lang.StringloadLicense()Attempts to load the license.java.lang.StringloadLicense(java.io.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.voidonLicenseFail()Notification 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.
-
-
-
Method Detail
-
setServerDescriptorDAO
public void setServerDescriptorDAO(DescriptorDAO serverDescriptorDAO)
Sets the server descriptor DAO.- Parameters:
serverDescriptorDAO- the new server descriptor DAO
-
setCurrentRepoDescriptorDAO
public void setCurrentRepoDescriptorDAO(DescriptorDAO currentRepoDescriptorDAO)
Sets the current repo descriptor DAO.- Parameters:
currentRepoDescriptorDAO- the new current repo descriptor DAO
-
setInstalledRepoDescriptorDAO
public void setInstalledRepoDescriptorDAO(DescriptorDAO installedRepoDescriptorDAO)
Sets the installed repo descriptor DAO.- Parameters:
installedRepoDescriptorDAO- the new installed repo descriptor DAO
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
Sets the transaction service.- Parameters:
transactionService- transaction service
-
setHbDataCollectorService
public void setHbDataCollectorService(HBDataCollectorService hbDataCollectorService)
-
setRepoUsageComponent
public void setRepoUsageComponent(RepoUsageComponent repoUsageComponent)
-
getServerDescriptor
public Descriptor 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
public 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
public 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
public LicenseDescriptor getLicenseDescriptor()
Description copied from interface:DescriptorServiceGets the License Descriptor- Specified by:
getLicenseDescriptorin interfaceDescriptorService- Returns:
- the license descriptor
-
loadLicense
public java.lang.String loadLicense()
Attempts to load the license.- Specified by:
loadLicensein interfaceDescriptorService- Returns:
- Returns a message telling the user what happened
-
loadLicense
public java.lang.String loadLicense(java.io.InputStream licenseStream)
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
public void afterPropertiesSet() throws java.lang.ExceptionInitialise Descriptors.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception- the exception
-
onLicenseChange
public void onLicenseChange(LicenseDescriptor licenseDescriptor)
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
-
-