'Get the application service state.
Args:
service(ApplicationService): The service whose state to set.
Returns:
A Deferred which resolves to ApplicationServiceState.'

@defer.inlineCallbacks
def get_appservice_state(self, service):

    result = (yield self._simple_select_one('application_services_state', dict(as_id=service.id), ['state'], allow_none=True, desc='get_appservice_state'))
    if result:
        defer.returnValue(result.get('state'))
        return
    defer.returnValue(None)
