Revision: 15360
Author: pavel.slegr
Date: Wed Nov 17 13:01:48 2010
Log: jbcp 5.x update - Presence 1.0.0.BETA6
http://code.google.com/p/mobicents/source/detail?r=15360
Modified:
/branches/jbcp/5.x-mead/presence/pom.xml
/branches/jbcp/5.x-mead/presence/sip-presence-assemble/pom.xml
/branches/jbcp/5.x-mead/presence/user-profile
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/datasource/DataSource.java
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/datasource/Document.java
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/uri/NodeSelector.java
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/uri/ResourceSelector.java
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/xml/NamespaceContext.java
=======================================
--- /branches/jbcp/5.x-mead/presence/pom.xml Tue Nov 2 04:11:43 2010
+++ /branches/jbcp/5.x-mead/presence/pom.xml Wed Nov 17 13:01:48 2010
@@ -75,7 +75,6 @@
<!-- PRESENCE SERVICE BUILD CONFIGURATION -->
<xdm.server.xcap.root>/mobicents</xdm.server.xcap.root>
-
<xdm.server.xcap.dynamicUserProvision>true</xdm.server.xcap.dynamicUserProvision>
<presence.server.notifier.presrules.auid>org.openmobilealliance.pres-rules</presence.server.notifier.presrules.auid>
<presence.server.notifier.presrules.documentName>pres-rules</presence.server.notifier.presrules.documentName>
@@ -130,6 +129,16 @@
<groupId>org.mobicents</groupId>
<version>5.0.1.GA-JBCP5</version>
</dependency>
+ <dependency>
+ <groupId>org.mobicents.resources</groupId>
+
<artifactId>mobicents-slee-ra-xcap-client-ratype</artifactId>
+ <version>5.0.1.GA-JBCP5</version>
+ </dependency>
+ <dependency>
+
<groupId>org.mobicents.servers.jainslee.enablers</groupId>
+ <artifactId>xdm-client-sbb</artifactId>
+ <version>5.0.1.GA-JBCP5</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -154,9 +163,9 @@
</build>
<scm>
-
<connection>scm:svn:https://mobicents.googlecode.com/svn/trunk/servers/sip-presence</connection>
-
<developerConnection>scm:svn:https://mobicents.googlecode.com/svn/trunk/servers/sip-presence</developerConnection>
-
<url>http://mobicents.googlecode.com/svn/trunk/servers/sip-presence</url>
+
<connection>scm:svn:https://mobicents.googlecode.com/svn/tags/servers/sip-presence/5.0.1.GA-JBCP5</connection>
+
<developerConnection>scm:svn:https://mobicents.googlecode.com/svn/tags/servers/sip-presence/5.0.1.GA-JBCP5</developerConnection>
+
<url>http://mobicents.googlecode.com/svn/tags/servers/sip-presence/5.0.1.GA-JBCP5</url>
</scm>
<!-- dupe info from parent, but it's only way to retrieve the parent
without user configuration -->
@@ -206,7 +215,6 @@
</plugins>
</build>
</profile>
-
<profile>
<id>assemble</id>
<activation>
=======================================
--- /branches/jbcp/5.x-mead/presence/sip-presence-assemble/pom.xml Tue Nov
2 04:11:43 2010
+++ /branches/jbcp/5.x-mead/presence/sip-presence-assemble/pom.xml Wed Nov
17 13:01:48 2010
@@ -95,6 +95,26 @@
<version>${pom.version}</version>
</dependency>
<dependency>
+ <groupId>org.mobicents.servers.xdm</groupId>
+
<artifactId>xdms-appusages-oma-group-usage-list-bean</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mobicents.servers.xdm</groupId>
+
<artifactId>xdms-appusages-oma-locked-user-profile-bean</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mobicents.servers.xdm</groupId>
+
<artifactId>xdms-appusages-oma-user-profile-bean</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mobicents.servers.xdm</groupId>
+
<artifactId>xdms-appusages-oma-xcap-directory-bean</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.mobicents.servers.xdm</groupId>
<artifactId>xdms-appusages-resource-lists-bean</artifactId>
<version>${pom.version}</version>
=======================================
---
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/datasource/DataSource.java
Fri Dec 11 05:24:38 2009
+++
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/datasource/DataSource.java
Wed Nov 17 13:01:48 2010
@@ -23,43 +23,60 @@
*/
public void close() throws InternalServerErrorException;
+ /**
+ *
+ * @param documentSelector
+ * @return
+ * @throws InternalServerErrorException
+ */
public Document getDocument(DocumentSelector documentSelector) throws
InternalServerErrorException;
+ /**
+ *
+ * @param documentSelector
+ * @param eTag
+ * @param xml
+ * @param document
+ * @throws InternalServerErrorException
+ */
public void createDocument(DocumentSelector documentSelector,String eTag,
String xml, org.w3c.dom.Document document) throws
InternalServerErrorException;
+ /**
+ *
+ * @param documentSelector
+ * @param oldETag
+ * @param newETag
+ * @param documentAsString
+ * @param document
+ * @throws InternalServerErrorException
+ */
public void updateDocument(DocumentSelector documentSelector,
String oldETag, String newETag, String documentAsString,
org.w3c.dom.Document document) throws
InternalServerErrorException;
+ /**
+ *
+ * @param documentSelector
+ * @param oldETag
+ * @throws InternalServerErrorException
+ */
public void deleteDocument(DocumentSelector documentSelector, String
oldETag) throws InternalServerErrorException;
- public String[] getAppUsages() throws InternalServerErrorException;
-
- public boolean containsAppUsage(String appUsage) throws
InternalServerErrorException;
-
- public void addAppUsage(String appUsage) throws
InternalServerErrorException;
-
- public void removeAppUsage(String appUsage) throws
InternalServerErrorException;
-
- public void addCollection(String appUsage, String collection) throws
InternalServerErrorException;
-
- //public void addUser(String appUsage, String user) throws
InternalServerErrorException;
-
- public String[] getCollections(String appUsage) throws
InternalServerErrorException;
-
- public String[] getDocuments(String auid, String collection) throws
InternalServerErrorException;
-
- //public String[] getUsers(String appUsage) throws
InternalServerErrorException;
-
- //public void removeUser(String appUsage, String user) throws
InternalServerErrorException;
+ /**
+ *
+ * @param auid
+ * @param documentParent
+ * @return
+ * @throws InternalServerErrorException
+ */
+ public Document[] getDocuments(String auid, String documentParent) throws
InternalServerErrorException;
/**
- * Finds out an existing collection, going backwards in the collection
tree from one that doesn't exist
+ *
* @param auid
- * @param startingCollection
* @return
* @throws InternalServerErrorException
*/
- public String getExistingCollection(String auid, String
startingCollection) throws InternalServerErrorException;
-
-}
+ public Document[] getDocuments(String auid) throws
InternalServerErrorException;
+
+}
=======================================
---
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/datasource/Document.java
Fri Dec 11 05:24:38 2009
+++
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/datasource/Document.java
Wed Nov 17 13:01:48 2010
@@ -4,8 +4,15 @@
public interface Document {
+ public org.w3c.dom.Document getAsDOMDocument() throws
InternalServerErrorException;
+
public String getAsString() throws InternalServerErrorException;
- public org.w3c.dom.Document getAsDOMDocument() throws
InternalServerErrorException;
+
+ public String getAUID();
+
+ public String getDocumentParent();
+
+ public String getDocumentName();
public String getETag();
=======================================
---
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/uri/NodeSelector.java
Fri Dec 11 05:24:38 2009
+++
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/uri/NodeSelector.java
Wed Nov 17 13:01:48 2010
@@ -95,34 +95,38 @@
*/
public String getElementSelectorWithEmptyPrefix() {
if (elementSelectorWithEmptyPrefix == null) {
- StringBuilder sb = new StringBuilder();
- String[] elementSelectorParts =
elementSelector.split("/");
- // ignore the first part because its ""
- for (int i = 1; i < elementSelectorParts.length; i++) {
- if (elementSelectorParts[i].charAt(0) == '*') {
- // wildcard, just copy
-
sb.append('/').append(elementSelectorParts[i]);
- } else if (elementSelectorParts[i].indexOf(':')
> -1) {
- // it has at least one :, check if it's
not inside an attr
- // value
- int pos =
elementSelectorParts[i].indexOf('[');
- if (pos > 0 &&
elementSelectorParts[i].indexOf(':') > pos) {
- // insert empty prefix
-
sb.append("/:").append(elementSelectorParts[i]);
- } else {
- // already has a prefix
-
sb.append('/').append(elementSelectorParts[i]);
- }
- } else {
+ elementSelectorWithEmptyPrefix =
getElementSelectorWithEmptyPrefix(elementSelector);
+ }
+ return elementSelectorWithEmptyPrefix;
+ }
+
+ public static String getElementSelectorWithEmptyPrefix(String
elementSelector) {
+ StringBuilder sb = new StringBuilder();
+ String[] elementSelectorParts = elementSelector.split("/");
+ // ignore the first part because its ""
+ for (int i = 1; i < elementSelectorParts.length; i++) {
+ if (elementSelectorParts[i].charAt(0) == '*') {
+ // wildcard, just copy
+ sb.append('/').append(elementSelectorParts[i]);
+ } else if (elementSelectorParts[i].indexOf(':') > -1) {
+ // it has at least one :, check if it's not
inside an attr
+ // value
+ int pos = elementSelectorParts[i].indexOf('[');
+ if (pos > 0 &&
elementSelectorParts[i].indexOf(':') > pos) {
// insert empty prefix
sb.append("/:").append(elementSelectorParts[i]);
- }
- }
- elementSelectorWithEmptyPrefix = sb.toString();
- }
- return elementSelectorWithEmptyPrefix;
- }
-
+ } else {
+ // already has a prefix
+
sb.append('/').append(elementSelectorParts[i]);
+ }
+ } else {
+ // insert empty prefix
+ sb.append("/:").append(elementSelectorParts[i]);
+ }
+ }
+ return sb.toString();
+ }
+
/**
* Retreives the element parent selector, that is, the parent of the
element
* selected by the element selector.
=======================================
---
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/uri/ResourceSelector.java
Fri Dec 11 05:24:38 2009
+++
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/uri/ResourceSelector.java
Wed Nov 17 13:01:48 2010
@@ -3,6 +3,8 @@
import java.util.Iterator;
import java.util.Map;
+import org.openxdm.xcap.common.xml.NamespaceContext;
+
/**
*
* A resource selector is the lowest level selector that points to a
resource on
@@ -45,12 +47,12 @@
public class ResourceSelector {
- private String documentSelector;
-
- private String nodeSelector;
-
- private Map<String, String> namespaces;
-
+ private final String documentSelector;
+
+ private final String nodeSelector;
+
+ private final NamespaceContext namespaceContext;
+
/**
* Creates a new instance of a resource selector, pointing to document
* resource.
@@ -92,7 +94,12 @@
Map<String, String> namespaces) {
this.documentSelector = documentSelector;
this.nodeSelector = nodeSelector;
- this.namespaces = namespaces;
+ if (namespaces != null) {
+ this.namespaceContext = new
NamespaceContext(namespaces);
+ }
+ else {
+ this.namespaceContext = null;
+ }
}
/**
@@ -106,12 +113,11 @@
}
/**
- * Retreives the namespace bindings map.
*
* @return
*/
- public Map<String, String> getNamespaces() {
- return namespaces;
+ public NamespaceContext getNamespaceContext() {
+ return namespaceContext;
}
/**
@@ -129,12 +135,12 @@
StringBuilder sb = new StringBuilder(documentSelector);
if (nodeSelector != null) {
sb.append("/~~").append(nodeSelector);
- if (namespaces != null &&
!namespaces.isEmpty()) {
+ if (namespaceContext != null
&& !namespaceContext.getNamespaces().isEmpty()) {
sb.append('?');
- for (Iterator<String> i =
namespaces.keySet().iterator(); i
+ for (Iterator<String> i =
namespaceContext.getNamespaces().keySet().iterator(); i
.hasNext();) {
String prefix = i.next();
- String namespace =
namespaces.get(prefix);
+ String namespace =
namespaceContext.getNamespaces().get(prefix);
sb.append("xmlns(").append(prefix).append('=').append(
namespace).append(')');
}
=======================================
---
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/xml/NamespaceContext.java
Fri Dec 11 05:24:38 2009
+++
/branches/jbcp/5.x-mead/presence/xdm/commons/src/main/java/org/openxdm/xcap/common/xml/NamespaceContext.java
Wed Nov 17 13:01:48 2010
@@ -13,6 +13,10 @@
this.namespaces = namespaces;
}
+ /*
+ * (non-Javadoc)
+ * @see
javax.xml.namespace.NamespaceContext#getNamespaceURI(java.lang.String)
+ */
public String getNamespaceURI(String prefix) {
if (prefix == null) {
throw new IllegalArgumentException("Null prefix");
@@ -27,6 +31,10 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see
javax.xml.namespace.NamespaceContext#getPrefix(java.lang.String)
+ */
public String getPrefix(String uri) {
for(Iterator<String>
i=namespaces.keySet().iterator();i.hasNext();) {
String prefix = i.next();
@@ -37,8 +45,28 @@
return null;
}
+ /*
+ * (non-Javadoc)
+ * @see
javax.xml.namespace.NamespaceContext#getPrefixes(java.lang.String)
+ */
public Iterator<String> getPrefixes(String uri) {
return namespaces.keySet().iterator();
}
-}
+ /**
+ *
+ * @return
+ */
+ public Map<String, String> getNamespaces() {
+ return namespaces;
+ }
+
+ /**
+ *
+ * @param namespace
+ */
+ public void setDefaultDocNamespace(String namespace) {
+ namespaces.put(XMLConstants.DEFAULT_NS_PREFIX,namespace);
+ }
+
+}