-
- All Known Implementing Classes:
AgentConfigManager.AgentState
public interface AgentStateTheAgentStateinterface 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
Nested Classes Modifier and Type Interface Description static interfaceAgentState.ErrorDescriptor
-
Field Summary
Fields Modifier and Type Field Description static intSTATE_CONFIGUREDstatic intSTATE_CREATEDstatic intSTATE_INITIALIZEDstatic intSTATE_RESTOREDstatic intSTATE_RUNNINGstatic intSTATE_SAVEDstatic intSTATE_SHUTDOWNstatic intSTATE_SUSPENDED
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddError(AgentState.ErrorDescriptor error)Add an error description to the internal error list.voidadvanceState(int newState)Advance the state to the given state.List<AgentState.ErrorDescriptor>getErrors()Get the error descriptors associated with this agent state.intgetState()Gets the current state of the agent.voidsetState(int newState)Sets the new state independent from the current state.
-
-
-
Field Detail
-
STATE_CREATED
static final int STATE_CREATED
- See Also:
- Constant Field Values
-
STATE_INITIALIZED
static final int STATE_INITIALIZED
- See Also:
- Constant Field Values
-
STATE_CONFIGURED
static final int STATE_CONFIGURED
- See Also:
- Constant Field Values
-
STATE_RESTORED
static final int STATE_RESTORED
- See Also:
- Constant Field Values
-
STATE_SUSPENDED
static final int STATE_SUSPENDED
- See Also:
- Constant Field Values
-
STATE_RUNNING
static final int STATE_RUNNING
- See Also:
- Constant Field Values
-
STATE_SAVED
static final int STATE_SAVED
- See Also:
- Constant Field Values
-
STATE_SHUTDOWN
static final int STATE_SHUTDOWN
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
void addError(AgentState.ErrorDescriptor error)
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.
-
-