You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by be...@apache.org on 2008/11/08 22:12:13 UTC

svn commit: r712433 - in /labs/vysper/src/main: config/ java/org/apache/vysper/xmpp/modules/ java/org/apache/vysper/xmpp/modules/roster/ java/org/apache/vysper/xmpp/modules/servicediscovery/ java/org/apache/vysper/xmpp/modules/servicediscovery/collecti...

Author: berndf
Date: Sat Nov  8 13:12:12 2008
New Revision: 712433

URL: http://svn.apache.org/viewvc?rev=712433&view=rev
Log:
[vysper] LABS-228: the basics

Added:
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryDictionary.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryModule.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/collection/
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/collection/ServiceCollector.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/handler/
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/handler/DiscoInfoIQHandler.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Feature.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Identity.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoElement.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequest.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequestListener.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Item.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequest.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequestListener.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ServerInfoRequestListener.java
Removed:
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/ServiceDiscoveryInfo.java
Modified:
    labs/vysper/src/main/config/spring-config.xml
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/Module.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterModule.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/protocol/NamespaceURIs.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/server/XMPPServer.java

Modified: labs/vysper/src/main/config/spring-config.xml
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/config/spring-config.xml?rev=712433&r1=712432&r2=712433&view=diff
==============================================================================
--- labs/vysper/src/main/config/spring-config.xml (original)
+++ labs/vysper/src/main/config/spring-config.xml Sat Nov  8 13:12:12 2008
@@ -91,6 +91,7 @@
         </property>
         <property name="modules">
             <list>
+                <bean class="org.apache.vysper.xmpp.modules.servicediscovery.ServiceDiscoveryModule" />
                 <bean class="org.apache.vysper.xmpp.modules.roster.RosterModule" />
             </list>
         </property>

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/Module.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/Module.java?rev=712433&r1=712432&r2=712433&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/Module.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/Module.java Sat Nov  8 13:12:12 2008
@@ -40,9 +40,4 @@
      */
     List<ServerRuntimeContextService> getServerServices();
 
-    /**
-     * all info needed to add to service discovery (XEP-0030)
-     */
-    List<ServiceDiscoveryInfo> getServiceDiscoveryInfos();
-    
 }

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterModule.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterModule.java?rev=712433&r1=712432&r2=712433&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterModule.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/RosterModule.java Sat Nov  8 13:12:12 2008
@@ -18,7 +18,6 @@
 
 import org.apache.vysper.xmpp.modules.Module;
 import org.apache.vysper.xmpp.modules.ServerRuntimeContextService;
-import org.apache.vysper.xmpp.modules.ServiceDiscoveryInfo;
 import org.apache.vysper.xmpp.modules.roster.persistence.MemoryRosterManager;
 import org.apache.vysper.xmpp.protocol.HandlerDictionary;
 
@@ -50,7 +49,4 @@
         return serviceList;
     }
 
-    public List<ServiceDiscoveryInfo> getServiceDiscoveryInfos() {
-        return null;
-    }
 }
\ No newline at end of file

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryDictionary.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryDictionary.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryDictionary.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryDictionary.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,34 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+
+package org.apache.vysper.xmpp.modules.servicediscovery;
+
+import org.apache.vysper.xmpp.modules.servicediscovery.handler.DiscoInfoIQHandler;
+import org.apache.vysper.xmpp.protocol.NamespaceHandlerDictionary;
+import org.apache.vysper.xmpp.protocol.NamespaceURIs;
+
+/**
+ * handler for service discovery (XEP-0030)
+ */
+public class ServiceDiscoveryDictionary extends NamespaceHandlerDictionary {
+
+    public ServiceDiscoveryDictionary() {
+        super(NamespaceURIs.XEP0030_SERVICE_DISCOVERY_INFO);
+        register(new DiscoInfoIQHandler());
+        seal();
+    }
+}
\ No newline at end of file

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryModule.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryModule.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryModule.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/ServiceDiscoveryModule.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,52 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery;
+
+import org.apache.vysper.xmpp.modules.Module;
+import org.apache.vysper.xmpp.modules.ServerRuntimeContextService;
+import org.apache.vysper.xmpp.modules.servicediscovery.collection.ServiceCollector;
+import org.apache.vysper.xmpp.protocol.HandlerDictionary;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * all the roster stuff assembled in a module
+ */
+public class ServiceDiscoveryModule implements Module {
+
+    public String getName() {
+        return "servicediscovery";
+    }
+
+    public String getVersion() {
+        return "1.0beta";
+    }
+
+    public List<HandlerDictionary> getHandlerDictionaries() {
+        List<HandlerDictionary> dictionary = new ArrayList<HandlerDictionary>();
+        dictionary.add(new ServiceDiscoveryDictionary());
+        return dictionary;
+    }
+
+    public List<ServerRuntimeContextService> getServerServices() {
+        List<ServerRuntimeContextService> serviceList = new ArrayList<ServerRuntimeContextService>();
+        serviceList.add(new ServiceCollector());
+        return serviceList;
+    }
+
+}
\ No newline at end of file

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/collection/ServiceCollector.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/collection/ServiceCollector.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/collection/ServiceCollector.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/collection/ServiceCollector.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,54 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.collection;
+
+import org.apache.vysper.xmpp.modules.servicediscovery.management.InfoRequestListener;
+import org.apache.vysper.xmpp.modules.servicediscovery.management.ItemRequestListener;
+import org.apache.vysper.xmpp.modules.servicediscovery.management.ServerInfoRequestListener;
+import org.apache.vysper.xmpp.modules.ServerRuntimeContextService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * on an item or info requests, calls all related listeners and collects what they have to add to the
+ * response. compiles the responded infos and items.
+ */
+public class ServiceCollector implements ServerRuntimeContextService {
+
+    public static final String SERVICE_DISCOVERY_COLLECTOR = "serviceDiscoveryCollector";
+    
+    protected List<InfoRequestListener> infoRequestListeners = new ArrayList<InfoRequestListener>();
+    protected List<ServerInfoRequestListener> serverInfoRequestListeners = new ArrayList<ServerInfoRequestListener>();
+    protected List<ItemRequestListener> itemRequestListeners = new ArrayList<ItemRequestListener>();
+
+    public void addInfoRequestListener(InfoRequestListener infoRequestListener) {
+        infoRequestListeners.add(infoRequestListener);
+    }
+
+    public void addServerInfoRequestListener(ServerInfoRequestListener infoRequestListener) {
+        serverInfoRequestListeners.add(infoRequestListener);
+    }
+
+    public void addItemRequestListener(ItemRequestListener itemRequestListener) {
+        itemRequestListeners.add(itemRequestListener);
+    }
+
+    public String getServiceName() {
+        return SERVICE_DISCOVERY_COLLECTOR;
+    }
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/handler/DiscoInfoIQHandler.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/handler/DiscoInfoIQHandler.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/handler/DiscoInfoIQHandler.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/handler/DiscoInfoIQHandler.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,68 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+
+package org.apache.vysper.xmpp.modules.servicediscovery.handler;
+
+import org.apache.vysper.xmpp.modules.core.base.handler.IQHandler;
+import org.apache.vysper.xmpp.protocol.NamespaceURIs;
+import org.apache.vysper.xmpp.server.ServerRuntimeContext;
+import org.apache.vysper.xmpp.server.SessionContext;
+import org.apache.vysper.xmpp.stanza.IQStanza;
+import org.apache.vysper.xmpp.stanza.Stanza;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * handles roster get, set, push & result requests
+ */
+public class DiscoInfoIQHandler extends IQHandler {
+
+    final Logger logger = LoggerFactory.getLogger(DiscoInfoIQHandler.class);
+
+    @Override
+    protected boolean verifyNamespace(Stanza stanza) {
+        return verifyInnerNamespace(stanza, NamespaceURIs.XEP0030_SERVICE_DISCOVERY_INFO);
+    }
+
+    @Override
+    protected Stanza executeIQLogic(IQStanza stanza, ServerRuntimeContext serverRuntimeContext, SessionContext sessionContext) {
+
+        switch (stanza.getIQType()) {
+
+            case ERROR:
+                new RuntimeException("disco info stanza type ERROR not yet handled");
+            case GET:
+                return retrieveInfoItems(stanza, sessionContext);
+            case RESULT:
+                new RuntimeException("disco info stanza type RESULT not yet handled");
+                break;
+            case SET:
+                new RuntimeException("disco info stanza type RESULT not yet handled");
+                break;
+            default:
+                new RuntimeException("disco info stanza type not supported: " + stanza.getIQType());
+        }
+
+        return null;
+    }
+
+    protected Stanza retrieveInfoItems(IQStanza stanza, SessionContext sessionContext) {
+        return null;
+    }
+
+
+}
\ No newline at end of file

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Feature.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Feature.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Feature.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Feature.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,32 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+/**
+ */
+public class Feature implements InfoElement {
+    
+    protected String var;
+
+    public Feature(String var) {
+        this.var = var;
+    }
+
+    public String getVar() {
+        return var;
+    }
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Identity.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Identity.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Identity.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Identity.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,49 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+/**
+ */
+public class Identity implements InfoElement {
+    
+    protected String category; // required
+    protected String type; // required
+    protected String name; // optional
+
+    public Identity(String category, String type, String name) {
+        this.category = category;
+        this.type = type;
+        this.name = name;
+    }
+
+    public Identity(String category, String type) {
+        this.category = category;
+        this.type = type;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoElement.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoElement.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoElement.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoElement.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,22 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+/**
+ */
+public interface InfoElement {
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequest.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequest.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequest.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequest.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,22 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+/**
+ */
+public class InfoRequest {
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequestListener.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequestListener.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequestListener.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/InfoRequestListener.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,28 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+import java.util.List;
+
+/**
+ * listens for info requests and returns info elements to be returned with the response
+ */
+public interface InfoRequestListener {
+
+    public List<InfoElement> getInfosFor(InfoRequest request);
+    
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Item.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Item.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Item.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/Item.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,50 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+import org.apache.vysper.xmpp.addressing.Entity;
+
+/**
+ */
+public class Item {
+    
+    protected Entity jid; // required
+    protected String name; // optional
+    protected String node; // optional
+
+    public Item(Entity jid, String name, String node) {
+        this.jid = jid;
+        this.name = name;
+        this.node = node;
+    }
+
+    public Item(Entity jid) {
+        this.jid = jid;
+    }
+
+    public Entity getJid() {
+        return jid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getNode() {
+        return node;
+    }
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequest.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequest.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequest.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequest.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,22 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+/**
+ */
+public class ItemRequest {
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequestListener.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequestListener.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequestListener.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ItemRequestListener.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,29 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+import java.util.List;
+
+/**
+ * listens for item request for the server JID and returns item 
+ * elements to be returned with the response
+ */
+public interface ItemRequestListener {
+    
+    public List<Item> getItemsFor(ItemRequest request);
+    
+}

Added: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ServerInfoRequestListener.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ServerInfoRequestListener.java?rev=712433&view=auto
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ServerInfoRequestListener.java (added)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/servicediscovery/management/ServerInfoRequestListener.java Sat Nov  8 13:12:12 2008
@@ -0,0 +1,28 @@
+/***********************************************************************
+ * Copyright (c) 2006-2007 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+package org.apache.vysper.xmpp.modules.servicediscovery.management;
+
+import java.util.List;
+
+/**
+ * listens for info request for the server JID and returns info elements to be returned with the response
+ */
+public interface ServerInfoRequestListener {
+
+    public List<InfoElement> getServerInfosFor(InfoRequest request);
+    
+}
\ No newline at end of file

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/protocol/NamespaceURIs.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/protocol/NamespaceURIs.java?rev=712433&r1=712432&r2=712433&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/protocol/NamespaceURIs.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/protocol/NamespaceURIs.java Sat Nov  8 13:12:12 2008
@@ -32,6 +32,8 @@
     public static final String JABBER_SERVER = "jabber:server";
     public static final String JABBER_SERVER_DIALBACK = "jabber:server:dialback";
     public static final String JABBER_IQ_ROSTER = "jabber:iq:roster";
+    public static final String XEP0030_SERVICE_DISCOVERY_ITEMS = "http://jabber.org/protocol/disco#items";
+    public static final String XEP0030_SERVICE_DISCOVERY_INFO  = "http://jabber.org/protocol/disco#info";
     
     // compatibility namespaces
     public static final String JABBER_IQ_AUTH_COMPATIBILITY = "jabber:iq:auth";

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/server/XMPPServer.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/server/XMPPServer.java?rev=712433&r1=712432&r2=712433&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/server/XMPPServer.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/server/XMPPServer.java Sat Nov  8 13:12:12 2008
@@ -24,6 +24,7 @@
 import org.apache.vysper.xmpp.delivery.RecordingStanzaRelay;
 import org.apache.vysper.xmpp.delivery.StanzaRelayBroker;
 import org.apache.vysper.xmpp.modules.roster.RosterModule;
+import org.apache.vysper.xmpp.modules.servicediscovery.ServiceDiscoveryModule;
 import org.apache.vysper.xmpp.protocol.NamespaceHandlerDictionary;
 import org.apache.vysper.xmpp.state.resourcebinding.ResourceRegistry;
 import org.apache.vysper.xmpp.security.BogusTrustManagerFactory;
@@ -107,6 +108,7 @@
         serverRuntimeContext.setUserAuthorization(userAuthorization);
         serverRuntimeContext.setTlsContextFactory(tlsContextFactory);
         
+        serverRuntimeContext.addModule(new ServiceDiscoveryModule());
         serverRuntimeContext.addModule(new RosterModule());
 
         stanzaRelayBroker.setServerRuntimeContext(serverRuntimeContext);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org