/** * This method will be called by the AJ bus when a notification is received * * @see org.alljoyn.ns.transport.interfaces.NotificationTransport#notify(int, int, short, String, * String, byte[], String, Map, Map, TransportNotificationText[]) */ @Override public void notify( int version, int msgId, short messageType, String deviceId, String deviceName, byte[] appId, String appName, Map<Integer, Variant> attributes, Map<String, String> customAttributes, TransportNotificationText[] text) { Transport transport = Transport.getInstance(); BusAttachment busAttachment = transport.getBusAttachment(); busAttachment.enableConcurrentCallbacks(); try { GenericLogger logger = NativePlatformFactory.getPlatformObject().getNativeLogger(); try { String sender = busAttachment.getMessageContext().sender; logger.debug( TAG, "Received notification from: '" + sender + "' by '" + servicePath + "' object, notification id: '" + msgId + "', handling"); logger.debug( TAG, "Forwarding the received notification id: '" + msgId + "' to PayloadAdapter"); PayloadAdapter.receivePayload( version, msgId, sender, messageType, deviceId, deviceName, appId, appName, attributes, customAttributes, text); } catch (NotificationServiceException nse) { logger.error(TAG, "Failed to read the received notification, Error: " + nse.getMessage()); } } catch (NativePlatformFactoryException npfe) { System.out.println(TAG + ": Unexpected error occured: " + npfe.getMessage()); } } // notify