API for the connection to forward
        information to this subscription instance.

        :param data: The JSON data which was received.
        :type data: Message

def received(self, data):
        """
        API for the connection to forward
        information to this subscription instance.

        :param data: The JSON data which was received.
        :type data: Message
        """
        self.logger.debug('Data received: {}'.format(data))

        message_type = None

        if 'type' in data:
            message_type = data['type']

        if message_type == 'confirm_subscription':
            self._subscribed()
        elif message_type == 'reject_subscription':
            self._rejected()
        elif self.receive_callback is not None and 'message' in data:
            self.receive_callback(data['message'])
        else:
            self.logger.warning('Message type unknown. ({})'.format(message_type))