@@ -0,0 +1,1304 @@
+package com.gss.gmo.cao.integration.xmpp.component.inbound;%0D%0A%0D%0Aimport static org.springframework.util.Assert.isTrue;%0D%0A%0D%0Aimport org.springframework.integration.support.AbstractIntegrationMessageBuilder;%0D%0Aimport org.xmpp.packet.Presence;%0D%0A%0D%0Aimport com.gss.gmo.cao.integration.xmpp.component.core.AbstractComponentManagerAwareEndpoint;%0D%0Aimport com.gss.gmo.cao.integration.xmpp.component.core.ComponentManager;%0D%0Aimport com.gss.gmo.cao.integration.xmpp.component.core.PresenceListener;%0D%0A%0D%0A/**%0D%0A * @author linus_chien%0D%0A *%0D%0A */%0D%0Apublic class PresenceListeningEndpoint extends AbstractComponentManagerAwareEndpoint %7B%0D%0A%0D%0A%09public PresenceListeningEndpoint(ComponentManager componentManager) %7B%0D%0A%09%09super(componentManager);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public String getComponentType() %7B%0D%0A%09%09return %22xmpp-component:presence-inbound-channel-adapter%22;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09protected void doStart() %7B%0D%0A%09%09isTrue(this.initialized, this.getComponentName() + %22 %5B%22 + this.getComponentType() + %22%5D must be initialized%22);%0D%0A%09%09this.componentManager.setPresenceListener(new PresenceListener() %7B%0D%0A%09%09%09@Override%0D%0A%09%09%09public void handlePresence(Presence presence) %7B%0D%0A%09%09%09%09AbstractIntegrationMessageBuilder%3CPresence%3E messageBuilder = getMessageBuilderFactory().withPayload(presence);%0D%0A%09%09%09%09sendMessage(messageBuilder.build());%0D%0A%09%09%09%7D%0D%0A%09%09%7D);%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add PresenceListeningEndpoint