def edited(self, line, updated_fields): if updated_fields is None or updated_fields: self.send_sysconfd_handlers() serialized_line = LineSchema(only=LINE_FIELDS).dump(line) event = EditLineEvent(serialized_line) headers = self._build_headers(line) self.bus.send_bus_event(event, headers=headers)
def dissociated(self, line, device): self._reload_sccp(line) line_serialized = LineSchema(only=LINE_FIELDS).dump(line) device_serialized = DeviceSchema(only=DEVICE_FIELDS).dump(device) event = LineDeviceDissociatedEvent(line=line_serialized, device=device_serialized) self._bus.send_bus_event(event)
def associated(self, line, device): self._reload_sccp(line) line_serialized = LineSchema(only=LINE_FIELDS).dump(line) device_serialized = DeviceSchema(only=DEVICE_FIELDS).dump(device) event = LineDeviceAssociatedEvent(line=line_serialized, device=device_serialized) headers = self._build_headers(line) self._bus.send_bus_event(event, headers=headers)
def dissociated(self, line, endpoint): line_serialized = LineSchema(only=LINE_FIELDS).dump(line) sccp_serialized = SccpSchema(only=ENDPOINT_SCCP_FIELDS).dump(endpoint) event = LineEndpointSCCPDissociatedEvent( line=line_serialized, sccp=sccp_serialized, ) headers = self._build_headers(line) self.bus.send_bus_event(event, headers=headers)
def dissociated(self, line, application): self._sysconfd.exec_request_handlers(self.REQUEST_HANDLERS) line_serialized = LineSchema(only=LINE_FIELDS).dump(line) application_serialized = ApplicationSchema( only=APPLICATION_FIELDS).dump(application) event = LineApplicationDissociatedEvent( line=line_serialized, application=application_serialized) self._bus.send_bus_event(event)
def associated(self, line, endpoint): line_serialized = LineSchema(only=LINE_FIELDS).dump(line) sip_serialized = EndpointSIPSchema( only=ENDPOINT_SIP_FIELDS).dump(endpoint) event = LineEndpointSIPAssociatedEvent( line=line_serialized, sip=sip_serialized, ) headers = self._build_headers(line) self.bus.send_bus_event(event, headers=headers)
def dissociated(self, line, endpoint): line_serialized = LineSchema(only=LINE_FIELDS).dump(line) custom_serialized = CustomSchema( only=ENDPOINT_CUSTOM_FIELDS).dump(endpoint) event = LineEndpointCustomDissociatedEvent( line=line_serialized, custom=custom_serialized, ) headers = self._build_headers(line) self.bus.send_bus_event(event, headers=headers)
def dissociated(self, user_line): self._send_sysconfd_handlers() user_serialized = UserSchema(only=USER_FIELDS).dump(user_line.user) line_serialized = LineSchema(only=LINE_FIELDS).dump(user_line.line) event = UserLineDissociatedEvent( user=user_serialized, line=line_serialized, main_user=user_line.main_user, main_line=user_line.main_line, ) self._bus.send_bus_event(event)
def deleted(self, line): self.send_sysconfd_handlers() serialized_line = LineSchema(only=LINE_FIELDS).dump(line) event = DeleteLineEvent(serialized_line) headers = self._build_headers(line) self.bus.send_bus_event(event, headers=headers)