org.ow2.petals.system.systemstate
Class SystemStateServiceImpl

java.lang.Object
  extended by org.ow2.petals.system.systemstate.SystemStateServiceImpl
All Implemented Interfaces:
SystemStateService

public class SystemStateServiceImpl
extends java.lang.Object
implements SystemStateService

Creates and reads state files for components, shared libs and service assemblies. State files are text files that keep the state of JBI entities to allow state retreval after Petals system shutdown or crash.

Author:
alouis - EBM Websourcing, rnaudin - EBM Websourcing

Constructor Summary
SystemStateServiceImpl()
           
 
Method Summary
 org.ow2.petals.systemstate.generated.Component createComponentStateHolder(java.lang.String componentName, java.net.URL installUrl, java.lang.String archiveName)
          Create a Component entry in the System State.
 org.ow2.petals.systemstate.generated.ServiceAssembly createServiceAssemblyStateHolder(java.lang.String saName, java.net.URL installUrl, java.lang.String archiveName)
          Create a ServiceAssembly entry in the System State.
 org.ow2.petals.systemstate.generated.SharedLibrary createSharedLibraryStateHolder(java.lang.String slName, java.lang.String version, java.net.URL installUrl, java.lang.String archiveName)
          Create a SharedLibrary entry in the System State.
 org.ow2.petals.systemstate.generated.Component deleteComponentStateHolder(java.lang.String componentName)
          Delete a Component entry from the System State.
 org.ow2.petals.systemstate.generated.ServiceAssembly deleteServiceAssemblyStateHolder(java.lang.String saName)
          Delete a ServiceAssembly entry from the System State.
 org.ow2.petals.systemstate.generated.SharedLibrary deleteSharedLibraryStateHolder(java.lang.String slName, java.lang.String version)
          Delete a SharedLibrary entry from the System State.
 org.ow2.petals.systemstate.generated.Component getComponentStateHolder(java.lang.String componentName)
          Get the Component entry from the System State.
 java.util.List<org.ow2.petals.systemstate.generated.Component> getComponentStateHolders()
          Get the Components entries from the System State.
 org.ow2.petals.systemstate.generated.ServiceAssembly getServiceAssemblyStateHolder(java.lang.String saName)
          Get the ServiceAssembly entry from the System State.
 java.util.List<org.ow2.petals.systemstate.generated.ServiceAssembly> getServiceAssemblyStateHolders()
          Get the ServiceAssemblys entries from the System State.
 org.ow2.petals.systemstate.generated.SharedLibrary getSharedLibraryStateHolder(java.lang.String slName, java.lang.String version)
          Get the SharedLibrary entry from the System State.
 java.util.List<org.ow2.petals.systemstate.generated.SharedLibrary> getSharedLibraryStateHolders()
          Get the SharedLibrarys entries from the System State.
 java.util.List<org.ow2.petals.systemstate.generated.SharedLibrary> getSharedLibraryStateHolders(java.lang.String slName)
          Get the SharedLibrarys entries from the System State matching the given name.
 boolean isComponentInstalled(java.lang.String componentName)
          Check if the given component is already installed
protected  void start()
          Initialize the SystemState Service.
protected  void stop()
           
 void updateComponentInstallationState(java.lang.String componentName, java.lang.String installState)
          Update the given component installation state.
 void updateComponentLifeCycleState(java.lang.String componentName, java.lang.String lifecycleState)
          Update the given component lifecycle state.
 void updateServiceAssemblyState(java.lang.String saName, java.lang.String lifecycleState)
          Update the given service assembly state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemStateServiceImpl

public SystemStateServiceImpl()
Method Detail

createComponentStateHolder

public org.ow2.petals.systemstate.generated.Component createComponentStateHolder(java.lang.String componentName,
                                                                                 java.net.URL installUrl,
                                                                                 java.lang.String archiveName)
                                                                          throws ComponentAlreadyExistsException,
                                                                                 org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Create a Component entry in the System State.

Specified by:
createComponentStateHolder in interface SystemStateService
Returns:
the created Component entry
Throws:
org.ow2.petals.systemstate.SystemStateException - failed to persist the new System State
ComponentAlreadyExistsException

createServiceAssemblyStateHolder

public org.ow2.petals.systemstate.generated.ServiceAssembly createServiceAssemblyStateHolder(java.lang.String saName,
                                                                                             java.net.URL installUrl,
                                                                                             java.lang.String archiveName)
                                                                                      throws ServiceAssemblyAlreadyExistsException,
                                                                                             org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Create a ServiceAssembly entry in the System State.

Specified by:
createServiceAssemblyStateHolder in interface SystemStateService
Returns:
the created ServiceAssembly
Throws:
org.ow2.petals.systemstate.SystemStateException - failed to persist the new System State
ServiceAssemblyAlreadyExistsException

createSharedLibraryStateHolder

public org.ow2.petals.systemstate.generated.SharedLibrary createSharedLibraryStateHolder(java.lang.String slName,
                                                                                         java.lang.String version,
                                                                                         java.net.URL installUrl,
                                                                                         java.lang.String archiveName)
                                                                                  throws org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Create a SharedLibrary entry in the System State.

Specified by:
createSharedLibraryStateHolder in interface SystemStateService
Returns:
the created SharedLibrary
Throws:
org.ow2.petals.systemstate.SystemStateException - failed to persist the new System State

deleteComponentStateHolder

public org.ow2.petals.systemstate.generated.Component deleteComponentStateHolder(java.lang.String componentName)
                                                                          throws org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Delete a Component entry from the System State.

Specified by:
deleteComponentStateHolder in interface SystemStateService
Returns:
the deleted entry or null if not found
Throws:
org.ow2.petals.systemstate.SystemStateException - failed to persist the new System State

deleteServiceAssemblyStateHolder

public org.ow2.petals.systemstate.generated.ServiceAssembly deleteServiceAssemblyStateHolder(java.lang.String saName)
                                                                                      throws org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Delete a ServiceAssembly entry from the System State.

Specified by:
deleteServiceAssemblyStateHolder in interface SystemStateService
Returns:
the deleted entry or null if not found
Throws:
org.ow2.petals.systemstate.SystemStateException - failed to persist the new System State

deleteSharedLibraryStateHolder

public org.ow2.petals.systemstate.generated.SharedLibrary deleteSharedLibraryStateHolder(java.lang.String slName,
                                                                                         java.lang.String version)
                                                                                  throws org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Delete a SharedLibrary entry from the System State.

Specified by:
deleteSharedLibraryStateHolder in interface SystemStateService
Returns:
the deleted entry or null if not found
Throws:
org.ow2.petals.systemstate.SystemStateException - failed to persist the new System State

getComponentStateHolder

public org.ow2.petals.systemstate.generated.Component getComponentStateHolder(java.lang.String componentName)
Description copied from interface: SystemStateService
Get the Component entry from the System State.

Specified by:
getComponentStateHolder in interface SystemStateService
Returns:
the Component entry or null if not found

getComponentStateHolders

public java.util.List<org.ow2.petals.systemstate.generated.Component> getComponentStateHolders()
Description copied from interface: SystemStateService
Get the Components entries from the System State.

Specified by:
getComponentStateHolders in interface SystemStateService
Returns:
the list of Components entries

getServiceAssemblyStateHolder

public org.ow2.petals.systemstate.generated.ServiceAssembly getServiceAssemblyStateHolder(java.lang.String saName)
Description copied from interface: SystemStateService
Get the ServiceAssembly entry from the System State.

Specified by:
getServiceAssemblyStateHolder in interface SystemStateService
Returns:
the ServiceAssembly entry or null if not found

getServiceAssemblyStateHolders

public java.util.List<org.ow2.petals.systemstate.generated.ServiceAssembly> getServiceAssemblyStateHolders()
Description copied from interface: SystemStateService
Get the ServiceAssemblys entries from the System State.

Specified by:
getServiceAssemblyStateHolders in interface SystemStateService
Returns:
the list of ServiceAssemblys entries

getSharedLibraryStateHolder

public org.ow2.petals.systemstate.generated.SharedLibrary getSharedLibraryStateHolder(java.lang.String slName,
                                                                                      java.lang.String version)
Description copied from interface: SystemStateService
Get the SharedLibrary entry from the System State.

Specified by:
getSharedLibraryStateHolder in interface SystemStateService
Returns:
the SharedLibrary entry or null if not found

getSharedLibraryStateHolders

public java.util.List<org.ow2.petals.systemstate.generated.SharedLibrary> getSharedLibraryStateHolders()
Description copied from interface: SystemStateService
Get the SharedLibrarys entries from the System State.

Specified by:
getSharedLibraryStateHolders in interface SystemStateService
Returns:
the list of SharedLibrarys entries

getSharedLibraryStateHolders

public java.util.List<org.ow2.petals.systemstate.generated.SharedLibrary> getSharedLibraryStateHolders(java.lang.String slName)
Description copied from interface: SystemStateService
Get the SharedLibrarys entries from the System State matching the given name.

Specified by:
getSharedLibraryStateHolders in interface SystemStateService
Returns:
the list of SharedLibrarys entries

isComponentInstalled

public boolean isComponentInstalled(java.lang.String componentName)
Description copied from interface: SystemStateService
Check if the given component is already installed

Specified by:
isComponentInstalled in interface SystemStateService
Returns:
true if already installed, false otherwise

updateComponentInstallationState

public void updateComponentInstallationState(java.lang.String componentName,
                                             java.lang.String installState)
                                      throws org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Update the given component installation state.

Specified by:
updateComponentInstallationState in interface SystemStateService
Throws:
org.ow2.petals.systemstate.SystemStateException

updateComponentLifeCycleState

public void updateComponentLifeCycleState(java.lang.String componentName,
                                          java.lang.String lifecycleState)
                                   throws org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Update the given component lifecycle state.

Specified by:
updateComponentLifeCycleState in interface SystemStateService
Throws:
org.ow2.petals.systemstate.SystemStateException

updateServiceAssemblyState

public void updateServiceAssemblyState(java.lang.String saName,
                                       java.lang.String lifecycleState)
                                throws org.ow2.petals.systemstate.SystemStateException
Description copied from interface: SystemStateService
Update the given service assembly state.

Specified by:
updateServiceAssemblyState in interface SystemStateService
Throws:
org.ow2.petals.systemstate.SystemStateException

start

protected void start()
              throws java.io.IOException,
                     org.ow2.petals.systemstate.SystemStateException
Initialize the SystemState Service.

Throws:
java.io.IOException
org.ow2.petals.systemstate.SystemStateException
java.net.URISyntaxException

stop

protected void stop()


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.