org.ow2.jasmine.jadort.service.implementation
Class JadortServiceStatefulBean

java.lang.Object
  extended by org.ow2.jasmine.jadort.service.implementation.OperationPersistenceManager
      extended by org.ow2.jasmine.jadort.service.implementation.ActionManager
          extended by org.ow2.jasmine.jadort.service.implementation.StepManager
              extended by org.ow2.jasmine.jadort.service.implementation.JadortServiceStatefulBean
All Implemented Interfaces:
org.ow2.jasmine.jadort.api.IJadortService

public class JadortServiceStatefulBean
extends StepManager
implements org.ow2.jasmine.jadort.api.IJadortService

Stateful session bean that provides the JaDOrT service.

Author:
Malek Chahine, Remy Bresson, S. Ali Tokmen

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.jasmine.jadort.api.IJadortService
org.ow2.jasmine.jadort.api.IJadortService.OperationType
 
Field Summary
 
Fields inherited from class org.ow2.jasmine.jadort.service.implementation.OperationPersistenceManager
em, operation
 
Fields inherited from interface org.ow2.jasmine.jadort.api.IJadortService
EJB_JNDI_NAME
 
Constructor Summary
JadortServiceStatefulBean()
           
 
Method Summary
 void abortServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
          
 void abortWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
          
 boolean checkServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
          
 boolean checkWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
          
 void createNewOperation(java.lang.String newOperationName)
          
 void deleteOperation(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean selectedOperation)
          
 org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean getCurrentOperation()
          
 org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean.Step getCurrentStep()
          

IMPORTANT: Avoid calling this method from inside other methods of the JadortServiceStatefulBean class (it will be costly)
 java.util.List<org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean> getOperationsList()
          
 void ignoreServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
          
 void ignoreWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
          
protected  void initialize()
           
 void loadTopology(java.io.File xmlTopoFile)
          
 void next()
          
 void previous()
          
 void restartServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
          
 void restartWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
          
 void selectApplication(java.net.URL url)
          
 void selectGroup(org.ow2.jasmine.jadort.api.entities.topology.GroupBean selectedGroup)
          
 void selectOperation(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean selectedOperation)
          
 void selectOperationType(org.ow2.jasmine.jadort.api.IJadortService.OperationType operationType)
          
 void selectServers(java.util.List<org.ow2.jasmine.jadort.api.entities.topology.ServerBean> selectedServers)
          
 void selectVMImage(org.ow2.jasmine.jadort.api.entities.deployment.VMImageBean selectedVMImage)
          
 void selectVMImage(org.ow2.jasmine.jadort.api.entities.deployment.VMImageBean selectedVMImage, org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
          
protected  void terminate()
           
 
Methods inherited from class org.ow2.jasmine.jadort.service.implementation.StepManager
canGoToNextStep, canGoToPreviousStep, checkStep, executeNextStep, executePreviousStep
 
Methods inherited from class org.ow2.jasmine.jadort.service.implementation.ActionManager
checkApplication, fetchGroups, fillApplications, fillVMImages, fillWorkerProgressListBasedOnServerProgressList, getServerProgress, getWorkerProgress, isSameApplication, reachAimedServerProgressState, reachAimedWorkerProgressState, refreshActiveSessions
 
Methods inherited from class org.ow2.jasmine.jadort.service.implementation.OperationPersistenceManager
mergeOperation, refreshOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JadortServiceStatefulBean

public JadortServiceStatefulBean()
Method Detail

initialize

@PostConstruct
protected void initialize()

terminate

@PreDestroy
protected void terminate()

getCurrentStep

public org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean.Step getCurrentStep()


IMPORTANT: Avoid calling this method from inside other methods of the JadortServiceStatefulBean class (it will be costly)

Specified by:
getCurrentStep in interface org.ow2.jasmine.jadort.api.IJadortService

getOperationsList

public java.util.List<org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean> getOperationsList()
                                                                                                    throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
getOperationsList in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if the getOperationsList() method can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_OPERATION step)

deleteOperation

public void deleteOperation(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean selectedOperation)
                     throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
deleteOperation in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the selectOperation can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_OPERATION step)
  • if the operation to delete is still in progress in a critical phase and therefore cannot be deleted

selectOperation

public void selectOperation(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean selectedOperation)
                     throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
selectOperation in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if the selectOperation can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_OPERATION step)

createNewOperation

public void createNewOperation(java.lang.String newOperationName)
                        throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
createNewOperation in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the selectOperation can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_OPERATION step)

getCurrentOperation

public org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean getCurrentOperation()
                                                                                      throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
getCurrentOperation in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - If fetching fails.

next

public void next()
          throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
next in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if going to the next step is not allowed.

previous

public void previous()
              throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
previous in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if going to the previous step is not allowed.

loadTopology

public void loadTopology(java.io.File xmlTopoFile)
                  throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
loadTopology in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the loadTopology can not be called in the current step. (this method can be called only in the OperationStateBean.Step.INITIALIZE_TOPOLOGY step)
  • if an error is occurred when parsing the .xml file

selectGroup

public void selectGroup(org.ow2.jasmine.jadort.api.entities.topology.GroupBean selectedGroup)
                 throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
selectGroup in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if the selectedGroup method can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_GROUP step)

selectOperationType

public void selectOperationType(org.ow2.jasmine.jadort.api.IJadortService.OperationType operationType)
                         throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
selectOperationType in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if the selectedGroup method can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_OPERATION_TYPE step)

selectApplication

public void selectApplication(java.net.URL url)
                       throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
selectApplication in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the selectApplication can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_APPLICATION step)

selectVMImage

public void selectVMImage(org.ow2.jasmine.jadort.api.entities.deployment.VMImageBean selectedVMImage)
                   throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
selectVMImage in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
JadortServiceException
    -
  • if the selectVMImage can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_VM_IMAGE_FOR_SERVER step)
  • or if selectedVMImage is not known
  • or if fetching fails
org.ow2.jasmine.jadort.api.JadortServiceException

selectVMImage

public void selectVMImage(org.ow2.jasmine.jadort.api.entities.deployment.VMImageBean selectedVMImage,
                          org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
                   throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
selectVMImage in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
JadortServiceException
    -
  • if the selectVMImage can not be called in the current step. (this method can be called only in the OperationStateBean.Step.SELECT_VM_IMAGE step)
  • or if selectedVMImage is not known
  • or if server is not known
  • or if fetching fails
org.ow2.jasmine.jadort.api.JadortServiceException

selectServers

public void selectServers(java.util.List<org.ow2.jasmine.jadort.api.entities.topology.ServerBean> selectedServers)
                   throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
selectServers in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if the selectServers method can not be called in the current step (this method can be called only in the OperationStateBean.Step.SELECT_SERVERS step)

abortServer

public void abortServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
                 throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
abortServer in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - If the abortServer can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MIGRATION, OperationStateBean.Step.UNDEPLOY_ERASE_OLD_VERSION, OperationStateBean.Step.EXECUTING_MIGRATION_OSGI, OperationStateBean.Step.ERASE_OLD_VERSIONS, OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)

restartServer

public void restartServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
                   throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
restartServer in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the restartServermethod can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MIGRATION, OperationStateBean.Step.UNDEPLOY_ERASE_OLD_VERSION, OperationStateBean.Step.EXECUTING_MIGRATION_OSGI, OperationStateBean.Step.ERASE_OLD_VERSIONS, OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)
  • if the server state is not in error state.

checkServer

public boolean checkServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
                    throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
checkServer in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if the checkServer can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MIGRATION, OperationStateBean.Step.UNDEPLOY_ERASE_OLD_VERSION, OperationStateBean.Step.EXECUTING_MIGRATION_OSGI, OperationStateBean.Step.ERASE_OLD_VERSIONS, OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)

ignoreServer

public void ignoreServer(org.ow2.jasmine.jadort.api.entities.topology.ServerBean server)
                  throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
ignoreServer in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the ignoreServer can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MIGRATION, OperationStateBean.Step.UNDEPLOY_ERASE_OLD_VERSION, OperationStateBean.Step.EXECUTING_MIGRATION_OSGI, OperationStateBean.Step.ERASE_OLD_VERSIONS, OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)
  • if the server state is not in error state.

abortWorker

public void abortWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
                 throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
abortWorker in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - If the abortWorker can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)

restartWorker

public void restartWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
                   throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
restartWorker in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the restartWorkermethod can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)
  • if the worker state is not in error state.

checkWorker

public boolean checkWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
                    throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
checkWorker in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException - if the checkWorker can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)

ignoreWorker

public void ignoreWorker(org.ow2.jasmine.jadort.api.entities.topology.WorkerBean worker)
                  throws org.ow2.jasmine.jadort.api.JadortServiceException

Specified by:
ignoreWorker in interface org.ow2.jasmine.jadort.api.IJadortService
Throws:
org.ow2.jasmine.jadort.api.JadortServiceException -
  • if the ignoreWorker can not be called in the current step. (this method can be called only in the OperationStateBean.Step.EXECUTING_MAINTENANCE_CLUSTER and OperationStateBean.Step.EXECUTING_MAINTENANCE_NO_CLUSTER steps)
  • if the worker state is not in error state.


Copyright © 2009 OW2 Consortium. All Rights Reserved.