org.alfresco.repo.descriptor
Class DescriptorServiceImpl

java.lang.Object
  extended by org.springframework.extensions.surf.util.AbstractLifecycleBean
      extended by org.alfresco.repo.descriptor.DescriptorServiceImpl
All Implemented Interfaces:
java.util.EventListener, DescriptorService, LicenseService.LicenseChangeHandler, 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.


Nested Class Summary
static class DescriptorServiceImpl.BaseDescriptor
          Base class for Descriptor implementations, provides a default getVersion() implementation.
 
Field Summary
 
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log
 
Constructor Summary
DescriptorServiceImpl()
           
 
Method Summary
 void afterPropertiesSet()
          Initialise Descriptors.
 Descriptor getCurrentRepositoryDescriptor()
          Get current descriptor for the repository.
 Descriptor getInstalledRepositoryDescriptor()
          Get descriptor for the repository as it was when first installed.
 LicenseDescriptor getLicenseDescriptor()
          Gets the License Descriptor
 Descriptor getServerDescriptor()
          Get descriptor for the alfresco software installed on the server.
 java.lang.String loadLicense()
          Attempts to load the license.
protected  void onBootstrap(org.springframework.context.ApplicationEvent event)
          On bootstrap load the special services for LicenseComponent and HeartBeat Also set installedRepoDescriptor and update current
 void onLicenseChange(LicenseDescriptor licenseDescriptor)
          Notification of a license change.
 void onLicenseFail()
          Notification that a license have failed to validate
protected  void onShutdown(org.springframework.context.ApplicationEvent event)
           
 void setCurrentRepoDescriptorDAO(DescriptorDAO currentRepoDescriptorDAO)
          Sets the current repo descriptor DAO.
 void setInstalledRepoDescriptorDAO(DescriptorDAO installedRepoDescriptorDAO)
          Sets the installed repo descriptor DAO.
 void setRepoUsageComponent(RepoUsageComponent repoUsageComponent)
           
 void setServerDescriptorDAO(DescriptorDAO serverDescriptorDAO)
          Sets the server descriptor DAO.
 void setTransactionService(TransactionService transactionService)
          Sets the transaction service.
 
Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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

The following properties are not applicable to the server descriptor.

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

The following properties may be present

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

getLicenseDescriptor

public LicenseDescriptor getLicenseDescriptor()
Description copied from interface: DescriptorService
Gets the License Descriptor

Specified by:
getLicenseDescriptor in interface DescriptorService
Returns:
the license 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

onBootstrap

protected void onBootstrap(org.springframework.context.ApplicationEvent event)
On bootstrap load the special services for LicenseComponent and HeartBeat 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

onLicenseChange

public void onLicenseChange(LicenseDescriptor licenseDescriptor)
Description copied from interface: LicenseService.LicenseChangeHandler
Notification of a license change.

Specified by:
onLicenseChange in interface LicenseService.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:
onLicenseFail in interface LicenseService.LicenseChangeHandler


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.