Permalink
Browse files

replace more TODO comments with quasi-informative statements

  • Loading branch information...
cbeer committed Jul 1, 2013
1 parent 638c136 commit 65fc38d2d5490f698a448e2d1b48f03648140082
@@ -24,6 +24,11 @@
import javax.xml.bind.annotation.XmlRootElement;
+/**
+ * Entry in a sitemap document
+ *
+ * @TODO replace with a 3rd party sitemap impl
+ */
@XmlRootElement(name = "url",
namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")
public class SitemapEntry {
@@ -41,26 +46,24 @@
private static final double priority = 0.8;
/**
- * TODO
+ * (default constructor used by JAX-B)
*/
- public SitemapEntry() {
- loc = null;
- lastmod = null;
+ public SitemapEntry() throws RepositoryException {
+ this(null, null);
}
/**
- * TODO
+ * Sitemap entry for a URL with a default last modified date
*
* @param loc
* @throws RepositoryException
*/
public SitemapEntry(final URI loc) throws RepositoryException {
- this.loc = loc;
- lastmod = Calendar.getInstance();
+ this(loc, Calendar.getInstance());
}
/**
- * TODO
+ * Sitemap entry for a URL with a last modified date
*
* @param loc
* @param lastmod
@@ -23,6 +23,11 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
+/**
+ * A Sitemap index is a sitemap of other sitemaps
+ *
+ * @TODO replace with a 3rd party sitemap impl
+ */
@XmlRootElement(name = "sitemapindex",
namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")
@XmlType(namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")
@@ -31,14 +36,14 @@
private final List<SitemapEntry> entries = new ArrayList<SitemapEntry>();
/**
- * TODO
+ * Create a new sitemap index (sitemap-of-sitemaps)
*/
public SitemapIndex() {
}
/**
- * TODO
+ * Add an entry to the sitemap
*
* @param e
*/
@@ -47,7 +52,7 @@ public void appendSitemapEntry(final SitemapEntry e) {
}
/**
- * TODO
+ * Get all the sitemap's entries
*
* @return
*/
@@ -22,24 +22,27 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+/**
+ * Suspiciously similar to {@link SitemapIndex}, a sitemap of entries.
+ *
+ * @TODO replace with a 3rd party sitemap impl
+ */
@XmlRootElement(name = "urlset",
namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")
public class SitemapUrlSet {
- @XmlElement(name = "url",
- namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")
private final List<SitemapEntry> sitemapEntries =
new ArrayList<SitemapEntry>();
/**
- * TODO
+ * Create a new sitemap with the default settings
*/
public SitemapUrlSet() {
}
/**
- * TODO
+ * Add an entry to the sitemap
*
* @param e
*/
@@ -48,10 +51,12 @@ public void appendSitemapEntry(final SitemapEntry e) {
}
/**
- * TODO
+ * Get all the sitemap entries
*
* @return
*/
+ @XmlElement(name = "url",
+ namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")
public List<SitemapEntry> getSitemapEntries() {
return sitemapEntries;
}
@@ -30,7 +30,7 @@
public @interface HtmlTemplate {
/**
- * TODO
+ * The name of the HMTL template to render for this method
*
* @return
*/
@@ -34,13 +34,13 @@
private final ServletCredentials credentials;
/**
- * TODO
+ * Get a new session provider for the JCR repository
*
* @param repo
* @param creds
*/
- public AuthenticatedSessionProviderImpl(Repository repo,
- ServletCredentials creds) {
+ public AuthenticatedSessionProviderImpl(final Repository repo,
+ final ServletCredentials creds) {
repository = repo;
credentials = creds;
}
@@ -32,6 +32,10 @@
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
+/**
+ * Factory for generating sessions for HTTP requests, taking
+ * into account transactions, workspaces, and authentication.
+ */
public class SessionFactory {
private static final Logger logger = getLogger(SessionFactory.class);
@@ -43,14 +47,14 @@
private TransactionService transactionService;
/**
- * TODO
+ * initialize an empty session factory
*/
public SessionFactory() {
}
/**
- * TODO
+ * Initialize a session factory for the given Repository
*
* @param repo
* @param transactionService
@@ -62,7 +66,7 @@ public SessionFactory(final Repository repo,
}
/**
- * TODO
+ * Validate the spring wiring
*/
@PostConstruct
public void init() {
@@ -52,7 +52,7 @@
private static final Logger logger = getLogger(SessionProvider.class);
/**
- * TODO
+ * Yes, this provider really provides sessions
*/
public SessionProvider() {
super(Session.class);
@@ -45,6 +45,10 @@
import org.fcrepo.utils.FedoraTypesUtils;
import org.slf4j.Logger;
+/**
+ * Serialize events as ATOM XML messages similar to
+ * Fedora 3.x
+ */
public class LegacyMethod {
// TODO Figure out where to get the base url
@@ -23,10 +23,14 @@
import javax.jms.JMSException;
import javax.jms.Message;
+/**
+ * Produce a JMS Message from a JCR Event
+ */
public interface JMSEventMessageFactory {
/**
- * TODO
+ * Produce a JMS message from a JCR event with the
+ * given session
*
* @param jcrEvent
* @param jcrSession
@@ -38,6 +38,10 @@
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
+/**
+ * Machinery to publish JMS messages when an EventBus
+ * message is received.
+ */
public class JMSTopicPublisher {
@Inject
@@ -63,7 +67,8 @@
private javax.jcr.Session session;
/**
- * TODO
+ * When an EventBus mesage is received, map it to our JMS
+ * message payload and push it onto the queue.
*
* @param fedoraEvent
* @throws JMSException
@@ -83,7 +88,7 @@ public void publishJCREvent(final Event fedoraEvent) throws JMSException,
}
/**
- * TODO
+ * Connect to JCR Repostory and JMS queue
*
* @throws JMSException
* @throws RepositoryException
@@ -102,7 +107,7 @@ public void acquireConnections() throws JMSException, RepositoryException {
}
/**
- * TODO
+ * Close external connections
*
* @throws JMSException
*/
@@ -50,7 +50,7 @@
public class MetricsConfig {
/**
- * TODO
+ * Provide the reporter factory to Spring
*
* @return
*/
@@ -27,6 +27,7 @@
import java.util.concurrent.BlockingQueue;
import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
import javax.jcr.RepositoryException;
import javax.jcr.observation.Event;
import javax.ws.rs.GET;
@@ -71,7 +72,7 @@
private final SyndFeed feed = new SyndFeedImpl();
/**
- * TODO
+ * Get the RSS feed
*
* @return
* @throws FeedException
@@ -111,7 +112,7 @@ public SyndEntry apply(final Event event) {
};
/**
- * TODO
+ * Engage the eventbus listener and set basic feed properties
*/
@Override
@PostConstruct
@@ -123,7 +124,15 @@ public void initialize() {
}
/**
- * TODO
+ * Remove our EventBus listener
+ */
+ @PreDestroy
+ public void shutDown() {
+ eventBus.unregister(this);
+ }
+
+ /**
+ * When a new event is received, add it to the buffer.
*
* @param event
*/
@@ -272,10 +272,11 @@ public final void setReadOnlySession() {
}
/**
- * TODO
+ * Destroy the read-only session when we're done with it
*/
@PreDestroy
public final void logoutSession() {
+ eventBus.unregister(this);
readOnlySession.logout();
}
}

0 comments on commit 65fc38d

Please sign in to comment.