INT-1616 refactored XMPP package structure
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.integration.xmpp;
|
||||
package org.springframework.integration.xmpp.config;
|
||||
|
||||
import org.jivesoftware.smack.ConnectionConfiguration;
|
||||
import org.jivesoftware.smack.Roster;
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.xmpp.config;
|
||||
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
@@ -30,12 +31,13 @@ import org.w3c.dom.Element;
|
||||
* @since 2.0
|
||||
*/
|
||||
public class XmppConnectionParser extends AbstractSingleBeanDefinitionParser {
|
||||
private static String[] connectionFactoryAttributes =
|
||||
new String[]{"user", "password", "resource","subscription-mode"};
|
||||
|
||||
|
||||
private static String[] connectionFactoryAttributes = new String[]{"user", "password", "resource","subscription-mode"};
|
||||
|
||||
|
||||
@Override
|
||||
protected String getBeanClassName(Element element) {
|
||||
return "org.springframework.integration.xmpp.XmppConnectionFactoryBean";
|
||||
return "org.springframework.integration.xmpp.config.XmppConnectionFactoryBean";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,4 +69,5 @@ public class XmppConnectionParser extends AbstractSingleBeanDefinitionParser {
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup");
|
||||
builder.addConstructorArgValue(connectionConfigurationBuilder.getBeanDefinition());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,13 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.xmpp.config;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* Parser for 'message-inbound-channel-adapter' element
|
||||
@@ -32,7 +34,7 @@ public class XmppMessageInboundEndpointParser extends AbstractSingleBeanDefiniti
|
||||
|
||||
@Override
|
||||
protected String getBeanClassName(Element element) {
|
||||
return "org.springframework.integration.xmpp.messages.XmppMessageDrivenEndpoint";
|
||||
return "org.springframework.integration.xmpp.inbound.XmppMessageDrivenEndpoint";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,4 +45,5 @@ public class XmppMessageInboundEndpointParser extends AbstractSingleBeanDefiniti
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.xmpp.config;
|
||||
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
@@ -32,9 +33,10 @@ public class XmppMessageOutboundEndpointParser extends AbstractOutboundChannelAd
|
||||
@Override
|
||||
protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) {
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
|
||||
"org.springframework.integration.xmpp.messages.XmppMessageSendingMessageHandler");
|
||||
"org.springframework.integration.xmpp.outbound.XmppMessageSendingMessageHandler");
|
||||
String connectionName = element.getAttribute("xmpp-connection");
|
||||
builder.addConstructorArgReference(connectionName);
|
||||
return builder.getBeanDefinition();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.xmpp.config;
|
||||
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
@@ -27,13 +28,12 @@ import org.w3c.dom.Element;
|
||||
* @author Josh Long
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*
|
||||
*/
|
||||
public class XmppRosterEventInboundEndpointParser extends AbstractSingleBeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
protected String getBeanClassName(Element element) {
|
||||
return "org.springframework.integration.xmpp.presence.XmppRosterEventMessageDrivenEndpoint";
|
||||
return "org.springframework.integration.xmpp.inbound.XmppRosterEventMessageDrivenEndpoint";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,4 +48,5 @@ public class XmppRosterEventInboundEndpointParser extends AbstractSingleBeanDefi
|
||||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "channel", "requestChannel");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.xmpp.config;
|
||||
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
@@ -32,9 +33,10 @@ public class XmppRosterEventOutboundEndpointParser extends AbstractOutboundChann
|
||||
@Override
|
||||
protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) {
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
|
||||
"org.springframework.integration.xmpp.presence.XmppRosterEventMessageSendingHandler");
|
||||
"org.springframework.integration.xmpp.outbound.XmppRosterEventMessageSendingHandler");
|
||||
String connectionName = element.getAttribute("xmpp-connection");
|
||||
builder.addConstructorArgReference(connectionName);
|
||||
return builder.getBeanDefinition();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.integration.xmpp.messages;
|
||||
package org.springframework.integration.xmpp.inbound;
|
||||
|
||||
import org.jivesoftware.smack.Chat;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.integration.xmpp.presence;
|
||||
package org.springframework.integration.xmpp.inbound;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.integration.xmpp.messages;
|
||||
package org.springframework.integration.xmpp.outbound;
|
||||
|
||||
import org.jivesoftware.smack.Chat;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.integration.xmpp.presence;
|
||||
package org.springframework.integration.xmpp.outbound;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
@@ -24,7 +24,7 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.messages.XmppMessageDrivenEndpoint;
|
||||
import org.springframework.integration.xmpp.inbound.XmppMessageDrivenEndpoint;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-xmpp="http://www.springframework.org/schema/integration/xmpp">
|
||||
|
||||
<bean id="xmppConnection" class="org.springframework.integration.xmpp.XmppConnectionFactoryBean">
|
||||
<bean id="xmppConnection" class="org.springframework.integration.xmpp.config.XmppConnectionFactoryBean">
|
||||
<constructor-arg>
|
||||
<bean class="org.jivesoftware.smack.ConnectionConfiguration">
|
||||
<constructor-arg value="myServiceName"/>
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.integration.xmpp;
|
||||
package org.springframework.integration.xmpp.config;
|
||||
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -22,6 +22,7 @@ import org.jivesoftware.smack.ConnectionConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.xmpp.config.XmppConnectionFactoryBean;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -28,7 +28,6 @@ import org.junit.Test;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppConnectionFactoryBean;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
|
||||
@@ -19,7 +19,8 @@ package org.springframework.integration.xmpp.ignore;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.integration.xmpp.presence.XmppRosterEventMessageSendingHandler;
|
||||
|
||||
import org.springframework.integration.xmpp.outbound.XmppRosterEventMessageSendingHandler;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.mockito.stubbing.Answer;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.inbound.XmppMessageDrivenEndpoint;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.XmppHeaders;
|
||||
import org.springframework.integration.xmpp.outbound.XmppMessageSendingMessageHandler;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.integration.MessageHandlingException;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.presence.XmppRosterEventMessageSendingHandler;
|
||||
import org.springframework.integration.xmpp.outbound.XmppRosterEventMessageSendingHandler;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.springframework.integration.Message;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.integration.xmpp.XmppContextUtils;
|
||||
import org.springframework.integration.xmpp.inbound.XmppRosterEventMessageDrivenEndpoint;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
|
||||
Reference in New Issue
Block a user