Class 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
    • Constructor Detail

      • DescriptorServiceImpl

        public DescriptorServiceImpl()
    • 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: DescriptorService
        Get 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
        The following properties are not applicable to the server descriptor.
        • id
        • licenceKey
        • name - unknown
        Specified by:
        getServerDescriptor in interface DescriptorService
        Returns:
        server descriptor
      • getCurrentRepositoryDescriptor

        public Descriptor getCurrentRepositoryDescriptor()
        Description copied from interface: DescriptorService
        Get 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
        The following properties may be present
        • LicenceKey
        • Edition
        Specified by:
        getCurrentRepositoryDescriptor in interface DescriptorService
        Returns:
        repository descriptor
      • getInstalledRepositoryDescriptor

        public Descriptor getInstalledRepositoryDescriptor()
        Description copied from interface: DescriptorService
        Get 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:
        getInstalledRepositoryDescriptor in interface DescriptorService
        Returns:
        repository descriptor
      • loadLicense

        public java.lang.String loadLicense()
        Attempts to load the license.
        Specified by:
        loadLicense in interface DescriptorService
        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:
        loadLicense in interface DescriptorService
        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:
        onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
      • onShutdown

        protected void onShutdown​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Initialise Descriptors.
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception - the exception
      • onLicenseFail

        public void onLicenseFail()
        Notification that a license have failed to validate

        Restrictions are not changed; previous restrictions remain in place.

        Specified by:
        onLicenseFail in interface LicenseService.LicenseChangeHandler
      • isBootstrapped

        public boolean isBootstrapped()
        Description copied from interface: DescriptorService
        Is this service bootstrapped?
        Specified by:
        isBootstrapped in interface DescriptorService
        Returns:
        true, the service is bootstrapped and available