INT-1616 refactored XMPP package structure

This commit is contained in:
Mark Fisher
2010-11-13 11:15:07 -05:00
parent 352f5f5f73
commit d95a7df068
19 changed files with 38 additions and 23 deletions

View File

@@ -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;

View File

@@ -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());
}
}

View File

@@ -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");
}
}

View File

@@ -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();
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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();
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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"/>

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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