@Override
    public Object receiveData(Identifiable data) {
        Object result = GenericResponses.ILLEGAL_DATA;

        if (data instanceof DataPacketImpl) {
            final DataPacketImpl dp = (DataPacketImpl) data;
            final Object innerData = dp.getData();
            if (innerData instanceof Message) {
                final Message m = (Message) innerData;
                final String header = m.getHeader();
                result = GenericResponses.ILLEGAL_HEADER;
                if (header != null) {
                    if (header.equals(SystemMessageHeaders.LOGIN)) {
                        final Object mData = m.getData();
                        if (mData instanceof UUID) {
                            serverInterface.setServerInfo(dp.getSourceIP(), GlobalConstants.DEFAULT_PORT, (UUID) mData);
                            LOG.log(
                                    Level.INFO,
                                    "Registered to new server at " + dp.getSourceIP().getHostAddress() + " on port " + GlobalConstants.DEFAULT_PORT + " with client ID " + mData.toString());
                            result = idFIlter.getLocalID();
                        } else {
                            LOG.log(Level.WARNING, "Illegal data received with LOGIN message - [" + mData.toString() + "].");
                        }
                    } else if (header.equals(SystemMessageHeaders.LOGOUT)) {
                        serverInterface.disconnectFromServer();
                        notifyChange(DEREGISTER, null);
                    }
                }
            }
        }

        return result;
    }