- All Known Implementing Classes:
AgentConfigManager.AgentState
public interface AgentState
The
AgentState
interface provides information about the state of a SNMP agent.
States are represented by integer values. This allows implementing classes to extend
states supported by an agent.- Since:
- 3.0
- Version:
- 3.0.2
- Author:
- Frank Fock
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
TheAgentState.ErrorDescriptor
provides detailed information about the agent state change problem. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Agent has been configured.static final int
Agent has been created.static final int
Agent has been initialized.static final int
Agent's state has been restored.static final int
Agent is running.static final int
Agent's state has been saved.static final int
Agent has been shutdown.static final int
Agent is suspended, i.e. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an error description to the internal error list.void
advanceState
(int newState) Advance the state to the given state.Get the error descriptors associated with this agent state.int
getState()
Gets the current state of the agent.void
setState
(int newState) Sets the new state independent from the current state.
-
Field Details
-
STATE_CREATED
static final int STATE_CREATEDAgent has been created.- See Also:
-
STATE_INITIALIZED
static final int STATE_INITIALIZEDAgent has been initialized.- See Also:
-
STATE_CONFIGURED
static final int STATE_CONFIGUREDAgent has been configured.- See Also:
-
STATE_RESTORED
static final int STATE_RESTOREDAgent's state has been restored.- See Also:
-
STATE_SUSPENDED
static final int STATE_SUSPENDEDAgent is suspended, i.e. does not accept/answer communication requests.- See Also:
-
STATE_RUNNING
static final int STATE_RUNNINGAgent is running.- See Also:
-
STATE_SAVED
static final int STATE_SAVEDAgent's state has been saved.- See Also:
-
STATE_SHUTDOWN
static final int STATE_SHUTDOWNAgent has been shutdown.- See Also:
-
-
Method Details
-
getState
int getState()Gets the current state of the agent.- Returns:
- an integer representing the current state. See
STATE_CREATED
.
-
setState
void setState(int newState) Sets the new state independent from the current state.- Parameters:
newState
- the new state.
-
advanceState
void advanceState(int newState) Advance the state to the given state. If the current state is greater than the provided state, the current state will not be changed.- Parameters:
newState
- the new minimum state.
-
addError
Add an error description to the internal error list.- Parameters:
error
- an ErrorDescriptor instance to add.
-
getErrors
List<AgentState.ErrorDescriptor> getErrors()Get the error descriptors associated with this agent state.- Returns:
- the errors descriptor list.
-