public class StateManagement extends Observable
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_STATE |
static String |
AVAILABLE_STATUS |
static String |
COLD_STANDBY |
static String |
DEMOTE |
static String |
DEPENDENCY |
static String |
DEPENDENCY_FAILED |
static String |
DISABLE_DEPENDENCY |
static String |
DISABLE_FAILED |
static String |
DISABLED |
static String |
ENABLE_NO_DEPENDENCY |
static String |
ENABLE_NOT_FAILED |
static String |
ENABLED |
static String |
FAILED |
static String |
HOT_STANDBY |
static String |
LOCK |
static String |
LOCKED |
static String |
NULL_VALUE |
static String |
OPERATION_STATE |
static String |
PROMOTE |
static String |
PROVIDING_SERVICE |
static String |
STANDBY_STATUS |
static String |
UNLOCK |
static String |
UNLOCKED |
Constructor and Description |
---|
StateManagement(javax.persistence.EntityManagerFactory emf,
String resourceName)
StateManagement constructor
|
Modifier and Type | Method and Description |
---|---|
void |
deleteAllStateManagementEntities()
Clean up all the StateManagementEntities
|
void |
demote()
demote() changes standbystatus to hotstandby or, if failed, coldstandby
|
void |
demote(String otherResourceName)
Only used for a remote resource.
|
void |
disableDependency()
disableDependency() changes operational state to disabled and adds availability status of "dependency"
|
void |
disableFailed()
disableFailed() changes the operational state to disabled and adds availability status of "failed"
|
void |
disableFailed(String otherResourceName)
This version of disableFailed is to be used to manipulate the state of a remote resource in the event
that remote resource has failed but its state is still showing that it is viable.
|
void |
enableNoDependency()
enableNoDependency() removes the availability status of "dependency " and will change the
operational state to enabled if not otherwise failed.
|
void |
enableNotFailed()
enableNotFailed() removes the "failed" availability status and changes the operational
state to enabled if no dependency is also failed.
|
String |
getAdminState() |
String |
getAvailStatus() |
String |
getOpState() |
String |
getStandbyStatus() |
String |
getStandbyStatus(String otherResourceName)
Get the standbystatus of a particular resource
|
void |
initializeState()
initializeState() is called when it is necessary to set the StateManagement to a known initial state.
|
void |
lock()
lock() changes the administrative state to locked.
|
void |
promote()
promote() changes the standby status to providingservice if not otherwise failed.
|
void |
unlock()
unlock() changes the administrative state to unlocked.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public static final String LOCKED
public static final String UNLOCKED
public static final String ENABLED
public static final String DISABLED
public static final String ENABLE_NOT_FAILED
public static final String DISABLE_FAILED
public static final String FAILED
public static final String DEPENDENCY
public static final String DEPENDENCY_FAILED
public static final String DISABLE_DEPENDENCY
public static final String ENABLE_NO_DEPENDENCY
public static final String NULL_VALUE
public static final String LOCK
public static final String UNLOCK
public static final String PROMOTE
public static final String DEMOTE
public static final String HOT_STANDBY
public static final String COLD_STANDBY
public static final String PROVIDING_SERVICE
public static final String ADMIN_STATE
public static final String OPERATION_STATE
public static final String AVAILABLE_STATUS
public static final String STANDBY_STATUS
public void initializeState() throws Exception
Exception
public void lock() throws Exception
Exception
public void unlock() throws Exception
Exception
public void enableNotFailed() throws Exception
Exception
public void disableFailed() throws Exception
Exception
public void disableFailed(String otherResourceName) throws Exception
Exception
public void disableDependency() throws Exception
Exception
public void enableNoDependency() throws Exception
Exception
public void promote() throws StandbyStatusException, Exception
StandbyStatusException
Exception
public void demote() throws Exception
Exception
public void demote(String otherResourceName) throws Exception
otherResourceName
- Exception
public String getAdminState()
public String getOpState()
public String getAvailStatus()
public String getStandbyStatus()
public String getStandbyStatus(String otherResourceName)
otherResourceName
- public void deleteAllStateManagementEntities()
Copyright © 2017. All rights reserved.