from ion.util.enhanced_resource_registry_client import EnhancedResourceRegistryClient from ooi.logging import log from pyon.agent.agent import ResourceAgentClient from pyon.core.bootstrap import IonObject from pyon.core.exception import NotFound, Unauthorized, BadRequest from interface.objects import ComputedValueAvailability, ComputedIntValue, ComputedDictValue, ComputedListValue from interface.objects import AggregateStatusType, DeviceStatusType from pyon.ion.resource import RT, PRED from pyon.util.containers import DotDict # possible ways of determining the type of a device driver DriverTypingMethod = DotDict() DriverTypingMethod.ByRR = 1 DriverTypingMethod.ByAgent = 2 DriverTypingMethod.ByException = 3 class AgentStatusBuilder(object): def __init__(self, process=None): """ the process should be the "self" of a service instance """ assert process self.process = process self.dtm = DriverTypingMethod.ByRR self.RR2 = None # make an internal pointer to this function so we can Mock it for testing self._get_agent_client = ResourceAgentClient