abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1186541 [7/8] - in /abdera/abdera2: ./ .settings/ activities/ activities/.settings/ activities/src/main/java/org/apache/abdera2/activities/client/ activities/src/main/java/org/apache/abdera2/activities/extra/ activities/src/main/java/org/a...
Date Wed, 19 Oct 2011 22:33:52 GMT
Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/history/FeedPagingHelper.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/history/FeedPagingHelper.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/history/FeedPagingHelper.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/history/FeedPagingHelper.java Wed Oct 19 22:33:04 2011
@@ -28,10 +28,19 @@ import static org.apache.abdera2.model.L
 import static org.apache.abdera2.model.Link.REL_NEXT_ARCHIVE;
 import static org.apache.abdera2.model.Link.REL_PREV_ARCHIVE;
 
+import org.apache.abdera2.Abdera;
 import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Document;
+import org.apache.abdera2.model.Element;
 import org.apache.abdera2.model.ExtensibleElement;
 import org.apache.abdera2.model.Link;
 import org.apache.abdera2.model.Source;
+import org.apache.abdera2.protocol.client.AbderaClient;
+import org.apache.abdera2.protocol.client.AbderaClientResponse;
+import org.apache.abdera2.protocol.client.AbderaSession;
+import org.apache.abdera2.protocol.client.RequestOptions;
+
+import com.google.common.base.Function;
 
 /**
  * Initial support for Mark Nottingham's Feed Paging and Archiving draft
@@ -255,4 +264,94 @@ public final class FeedPagingHelper {
     public static IRI getCurrent(Source feed) {
         return _getLink(feed,REL_CURRENT);
     }
+    
+    public static <E extends Element>Document<E> fetchNext(Source source) {
+      AbderaClient client = new AbderaClient();
+      AbderaSession session = client.newSession();
+      return fetchNext(source, session);
+    }
+    
+    public static <E extends Element>Document<E> fetchPrevious(Source source) {
+      AbderaClient client = new AbderaClient();
+      AbderaSession session = client.newSession();
+      return fetchPrevious(source, session);
+    }
+    
+    public static <E extends Element>Document<E> fetchCurrent(Source source) {
+      AbderaClient client = new AbderaClient();
+      AbderaSession session = client.newSession();
+      return fetchCurrent(source, session);
+    }
+    
+    public static <E extends Element>Document<E> fetchLast(Source source) {
+      AbderaClient client = new AbderaClient();
+      AbderaSession session = client.newSession();
+      return fetchLast(source, session);
+    }
+    
+    public static <E extends Element>Document<E> fetchNextArchive(Source source) {
+      AbderaClient client = new AbderaClient();
+      AbderaSession session = client.newSession();
+      return fetchNextArchive(source, session);
+    }
+    
+    public static <E extends Element>Document<E> fetchPreviousArchive(Source source) {
+      AbderaClient client = new AbderaClient();
+      AbderaSession session = client.newSession();
+      return fetchPreviousArchive(source, session);
+    }
+    
+    public static <E extends Element>Document<E> fetchNext(Source source, AbderaSession session) {
+      return fetch(getNext(source),session);
+    }
+    
+    public static <E extends Element>Document<E> fetchPrevious(Source source, AbderaSession session) {
+      return fetch(getPrevious(source),session);
+    }
+    
+    public static <E extends Element>Document<E> fetchCurrent(Source source, AbderaSession session) {
+      return fetch(getCurrent(source),session);
+    }
+    
+    public static <E extends Element>Document<E> fetchLast(Source source, AbderaSession session) {
+      return fetch(getLast(source),session);
+    }
+    
+    public static <E extends Element>Document<E> fetchNextArchive(Source source, AbderaSession session) {
+      return fetch(getNextArchive(source),session);
+    }
+    
+    public static <E extends Element>Document<E> fetchPreviousArchive(Source source, AbderaSession session) {
+      return fetch(getPreviousArchive(source),session);
+    }
+    
+    private static <E extends Element>Document<E> fetch(IRI iri, AbderaSession session) {
+      if (iri == null) return null;
+      PageFetch<E> fetch = new PageFetch<E>(iri.toString(), session);
+      return fetch.apply(session.getDefaultRequestOptions());
+    }
+    
+    public static class PageFetch<E extends Element>
+      implements Function<RequestOptions,Document<E>> {
+        private final String uri;
+        private final AbderaSession session;
+        public PageFetch(String uri, AbderaSession session) {
+          this.uri = uri;
+          this.session = session;
+        }
+        public Document<E> apply(RequestOptions options) {
+          AbderaClientResponse resp = session.get(uri,options);
+          switch(resp.getType()) {
+          case SUCCESSFUL:
+            return resp.getDocument();
+          default:
+            org.apache.abdera2.protocol.error.Error.create(
+              Abdera.getInstance(), 
+              resp.getStatus(), 
+              resp.getStatusText())
+                .throwException();
+            return null;
+          }
+        }
+    }
 }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONFilter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONFilter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONFilter.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONFilter.java Wed Oct 19 22:33:04 2011
@@ -23,10 +23,10 @@ import java.io.IOException;
 import java.io.OutputStream;
 
 import org.apache.abdera2.Abdera;
+import org.apache.abdera2.common.misc.Chain;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
 import org.apache.abdera2.common.protocol.Filter;
-import org.apache.abdera2.common.protocol.FilterChain;
 import org.apache.abdera2.common.protocol.ProviderHelper;
 import org.apache.abdera2.model.Document;
 import org.apache.abdera2.model.Element;
@@ -41,11 +41,10 @@ import org.apache.abdera2.writer.Writer;
  */
 public class JSONFilter implements Filter {
 
-    @SuppressWarnings("unchecked")
-    public <S extends ResponseContext>S filter(RequestContext request, FilterChain chain) {
-        AtompubResponseContext resp = chain.next(request);
+    public ResponseContext apply(RequestContext request, Chain<RequestContext,ResponseContext> chain) {
+        AtompubResponseContext resp = (AtompubResponseContext) chain.next(request);
         String format = request.getParameter("format");
-        return (S)((resp.getContentType() != null && jsonPreferred(request, resp.getContentType().toString())) || (format != null && format
+        return ((resp.getContentType() != null && jsonPreferred(request, resp.getContentType().toString())) || (format != null && format
             .equalsIgnoreCase("json")) ? new JsonResponseContext(resp, Abdera.getInstance()) : resp);
     }
 

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONServlet.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONServlet.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONServlet.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONServlet.java Wed Oct 19 22:33:04 2011
@@ -85,7 +85,7 @@ public class JSONServlet extends HttpSer
             if (doc.getLanguage() != null)
                 response.setHeader("Content-Language", doc.getLanguage());
             if (doc.getLastModified() != null)
-                response.setDateHeader("Last-Modified", doc.getLastModified().getTime());
+                response.setDateHeader("Last-Modified", doc.getLastModified().getMillis());
             OutputStream out = response.getOutputStream();
             doc.writeTo("json", out);
         } catch (Exception e) {

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONStream.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONStream.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONStream.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/json/JSONStream.java Wed Oct 19 22:33:04 2011
@@ -19,14 +19,14 @@ package org.apache.abdera2.ext.json;
 
 import java.io.IOException;
 import java.io.Writer;
-import java.util.Date;
 import java.util.Stack;
 
 import javax.activation.MimeType;
 
 import org.apache.abdera2.common.iri.IRI;
-import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.common.http.EntityTag;
+import org.joda.time.DateTime;
 
 public class JSONStream {
 
@@ -124,9 +124,9 @@ public class JSONStream {
         writeColon();
     }
 
-    public void writeField(String name, Date value) throws IOException {
+    public void writeField(String name, DateTime value) throws IOException {
         if (value != null) {
-            writeField(name, DateTime.format(value));
+            writeField(name, DateTimes.format(value));
         }
     }
 

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/LicensedEntrySelector.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/LicensedEntrySelector.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/LicensedEntrySelector.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/LicensedEntrySelector.java Wed Oct 19 22:33:04 2011
@@ -3,6 +3,7 @@ package org.apache.abdera2.ext.license;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
+import org.apache.abdera2.common.selector.AbstractSelector;
 import org.apache.abdera2.common.selector.Selector;
 import org.apache.abdera2.model.Entry;
 
@@ -10,7 +11,9 @@ import org.apache.abdera2.model.Entry;
  * Used to only select entries that have the specified licenses or, if no
  * licenses are specified, select entries that specify any license
  */
-public class LicensedEntrySelector implements Selector {
+public class LicensedEntrySelector 
+extends AbstractSelector<Entry>
+implements Selector<Entry> {
 
   private Set<String> set = new LinkedHashSet<String>();
   

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/UnspecifiedLicenseEntrySelector.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/UnspecifiedLicenseEntrySelector.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/UnspecifiedLicenseEntrySelector.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/license/UnspecifiedLicenseEntrySelector.java Wed Oct 19 22:33:04 2011
@@ -1,12 +1,15 @@
 package org.apache.abdera2.ext.license;
 
+import org.apache.abdera2.common.selector.AbstractSelector;
 import org.apache.abdera2.common.selector.Selector;
 import org.apache.abdera2.model.Entry;
 
 /**
  * Used to only select entries that do not specify a license
  */
-public class UnspecifiedLicenseEntrySelector implements Selector {
+public class UnspecifiedLicenseEntrySelector 
+extends AbstractSelector<Entry>
+implements Selector<Entry> {
 
   public boolean select(Object item) {
     if (!(item instanceof Entry))

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java Wed Oct 19 22:33:04 2011
@@ -19,7 +19,6 @@ package org.apache.abdera2.ext.rss;
 
 import java.util.ArrayList;
 import java.util.Comparator;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -50,6 +49,7 @@ import org.apache.abdera2.parser.axiom.F
 import org.apache.abdera2.xpath.XPath;
 import org.apache.abdera2.xpath.XPathException;
 
+@SuppressWarnings("rawtypes")
 public class RssChannel extends ExtensibleElementWrapper {
 
     public RssChannel(Element internal) {
@@ -400,9 +400,9 @@ public class RssChannel extends Extensib
         return (text != null) ? text.getTextType() : null;
     }
 
-    public Date getUpdated() {
+    public org.joda.time.DateTime getUpdated() {
         DateTime dt = getUpdatedElement();
-        return (dt != null) ? dt.getDate() : null;
+        return (dt != null) ? dt.getValue() : null;
     }
 
     public DateTime getUpdatedElement() {
@@ -423,9 +423,9 @@ public class RssChannel extends Extensib
         return (dt != null) ? dt.getString() : null;
     }
 
-    public Date getPublished() {
+    public org.joda.time.DateTime getPublished() {
         DateTime dt = getPublishedElement();
-        return (dt != null) ? dt.getDate() : null;
+        return (dt != null) ? dt.getValue() : null;
     }
 
     public DateTime getPublishedElement() {
@@ -554,7 +554,7 @@ public class RssChannel extends Extensib
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
-    public DateTime setUpdated(Date value) {
+    public DateTime setUpdated(org.joda.time.DateTime value) {
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java Wed Oct 19 22:33:04 2011
@@ -31,6 +31,7 @@ import org.apache.abdera2.model.Element;
 
 public class RssDateTime extends DateTimeWrapper implements DateTime {
 
+  // Yes.. it really is that bad
     private static String[] masks =
         {"EEE, dd MMM yyyy HH:mm:ss z", "dd MMM yyyy HH:mm z", "dd MMM yyyy", "-yy-MM-dd", "-yy-MM", "-yymm",
          "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd'T'HH:mm:ss.SSSz", "yyyy-MM-dd't'HH:mm:ss.SSSz", // invalid
@@ -55,7 +56,7 @@ public class RssDateTime extends DateTim
     }
 
     @Override
-    public org.apache.abdera2.common.date.DateTime getValue() {
+    public org.joda.time.DateTime getValue() {
         return parse(getText());
     }
 
@@ -80,17 +81,17 @@ public class RssDateTime extends DateTim
     }
 
     @Override
-    public DateTime setValue(org.apache.abdera2.common.date.DateTime dateTime) {
+    public DateTime setValue(org.joda.time.DateTime dateTime) {
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
-    private org.apache.abdera2.common.date.DateTime parse(String value) {
+    private org.joda.time.DateTime parse(String value) {
         for (String mask : masks) {
             try {
                 SimpleDateFormat sdf = new SimpleDateFormat(mask);
                 sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
                 Date d = sdf.parse(value);
-                return new org.apache.abdera2.common.date.DateTime(d);
+                return new org.joda.time.DateTime(d);
             } catch (Exception e) {
             }
         }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java Wed Oct 19 22:33:04 2011
@@ -18,7 +18,6 @@
 package org.apache.abdera2.ext.rss;
 
 import java.util.Comparator;
-import java.util.Date;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -43,7 +42,7 @@ import org.apache.abdera2.model.Source;
 import org.apache.abdera2.model.Text;
 import org.apache.abdera2.model.Text.Type;
 
-@SuppressWarnings("unchecked")
+@SuppressWarnings({"unchecked","rawtypes"})
 public class RssFeed extends ExtensibleElementWrapper implements Feed {
 
     public RssFeed(Element internal) {
@@ -294,7 +293,7 @@ public class RssFeed extends ExtensibleE
         return getChannel().getTitleType();
     }
 
-    public Date getUpdated() {
+    public org.joda.time.DateTime getUpdated() {
         return getChannel().getUpdated();
     }
 
@@ -306,7 +305,7 @@ public class RssFeed extends ExtensibleE
         return getChannel().getUpdatedString();
     }
 
-    public Date getPublished() {
+    public org.joda.time.DateTime getPublished() {
         return getChannel().getPublished();
     }
 
@@ -441,7 +440,7 @@ public class RssFeed extends ExtensibleE
         return (T)this;
     }
 
-    public DateTime setUpdated(Date value) {
+    public DateTime setUpdated(org.joda.time.DateTime value) {
         return getChannel().setUpdated(value);
     }
 
@@ -581,4 +580,8 @@ public class RssFeed extends ExtensibleE
       return getChannel().getEntries(selector);
     }
 
+    public DateTime setUpdatedNow() {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
 }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java Wed Oct 19 22:33:04 2011
@@ -19,7 +19,6 @@ package org.apache.abdera2.ext.rss;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Date;
 import java.util.List;
 
 import javax.activation.DataHandler;
@@ -48,6 +47,7 @@ import org.apache.abdera2.model.Text;
 import org.apache.abdera2.model.Content.Type;
 import org.apache.abdera2.parser.axiom.FOMElement;
 
+@SuppressWarnings("rawtypes")
 public class RssItem extends ExtensibleElementWrapper implements Entry, IRIElement {
 
     public RssItem(Element internal) {
@@ -245,7 +245,7 @@ public class RssItem extends ExtensibleE
         return null;
     }
 
-    public Date getEdited() {
+    public org.joda.time.DateTime getEdited() {
         return null;
     }
 
@@ -305,9 +305,9 @@ public class RssItem extends ExtensibleE
         return FOMElement.getLinks(getInternal(), rel);
     }
 
-    public Date getPublished() {
+    public org.joda.time.DateTime getPublished() {
         DateTime dt = getPublishedElement();
-        return (dt != null) ? dt.getDate() : null;
+        return (dt != null) ? dt.getValue() : null;
     }
 
     public DateTime getPublishedElement() {
@@ -393,7 +393,7 @@ public class RssItem extends ExtensibleE
         return (text != null) ? text.getTextType() : null;
     }
 
-    public Date getUpdated() {
+    public org.joda.time.DateTime getUpdated() {
         return getPublished();
     }
 
@@ -469,7 +469,7 @@ public class RssItem extends ExtensibleE
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
-    public DateTime setEdited(Date value) {
+    public DateTime setEdited(org.joda.time.DateTime value) {
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
@@ -493,7 +493,7 @@ public class RssItem extends ExtensibleE
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
-    public DateTime setPublished(Date value) {
+    public DateTime setPublished(org.joda.time.DateTime value) {
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
@@ -581,7 +581,7 @@ public class RssItem extends ExtensibleE
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
-    public DateTime setUpdated(Date value) {
+    public DateTime setUpdated(org.joda.time.DateTime value) {
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
@@ -692,4 +692,16 @@ public class RssItem extends ExtensibleE
       }
       return list;
     }
+
+    public DateTime setPublishedNow() {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setUpdatedNow() {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setEditedNow() {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+    }
 }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSource.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSource.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSource.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSource.java Wed Oct 19 22:33:04 2011
@@ -18,7 +18,6 @@
 package org.apache.abdera2.ext.rss;
 
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -41,7 +40,7 @@ import org.apache.abdera2.model.Source;
 import org.apache.abdera2.model.Text;
 import org.apache.abdera2.model.Text.Type;
 
-@SuppressWarnings("unchecked")
+@SuppressWarnings({"unchecked","rawtypes"})
 public class RssSource extends ExtensibleElementWrapper implements Source {
 
     private Link self = null;
@@ -239,7 +238,7 @@ public class RssSource extends Extensibl
         return Type.HTML;
     }
 
-    public Date getUpdated() {
+    public org.joda.time.DateTime getUpdated() {
         return null;
     }
 
@@ -363,7 +362,7 @@ public class RssSource extends Extensibl
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
-    public DateTime setUpdated(Date value) {
+    public DateTime setUpdated(org.joda.time.DateTime value) {
         throw new UnsupportedOperationException("Modifications are not allowed");
     }
 
@@ -403,4 +402,8 @@ public class RssSource extends Extensibl
       return Collections.EMPTY_LIST;
     }
 
+    public DateTime setUpdatedNow() {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
 }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/ObjectResponseContext.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/ObjectResponseContext.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/ObjectResponseContext.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/ObjectResponseContext.java Wed Oct 19 22:33:04 2011
@@ -23,7 +23,7 @@ import java.util.Calendar;
 import java.util.Date;
 
 import org.apache.abdera2.Abdera;
-import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.ext.serializer.annotation.EntityTag;
 import org.apache.abdera2.ext.serializer.annotation.LastModified;
 import org.apache.abdera2.ext.serializer.annotation.MediaType;
@@ -105,9 +105,9 @@ public class ObjectResponseContext exten
         } else if (value instanceof Long) {
             date = new Date(((Long)value).longValue());
         } else if (value instanceof String) {
-            date = DateTime.parse((String)value);
+            date = DateTimes.parse((String)value);
         } else {
-            date = DateTime.parse(value.toString());
+            date = DateTimes.parse(value.toString());
         }
         return date;
     }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/impl/DateTimeSerializer.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/impl/DateTimeSerializer.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/impl/DateTimeSerializer.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/serializer/impl/DateTimeSerializer.java Wed Oct 19 22:33:04 2011
@@ -27,8 +27,8 @@ import org.apache.abdera2.ext.serializer
 import org.apache.abdera2.ext.serializer.ObjectContext;
 import org.apache.abdera2.ext.serializer.SerializationContext;
 import org.apache.abdera2.ext.serializer.annotation.Value;
-import org.apache.abdera2.common.date.DateTime;
 import org.apache.abdera2.writer.StreamWriter;
+import org.joda.time.DateTime;
 
 public class DateTimeSerializer extends ElementSerializer {
 
@@ -67,19 +67,19 @@ public class DateTimeSerializer extends 
 
     private void writeValue(Object value, SerializationContext context) {
         StreamWriter sw = context.getStreamWriter();
-        Date date = null;
+        DateTime date = null;
         if (value == null)
             return;
         if (value instanceof Date) {
-            date = (Date)value;
+            date = new DateTime(value);
         } else if (value instanceof Calendar) {
-            date = ((Calendar)value).getTime();
+            date = new DateTime(value);
         } else if (value instanceof Long) {
-            date = new Date(((Long)value).longValue());
-        } else if (value instanceof String) {
-            date = DateTime.parse((String)value);
+            date = new DateTime((Long)value);
+        } else if (value instanceof DateTime) {
+            date = (DateTime)value;
         } else {
-            date = DateTime.parse(value.toString());
+            date = new DateTime(value.toString());
         }
         sw.writeElementText(date);
     }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/History.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/History.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/History.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/History.java Wed Oct 19 22:33:04 2011
@@ -21,7 +21,7 @@ import java.util.Date;
 
 import org.apache.abdera2.factory.Factory;
 import org.apache.abdera2.common.anno.QName;
-import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.model.Element;
 import org.apache.abdera2.model.ElementWrapper;
 
@@ -51,12 +51,12 @@ public class History extends ElementWrap
 
     public Date getWhen() {
         String when = getAttributeValue("when");
-        return when != null ? DateTime.parse(when) : null;
+        return when != null ? DateTimes.parse(when) : null;
     }
 
     public void setWhen(Date when) {
         if (when != null) {
-            setAttributeValue("when", DateTime.format(when));
+            setAttributeValue("when", DateTimes.format(when));
         } else {
             removeAttribute("when");
         }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/Sharing.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/Sharing.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/Sharing.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/Sharing.java Wed Oct 19 22:33:04 2011
@@ -22,7 +22,7 @@ import java.util.List;
 
 import org.apache.abdera2.factory.Factory;
 import org.apache.abdera2.common.anno.QName;
-import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.model.Element;
 import org.apache.abdera2.model.ExtensibleElementWrapper;
 
@@ -39,12 +39,12 @@ public class Sharing extends ExtensibleE
 
     public Date getSince() {
         String since = getAttributeValue("since");
-        return since != null ? DateTime.parse(since) : null;
+        return since != null ? DateTimes.parse(since) : null;
     }
 
     public void setSince(Date since) {
         if (since != null) {
-            setAttributeValue("since", DateTime.format(since));
+            setAttributeValue("since", DateTimes.format(since));
         } else {
             removeAttribute("since");
         }
@@ -52,12 +52,12 @@ public class Sharing extends ExtensibleE
 
     public Date getUntil() {
         String until = getAttributeValue("until");
-        return until != null ? DateTime.parse(until) : null;
+        return until != null ? DateTimes.parse(until) : null;
     }
 
     public void setUntil(Date until) {
         if (until != null) {
-            setAttributeValue("until", DateTime.format(until));
+            setAttributeValue("until", DateTimes.format(until));
         } else {
             removeAttribute("until");
         }
@@ -65,12 +65,12 @@ public class Sharing extends ExtensibleE
 
     public Date getExpires() {
         String expires = getAttributeValue("expires");
-        return expires != null ? DateTime.parse(expires) : null;
+        return expires != null ? DateTimes.parse(expires) : null;
     }
 
     public void setExpires(Date expires) {
         if (expires != null) {
-            setAttributeValue("expires", DateTime.format(expires));
+            setAttributeValue("expires", DateTimes.format(expires));
         } else {
             removeAttribute("expires");
         }

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/SharingHelper.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/SharingHelper.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/SharingHelper.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/sharing/SharingHelper.java Wed Oct 19 22:33:04 2011
@@ -377,7 +377,7 @@ public class SharingHelper {
     private static Date getMax(Feed feed) {
         Date d = null;
         for (Entry entry : feed.getEntries()) {
-            Date updated = entry.getUpdated();
+            Date updated = entry.getUpdated().toDate();
             if (d == null)
                 d = updated;
             if (updated.after(d))
@@ -389,7 +389,7 @@ public class SharingHelper {
     private static Date getMin(Feed feed) {
         Date d = null;
         for (Entry entry : feed.getEntries()) {
-            Date updated = entry.getUpdated();
+            Date updated = entry.getUpdated().toDate();
             if (d == null)
                 d = updated;
             if (updated.before(d))

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/thread/ThreadHelper.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/thread/ThreadHelper.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/thread/ThreadHelper.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/thread/ThreadHelper.java Wed Oct 19 22:33:04 2011
@@ -22,11 +22,12 @@ import java.util.Date;
 
 import javax.activation.MimeType;
 
+import org.joda.time.DateTime;
 import org.apache.abdera2.factory.Factory;
-import org.apache.abdera2.common.date.DateTime;
 import org.apache.abdera2.model.Entry;
 import org.apache.abdera2.model.Link;
 import org.apache.abdera2.model.Source;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.common.iri.IRI;
 
 public final class ThreadHelper {
@@ -44,7 +45,7 @@ public final class ThreadHelper {
         String val = link.getAttributeValue(ThreadConstants.THRUPDATED);
         if (val == null) // thr:when was updated to thr:updated, some old impls may still be using thr:when
             val = link.getAttributeValue(ThreadConstants.THRWHEN);
-        return (val != null) ? DateTime.valueOf(val) : null;
+        return (val != null) ? DateTime.parse(val) : null;
     }
 
     public static void setCount(Link link, int count) {
@@ -52,19 +53,19 @@ public final class ThreadHelper {
     }
 
     public static void setUpdated(Link link, Date when) {
-        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTime.valueOf(when).getValue());
+        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTimes.format(when));
     }
 
     public static void setUpdated(Link link, Calendar when) {
-        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTime.valueOf(when).getValue());
+        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTimes.format(when));
     }
 
     public static void setUpdated(Link link, long when) {
-        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTime.valueOf(when).getValue());
+        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTimes.format(when));
     }
 
     public static void setUpdated(Link link, String when) {
-        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTime.valueOf(when).getValue());
+        link.setAttributeValue(ThreadConstants.THRUPDATED, DateTimes.format(when));
     }
 
     public static Total addTotal(Entry entry, int total) {

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/Tombstone.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/Tombstone.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/Tombstone.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/Tombstone.java Wed Oct 19 22:33:04 2011
@@ -20,10 +20,11 @@ package org.apache.abdera2.ext.tombstone
 import java.util.Calendar;
 import java.util.Date;
 
+import org.joda.time.DateTime;
 import org.apache.abdera2.factory.Factory;
 import org.apache.abdera2.common.iri.IRI;
 import org.apache.abdera2.common.anno.QName;
-import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.model.Element;
 import org.apache.abdera2.model.ExtensibleElementWrapper;
 import org.apache.abdera2.model.Person;
@@ -59,11 +60,11 @@ public class Tombstone extends Extensibl
 
     public Date getWhen() {
         String v = getAttributeValue("when");
-        return v != null ? DateTime.parse(v) : null;
+        return v != null ? DateTimes.parse(v) : null;
     }
 
     public Tombstone setWhen(Date date) {
-        return setWhen(DateTime.format(date));
+        return setWhen(DateTimes.format(date));
     }
 
     public Tombstone setWhen(String date) {
@@ -76,15 +77,15 @@ public class Tombstone extends Extensibl
     }
 
     public Tombstone setWhen(long date) {
-        return setWhen(DateTime.valueOf(date));
+        return setWhen(new DateTime(date));
     }
 
     public Tombstone setWhen(Calendar date) {
-        return setWhen(DateTime.valueOf(date));
+        return setWhen(new DateTime(date));
     }
 
     public Tombstone setWhen(DateTime date) {
-        return setWhen(date.toString());
+        return setWhen(DateTimes.format(date));
     }
 
     public Person getBy() {

Modified: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/TombstonesHelper.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/TombstonesHelper.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/TombstonesHelper.java (original)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/tombstones/TombstonesHelper.java Wed Oct 19 22:33:04 2011
@@ -22,7 +22,7 @@ import java.util.Date;
 
 import javax.xml.namespace.QName;
 
-import org.apache.abdera2.common.date.DateTime;
+import org.joda.time.DateTime;
 import org.apache.abdera2.model.Base;
 import org.apache.abdera2.model.Entry;
 import org.apache.abdera2.model.Feed;

Modified: abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.parser.Parser
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.parser.Parser?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.parser.Parser (original)
+++ abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.parser.Parser Wed Oct 19 22:33:04 2011
@@ -1 +1,2 @@
-org.apache.abdera2.ext.html.HtmlParser
\ No newline at end of file
+org.apache.abdera2.ext.html.HtmlParser
+org.apache.abdera2.ext.activities.ActivityToFeedParser
\ No newline at end of file

Modified: abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.writer.Writer
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.writer.Writer?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.writer.Writer (original)
+++ abdera/abdera2/ext/src/main/resources/META-INF/services/org.apache.abdera2.writer.Writer Wed Oct 19 22:33:04 2011
@@ -1 +1,2 @@
-org.apache.abdera2.ext.json.JSONWriter
\ No newline at end of file
+org.apache.abdera2.ext.json.JSONWriter
+org.apache.abdera2.ext.activities.FeedToActivityWriter
\ No newline at end of file

Modified: abdera/abdera2/pom.xml
URL: http://svn.apache.org/viewvc/abdera/abdera2/pom.xml?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/pom.xml (original)
+++ abdera/abdera2/pom.xml Wed Oct 19 22:33:04 2011
@@ -406,7 +406,7 @@
 
       <dependency>
         <groupId>org.apache.ws.commons.axiom</groupId>
-        <artifactId>axiom</artifactId>
+        <artifactId>axiom-api</artifactId>
         <version>1.2.12</version>
       </dependency>
 
@@ -532,9 +532,160 @@
           <version>3.0</version>
       </dependency>
       
+      <dependency>
+        <groupId>com.google.guava</groupId>
+        <artifactId>guava</artifactId>
+        <version>10.0.1</version>
+      </dependency>
+      
+          <dependency>
+      <groupId>nu.validator.htmlparser</groupId>
+      <artifactId>htmlparser</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>joda-time</groupId>
+      <artifactId>joda-time</artifactId>
+      <version>2.0</version>
+    </dependency>
+    
     </dependencies>
   </dependencyManagement>
   
+  
+    <dependencies>
+
+      <dependency>
+        <groupId>commons-codec</groupId>
+        <artifactId>commons-codec</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.httpcomponents</groupId>
+        <artifactId>httpclient</artifactId>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.apache.httpcomponents</groupId>
+        <artifactId>httpmime</artifactId>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.apache.httpcomponents</groupId>
+        <artifactId>httpcore</artifactId>
+      </dependency>
+         
+      <dependency>
+        <groupId>org.apache.httpcomponents</groupId>
+        <artifactId>httpclient-cache</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>com.google.code.gson</groupId>
+        <artifactId>gson</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.ws.commons.axiom</groupId>
+        <artifactId>axiom-api</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.ws.commons.axiom</groupId>
+        <artifactId>axiom-impl</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>commons-logging</groupId>
+        <artifactId>commons-logging</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-activation_1.1_spec</artifactId>
+      </dependency>
+            
+      <dependency>
+        <groupId>javax</groupId>
+        <artifactId>javaee-web-api</artifactId>
+        <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+        <groupId>com.ibm.icu</groupId>
+        <artifactId>icu4j</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <scope>test, compile, package</scope>
+      </dependency>
+            
+      <dependency>
+        <groupId>org.codehaus.woodstox</groupId>
+        <artifactId>wstx-asl</artifactId>
+        <scope>runtime</scope>      
+      </dependency>
+      
+      <dependency>
+        <groupId>jaxen</groupId>
+        <artifactId>jaxen</artifactId>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.apache.santuario</groupId>
+        <artifactId>xmlsec</artifactId>
+      </dependency>
+      
+      <dependency>
+        <groupId>xerces</groupId>
+        <artifactId>xercesImpl</artifactId>
+      </dependency>
+            
+      <dependency>
+        <groupId>xml-apis</groupId>
+        <artifactId>xml-apis</artifactId>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.eclipse.jetty</groupId>
+        <artifactId>jetty-server</artifactId>
+      </dependency>
+      <dependency>
+        <groupId>org.eclipse.jetty</groupId>
+        <artifactId>jetty-servlet</artifactId>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.mockito</groupId>
+        <artifactId>mockito-all</artifactId>
+      </dependency>
+      
+      <dependency>
+          <groupId>org.easymock</groupId>
+          <artifactId>easymock</artifactId>
+      </dependency>
+      
+      <dependency>
+        <groupId>com.google.guava</groupId>
+        <artifactId>guava</artifactId>
+      </dependency>
+      
+    <dependency>
+      <groupId>nu.validator.htmlparser</groupId>
+      <artifactId>htmlparser</artifactId>
+    </dependency>
+      
+    <dependency>
+      <groupId>joda-time</groupId>
+      <artifactId>joda-time</artifactId>
+    </dependency>
+      
+    </dependencies>
+  
+  
   <modules>
     <module>common</module>
     <module>core</module>

Added: abdera/abdera2/security/.classpath
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/.classpath?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/security/.classpath (added)
+++ abdera/abdera2/security/.classpath Wed Oct 19 22:33:04 2011
@@ -0,0 +1,21 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="src" path="target/maven-shared-archive-resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="src" path="/abdera2-common"/>
+  <classpathentry kind="src" path="/abdera2-core"/>
+  <classpathentry kind="src" path="/abdera2-server"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-api/1.2.12/axiom-api-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-impl/1.2.12/axiom-impl-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.5/commons-codec-1.5.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.1/geronimo-activation_1.1_spec-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.6/geronimo-javamail_1.4_spec-1.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/ibm/icu/icu4j/4.8.1.1/icu4j-4.8.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.6/wstx-asl-3.2.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/santuario/xmlsec/1.4.5/xmlsec-1.4.5.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+</classpath>
\ No newline at end of file

Propchange: abdera/abdera2/security/.classpath
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/security/.project
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/.project?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/security/.project (added)
+++ abdera/abdera2/security/.project Wed Oct 19 22:33:04 2011
@@ -0,0 +1,17 @@
+<projectDescription>
+  <name>abdera2-security</name>
+  <comment>Atom Publishing Protocol Security Implementation. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects>
+    <project>abdera2-common</project>
+    <project>abdera2-core</project>
+    <project>abdera2-server</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Propchange: abdera/abdera2/security/.project
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/security/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/.settings/org.eclipse.jdt.core.prefs?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/security/.settings/org.eclipse.jdt.core.prefs (added)
+++ abdera/abdera2/security/.settings/org.eclipse.jdt.core.prefs Wed Oct 19 22:33:04 2011
@@ -0,0 +1,5 @@
+#Thu Sep 29 16:38:20 PDT 2011
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6

Propchange: abdera/abdera2/security/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedRequestFilter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedRequestFilter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedRequestFilter.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedRequestFilter.java Wed Oct 19 22:33:04 2011
@@ -24,10 +24,10 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.abdera2.Abdera;
+import org.apache.abdera2.common.misc.Chain;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
 import org.apache.abdera2.common.protocol.Filter;
-import org.apache.abdera2.common.protocol.FilterChain;
 import org.apache.abdera2.model.Document;
 import org.apache.abdera2.model.Element;
 import org.apache.abdera2.parser.ParseException;
@@ -61,13 +61,13 @@ public abstract class AbstractEncryptedR
             Security.addProvider(provider);
     }
 
-    public <S extends ResponseContext>S filter(RequestContext request, FilterChain chain) {
+    public ResponseContext apply(RequestContext request, Chain<RequestContext,ResponseContext> chain) {
         bootstrap(request);
         String method = request.getMethod();
         if (methods.contains(method.toUpperCase())) {
-            return (S)chain.next(new DecryptingRequestContextWrapper(request));
+            return chain.next(new DecryptingRequestContextWrapper(request));
         } else
-            return (S)chain.next(request);
+            return chain.next(request);
     }
 
     protected abstract void bootstrap(RequestContext request);

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedResponseFilter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedResponseFilter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedResponseFilter.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/AbstractEncryptedResponseFilter.java Wed Oct 19 22:33:04 2011
@@ -25,10 +25,10 @@ import java.security.Provider;
 import java.security.Security;
 
 import org.apache.abdera2.Abdera;
+import org.apache.abdera2.common.misc.Chain;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
 import org.apache.abdera2.common.protocol.Filter;
-import org.apache.abdera2.common.protocol.FilterChain;
 import org.apache.abdera2.model.Document;
 import org.apache.abdera2.model.Element;
 import org.apache.abdera2.protocol.server.AtompubResponseContext;
@@ -52,13 +52,12 @@ public abstract class AbstractEncryptedR
             Security.addProvider(provider);
     }
 
-    @SuppressWarnings("unchecked")
-    public <S extends ResponseContext>S filter(RequestContext request, FilterChain chain) {
+    public ResponseContext apply(RequestContext request, Chain<RequestContext,ResponseContext> chain) {
         Object arg = initArg(request);
         if (doEncryption(request, arg)) {
-            return (S)new EncryptingResponseContext(AbstractAtompubProvider.getAbdera(request), request, chain.next(request), arg);
+            return new EncryptingResponseContext(AbstractAtompubProvider.getAbdera(request), request, chain.next(request), arg);
         } else {
-            return (S)chain.next(request);
+            return chain.next(request);
         }
     }
 

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedRequestFilter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedRequestFilter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedRequestFilter.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedRequestFilter.java Wed Oct 19 22:33:04 2011
@@ -17,10 +17,10 @@
  */
 package org.apache.abdera2.security.util.filters;
 
+import org.apache.abdera2.common.misc.Chain;
 import org.apache.abdera2.common.protocol.RequestContext.Scope;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
-import org.apache.abdera2.common.protocol.FilterChain;
 import org.apache.abdera2.security.Encryption;
 import org.apache.abdera2.security.EncryptionOptions;
 import org.apache.abdera2.security.util.Constants;
@@ -44,9 +44,8 @@ public class DHEncryptedRequestFilter ex
     public void bootstrap(RequestContext request) {
     }
 
-    @SuppressWarnings("unchecked")
-    public <S extends ResponseContext>S filter(RequestContext request, FilterChain chain) {
-        ResponseContext response = super.filter(request, chain);
+    public ResponseContext apply(RequestContext request, Chain<RequestContext,ResponseContext> chain) {
+        ResponseContext response = super.apply(request, chain);
         String method = request.getMethod();
         // include a Accept-Encryption header in the response to GET, HEAD and OPTIONS requests
         // the header will specify all the information the client needs to construct
@@ -59,7 +58,7 @@ public class DHEncryptedRequestFilter ex
             }
             response.setHeader(Constants.ACCEPT_ENCRYPTION, context.getRequestString());
         }
-        return (S)response;
+        return response;
     }
 
     protected Object initArg(RequestContext request) {

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedResponseFilter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedResponseFilter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedResponseFilter.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/DHEncryptedResponseFilter.java Wed Oct 19 22:33:04 2011
@@ -17,9 +17,9 @@
  */
 package org.apache.abdera2.security.util.filters;
 
+import org.apache.abdera2.common.misc.Chain;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
-import org.apache.abdera2.common.protocol.FilterChain;
 import org.apache.abdera2.security.Encryption;
 import org.apache.abdera2.security.EncryptionOptions;
 import org.apache.abdera2.security.util.Constants;
@@ -90,12 +90,11 @@ public class DHEncryptedResponseFilter e
 
     }
 
-    @SuppressWarnings("unchecked")
-    public <S extends ResponseContext>S filter(RequestContext request, FilterChain chain) {
-        ResponseContext response = super.filter(request, chain);
+    public ResponseContext apply(RequestContext request, Chain<RequestContext,ResponseContext> chain) {
+        ResponseContext response = super.apply(request, chain);
         DHContext context = getDHContext(request);
         response.setHeader(Constants.CONTENT_ENCRYPTED, context.getResponseString());
-        return (S)response;
+        return response;
     }
 
     private void returnPublicKey(ResponseContext response, DHContext context) {

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedRequestFilter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedRequestFilter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedRequestFilter.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedRequestFilter.java Wed Oct 19 22:33:04 2011
@@ -18,10 +18,10 @@
 package org.apache.abdera2.security.util.filters;
 
 import org.apache.abdera2.common.Localizer;
+import org.apache.abdera2.common.misc.Chain;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
 import org.apache.abdera2.common.protocol.Filter;
-import org.apache.abdera2.common.protocol.FilterChain;
 import org.apache.abdera2.common.protocol.ProviderHelper;
 import org.apache.abdera2.model.Document;
 import org.apache.abdera2.model.Element;
@@ -38,8 +38,7 @@ public class SignedRequestFilter impleme
     public static final String VALID = "org.apache.abdera.security.util.servlet.SignedRequestFilter.valid";
     public static final String CERTS = "org.apache.abdera.security.util.servlet.SignedRequestFilter.certs";
 
-    @SuppressWarnings("unchecked")
-    public <S extends ResponseContext>S filter(RequestContext request, FilterChain chain) {
+    public ResponseContext apply(RequestContext request, Chain<RequestContext,ResponseContext> chain) {
         AtompubRequestContext context = 
           request instanceof AtompubRequestContext ? 
             (AtompubRequestContext)request : 
@@ -52,13 +51,13 @@ public class SignedRequestFilter impleme
                 Document<Element> doc = context.getDocument();
                 boolean valid = sig.verify(doc.getRoot(), null);
                 if (!valid)
-                    return (S)ProviderHelper.badrequest(request, Localizer.get("VALID.SIGNATURE.REQUIRED"));
+                    return ProviderHelper.badrequest(request, Localizer.get("VALID.SIGNATURE.REQUIRED"));
                 request.setAttribute(VALID, valid);
                 request.setAttribute(CERTS, sig.getValidSignatureCertificates(doc.getRoot(), null));
             } catch (Exception e) {
             }
         }
-        return (S)chain.next(context);
+        return chain.next(context);
     }
 
 }

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedResponseFilter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedResponseFilter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedResponseFilter.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/util/filters/SignedResponseFilter.java Wed Oct 19 22:33:04 2011
@@ -27,10 +27,10 @@ import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 
 import org.apache.abdera2.Abdera;
+import org.apache.abdera2.common.misc.Chain;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
 import org.apache.abdera2.common.protocol.Filter;
-import org.apache.abdera2.common.protocol.FilterChain;
 import org.apache.abdera2.model.Document;
 import org.apache.abdera2.model.Element;
 import org.apache.abdera2.protocol.server.AtompubResponseContext;
@@ -118,9 +118,8 @@ public class SignedResponseFilter implem
         }
     }
 
-    @SuppressWarnings("unchecked")
-    public <S extends ResponseContext>S filter(RequestContext request, FilterChain chain) {
-        return (S)new SigningResponseContextWrapper(AbstractAtompubProvider.getAbdera(request), chain.next(request));
+    public ResponseContext apply(RequestContext request, Chain<RequestContext,ResponseContext> chain) {
+        return new SigningResponseContextWrapper(AbstractAtompubProvider.getAbdera(request), chain.next(request));
     }
 
     private Document<Element> signDocument(Abdera abdera, Document<Element> doc) throws SecurityException {

Added: abdera/abdera2/server/.classpath
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/.classpath?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/server/.classpath (added)
+++ abdera/abdera2/server/.classpath Wed Oct 19 22:33:04 2011
@@ -0,0 +1,19 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="src" path="target/maven-shared-archive-resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="src" path="/abdera2-common"/>
+  <classpathentry kind="src" path="/abdera2-core"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-api/1.2.12/axiom-api-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-impl/1.2.12/axiom-impl-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.5/commons-codec-1.5.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.1/geronimo-activation_1.1_spec-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.6/geronimo-javamail_1.4_spec-1.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/ibm/icu/icu4j/4.8.1.1/icu4j-4.8.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.6/wstx-asl-3.2.6.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+</classpath>
\ No newline at end of file

Propchange: abdera/abdera2/server/.classpath
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/server/.project
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/.project?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/server/.project (added)
+++ abdera/abdera2/server/.project Wed Oct 19 22:33:04 2011
@@ -0,0 +1,16 @@
+<projectDescription>
+  <name>abdera2-server</name>
+  <comment>Atom Publishing Protocol Server Implementation. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects>
+    <project>abdera2-common</project>
+    <project>abdera2-core</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Propchange: abdera/abdera2/server/.project
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/server/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/.settings/org.eclipse.jdt.core.prefs?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/server/.settings/org.eclipse.jdt.core.prefs (added)
+++ abdera/abdera2/server/.settings/org.eclipse.jdt.core.prefs Wed Oct 19 22:33:04 2011
@@ -0,0 +1,5 @@
+#Thu Sep 29 16:38:18 PDT 2011
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6

Propchange: abdera/abdera2/server/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubCollectionAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubCollectionAdapter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubCollectionAdapter.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubCollectionAdapter.java Wed Oct 19 22:33:04 2011
@@ -18,7 +18,6 @@
 package org.apache.abdera2.protocol.server.impl;
 
 import java.io.IOException;
-import java.util.Date;
 import org.apache.abdera2.Abdera;
 import org.apache.abdera2.factory.Factory;
 import org.apache.abdera2.common.protocol.AbstractCollectionAdapter;
@@ -37,6 +36,7 @@ import org.apache.abdera2.protocol.serve
 import org.apache.abdera2.protocol.server.context.FOMResponseContext;
 import org.apache.abdera2.protocol.server.model.AtompubCategoriesInfo;
 import org.apache.abdera2.protocol.server.model.AtompubCollectionInfo;
+import org.joda.time.DateTime;
 
 /**
  * Base CollectionAdapter implementation that provides a number of helper utility methods for adapter implementations.
@@ -117,7 +117,7 @@ public abstract class AbstractAtompubCol
         feed.addLink("");
         feed.addLink("", "self");
         feed.addAuthor(getAuthor(request));
-        feed.setUpdated(new Date());
+        feed.setUpdated(DateTime.now());
         return feed;
     }
 

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java Wed Oct 19 22:33:04 2011
@@ -18,7 +18,6 @@
 package org.apache.abdera2.protocol.server.impl;
 
 import java.io.IOException;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import javax.xml.namespace.QName;
@@ -26,7 +25,7 @@ import javax.xml.namespace.QName;
 import org.apache.abdera2.Abdera;
 import org.apache.abdera2.common.Constants;
 import org.apache.abdera2.common.Localizer;
-import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.common.http.EntityTag;
 import org.apache.abdera2.common.http.QualityHelper;
 import org.apache.abdera2.common.http.QualityHelper.QToken;
@@ -66,6 +65,7 @@ import org.apache.abdera2.writer.Writer;
 import org.apache.abdera2.writer.WriterFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTime;
 
 /**
  * Base Provider implementation that provides the core implementation details for all Providers. This class provides the
@@ -231,11 +231,11 @@ public abstract class AbstractAtompubPro
         if (base instanceof Entry) {
             Entry entry = (Entry)base;
             id = entry.getId().toString();
-            modified = DateTime.format(entry.getEdited() != null ? entry.getEdited() : entry.getUpdated());
+            modified = DateTimes.format(entry.getEdited() != null ? entry.getEdited() : entry.getUpdated());
         } else if (base instanceof Feed) {
             Feed feed = (Feed)base;
             id = feed.getId().toString();
-            modified = DateTime.format(feed.getUpdated());
+            modified = DateTimes.format(feed.getUpdated());
         } else if (base instanceof Document) {
             return calculateEntityTag(((Document<?>)base).getRoot());
         }
@@ -268,24 +268,24 @@ public abstract class AbstractAtompubPro
     /**
      * Return a document
      */
-    public static AtompubResponseContext returnBase(Base base, int status, Date lastModified) {
+    public static AtompubResponseContext returnBase(Base base, int status, DateTime lastModified) {
         log.debug(Localizer.get("RETURNING.DOCUMENT"));
         FOMResponseContext<Base> response = new FOMResponseContext<Base>(base);
         response.setStatus(status);
         if (lastModified != null)
-            response.setLastModified(lastModified);
+            response.setLastModified(lastModified.toDate());
         // response.setContentType(MimeTypeHelper.getMimeType(base));
         Document<?> doc = base instanceof Document ? (Document<?>)base : ((Element)base).getDocument();
         if (doc.getEntityTag() != null) {
             response.setEntityTag(doc.getEntityTag());
         } else if (doc.getLastModified() != null) {
-            response.setLastModified(doc.getLastModified());
+            response.setLastModified(doc.getLastModified().toDate());
         }
         return response;
     }
 
     @Override
     public <S extends ResponseContext> S process(RequestContext request) {
-      return (S)super.process(request instanceof AtompubRequestContext?request:new AtompubRequestContext(request));
+      return super.<S>process(request instanceof AtompubRequestContext?request:new AtompubRequestContext(request));
     }
 }

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractEntityCollectionAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractEntityCollectionAdapter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractEntityCollectionAdapter.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractEntityCollectionAdapter.java Wed Oct 19 22:33:04 2011
@@ -19,7 +19,6 @@ package org.apache.abdera2.protocol.serv
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Date;
 import java.util.List;
 
 import javax.activation.MimeType;
@@ -29,7 +28,7 @@ import org.apache.abdera2.factory.Factor
 import org.apache.abdera2.common.iri.IRI;
 import org.apache.abdera2.common.text.UrlEncoding;
 import org.apache.abdera2.common.text.CharUtils.Profile;
-import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.date.DateTimes;
 import org.apache.abdera2.model.Content;
 import org.apache.abdera2.model.Entry;
 import org.apache.abdera2.model.Feed;
@@ -46,6 +45,7 @@ import org.apache.abdera2.common.protoco
 import org.apache.abdera2.common.protocol.ResponseContextException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTime;
 
 /**
  * By extending this class it becomes easy to build Collections which are backed by a set of entities - such as a
@@ -73,7 +73,7 @@ public abstract class AbstractEntityColl
     public abstract T postEntry(String title,
                                 IRI id,
                                 String summary,
-                                Date updated,
+                                DateTime updated,
                                 List<Person> authors,
                                 Content content,
                                 RequestContext request) throws ResponseContextException;
@@ -312,7 +312,7 @@ public abstract class AbstractEntityColl
      * current date and time
      */
     protected void addFeedDetails(Feed feed, RequestContext request) throws ResponseContextException {
-        feed.setUpdated(new Date());
+        feed.setUpdated(DateTime.now());
 
         Iterable<T> entries = getEntries(request);
         if (entries != null) {
@@ -371,10 +371,10 @@ public abstract class AbstractEntityColl
      * media resource. The last-modified header will be set.
      */
     protected <S extends ResponseContext>S buildGetMediaResponse(String id, T entryObj) throws ResponseContextException {
-        Date updated = getUpdated(entryObj);
-        MediaResponseContext ctx = new MediaResponseContext(getMediaStream(entryObj), updated, 200);
+        DateTime updated = getUpdated(entryObj);
+        MediaResponseContext ctx = new MediaResponseContext(getMediaStream(entryObj), updated.toDate(), 200);
         ctx.setContentType(getContentType(entryObj));
-        ctx.setEntityTag(EntityTag.generate(id, DateTime.format(updated)));
+        ctx.setEntityTag(EntityTag.generate(id, DateTimes.format(updated)));
         return (S)ctx;
     }
 
@@ -405,7 +405,7 @@ public abstract class AbstractEntityColl
     /**
      * Get the value to use in the atom:updated element
      */
-    public abstract Date getUpdated(T entry) throws ResponseContextException;
+    public abstract DateTime getUpdated(T entry) throws ResponseContextException;
 
     /**
      * True if this entry is a media-link entry. By default this always returns false. Implementations must override to
@@ -440,7 +440,7 @@ public abstract class AbstractEntityColl
                     if (!AbstractAtompubProvider.isValidEntry(entry))
                         return (S)new EmptyResponseContext(400);
 
-                    putEntry(entryObj, entry.getTitle(), new Date(), entry.getAuthors(), entry.getSummary(), entry
+                    putEntry(entryObj, entry.getTitle(), DateTime.now(), entry.getAuthors(), entry.getSummary(), entry
                         .getContentElement(), request);
                     return (S)new EmptyResponseContext(204);
                 } else {
@@ -482,7 +482,7 @@ public abstract class AbstractEntityColl
      */
     public abstract void putEntry(T entry,
                                   String title,
-                                  Date updated,
+                                  DateTime updated,
                                   List<Person> authors,
                                   String summary,
                                   Content content,
@@ -595,7 +595,7 @@ public abstract class AbstractEntityColl
                 if (!AbstractAtompubProvider.isValidEntry(entry))
                     return (S)new EmptyResponseContext(400);
 
-                entry.setUpdated(new Date());
+                entry.setUpdated(DateTime.now());
 
                 T entryObj =
                     postEntry(entry.getTitle(), entry.getId(), entry.getSummary(), entry.getUpdated(), entry

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java Wed Oct 19 22:33:04 2011
@@ -62,7 +62,6 @@ public class ServiceRequestProcessor 
         }
     }
 
-    @SuppressWarnings("unchecked")
     protected <S extends ResponseContext>S getServiceDocument(
         final RequestContext request, 
         final WorkspaceManager workspaceManager) {

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/provider/basic/BasicAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/provider/basic/BasicAdapter.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/provider/basic/BasicAdapter.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/provider/basic/BasicAdapter.java Wed Oct 19 22:33:04 2011
@@ -17,7 +17,6 @@
  */
 package org.apache.abdera2.protocol.server.provider.basic;
 
-import java.util.Date;
 import java.util.logging.Logger;
 
 import javax.activation.MimeType;
@@ -36,6 +35,7 @@ import org.apache.abdera2.common.protoco
 import org.apache.abdera2.common.protocol.ResponseContext;
 import org.apache.abdera2.common.protocol.ProviderHelper;
 import org.apache.abdera2.common.protocol.Target;
+import org.joda.time.DateTime;
 
 /**
  * The BasicAdapter provides a simplistic interface for working with Atompub collections with a restricted set of
@@ -65,7 +65,7 @@ public abstract class BasicAdapter exten
         Feed feed = abdera.newFeed();
         feed.setId(config.getFeedUri());
         feed.setTitle(config.getFeedTitle());
-        feed.setUpdated(new Date());
+        feed.setUpdated(DateTime.now());
         feed.addAuthor(config.getFeedAuthor());
         return feed;
     }

Added: abdera/abdera2/test/.classpath
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/.classpath?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/test/.classpath (added)
+++ abdera/abdera2/test/.classpath Wed Oct 19 22:33:04 2011
@@ -0,0 +1,47 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="src" path="target/maven-shared-archive-resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="src" path="/abdera2-activities"/>
+  <classpathentry kind="src" path="/abdera2-client"/>
+  <classpathentry kind="src" path="/abdera2-common"/>
+  <classpathentry kind="src" path="/abdera2-core"/>
+  <classpathentry kind="src" path="/abdera2-ext"/>
+  <classpathentry kind="src" path="/abdera2-security"/>
+  <classpathentry kind="src" path="/abdera2-server"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-api/1.2.12/axiom-api-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-impl/1.2.12/axiom-impl-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.2/cglib-nodep-2.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.5/commons-codec-1.5.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/easymock/easymock/3.0/easymock-3.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.1/geronimo-activation_1.1_spec-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.6/geronimo-javamail_1.4_spec-1.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/google/code/gson/gson/1.7.1/gson-1.7.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/nu/validator/htmlparser/htmlparser/1.2.1/htmlparser-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient-cache/4.1.2/httpclient-cache-4.1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpmime/4.1.2/httpmime-4.1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/ibm/icu/icu4j/4.8.1.1/icu4j-4.8.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-continuation/8.0.0.v20110901/jetty-continuation-8.0.0.v20110901.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-http/8.0.0.v20110901/jetty-http-8.0.0.v20110901.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-io/8.0.0.v20110901/jetty-io-8.0.0.v20110901.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-security/8.0.0.v20110901/jetty-security-8.0.0.v20110901.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-server/8.0.0.v20110901/jetty-server-8.0.0.v20110901.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-servlet/8.0.0.v20110901/jetty-servlet-8.0.0.v20110901.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-util/8.0.0.v20110901/jetty-util-8.0.0.v20110901.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.9/junit-4.9.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.2/objenesis-1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/xalan/serializer/2.7.1/serializer-2.7.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api/3.0.20100224/servlet-api-3.0.20100224.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.6/wstx-asl-3.2.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/santuario/xmlsec/1.4.5/xmlsec-1.4.5.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+</classpath>
\ No newline at end of file

Propchange: abdera/abdera2/test/.classpath
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/test/.project
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/.project?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/test/.project (added)
+++ abdera/abdera2/test/.project Wed Oct 19 22:33:04 2011
@@ -0,0 +1,21 @@
+<projectDescription>
+  <name>abdera2-test</name>
+  <comment>Abdera Tests. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects>
+    <project>abdera2-activities</project>
+    <project>abdera2-client</project>
+    <project>abdera2-common</project>
+    <project>abdera2-core</project>
+    <project>abdera2-ext</project>
+    <project>abdera2-security</project>
+    <project>abdera2-server</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Propchange: abdera/abdera2/test/.project
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/test/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/.settings/org.eclipse.jdt.core.prefs?rev=1186541&view=auto
==============================================================================
--- abdera/abdera2/test/.settings/org.eclipse.jdt.core.prefs (added)
+++ abdera/abdera2/test/.settings/org.eclipse.jdt.core.prefs Wed Oct 19 22:33:04 2011
@@ -0,0 +1,5 @@
+#Thu Sep 29 16:38:23 PDT 2011
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6

Propchange: abdera/abdera2/test/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java Wed Oct 19 22:33:04 2011
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
-import java.util.Date;
 
 import org.apache.abdera2.activities.client.ActivityEntity;
 import org.apache.abdera2.activities.model.ASObject;
@@ -95,7 +94,7 @@ public class AsyncBasicTest {
         activity.setId("http://localhost:9002/sample/foo");
         activity.setTitle("test entry");
         activity.setVerb(Verb.POST);
-        activity.setPublished(new Date());
+        activity.setPublishedNow();
         PersonObject person = new PersonObject();
         person.setDisplayName("James");
         activity.setActor(person);

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java?rev=1186541&r1=1186540&r2=1186541&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java Wed Oct 19 22:33:04 2011
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
-import java.util.Date;
 
 import org.apache.abdera2.activities.client.ActivityEntity;
 import org.apache.abdera2.activities.model.ASObject;
@@ -86,7 +85,7 @@ public class BasicTest {
         activity.setId("http://localhost:9002/sample/foo");
         activity.setTitle("test entry");
         activity.setVerb(Verb.POST);
-        activity.setPublished(new Date());
+        activity.setPublishedNow();
         PersonObject person = new PersonObject();
         person.setDisplayName("James");
         activity.setActor(person);
@@ -172,7 +171,7 @@ public class BasicTest {
           activity.setId("http://localhost:9002/sample/foo" + n);
           activity.setTitle("test entry " + n);
           activity.setVerb(Verb.POST);
-          activity.setPublished(new Date());
+          activity.setPublishedNow();
           PersonObject person = new PersonObject();
           person.setDisplayName("James");
           activity.setActor(person);



Mime
View raw message