Skip to content

Commit

Permalink
replace more TODO comments with quasi-informative statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 1, 2013
1 parent 638c136 commit 65fc38d
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 33 deletions.
Expand Up @@ -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 {
Expand All @@ -41,26 +46,24 @@ public class SitemapEntry {
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
Expand Down
Expand Up @@ -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")
Expand All @@ -31,14 +36,14 @@ public class SitemapIndex {
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
*/
Expand All @@ -47,7 +52,7 @@ public void appendSitemapEntry(final SitemapEntry e) {
}

/**
* TODO
* Get all the sitemap's entries
*
* @return
*/
Expand Down
Expand Up @@ -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
*/
Expand All @@ -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;
}
Expand Down
Expand Up @@ -30,7 +30,7 @@
public @interface HtmlTemplate {

/**
* TODO
* The name of the HMTL template to render for this method
*
* @return
*/
Expand Down
Expand Up @@ -34,13 +34,13 @@ public class AuthenticatedSessionProviderImpl implements
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;
}
Expand Down
Expand Up @@ -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);
Expand All @@ -43,14 +47,14 @@ public class SessionFactory {
private TransactionService transactionService;

/**
* TODO
* initialize an empty session factory
*/
public SessionFactory() {

}

/**
* TODO
* Initialize a session factory for the given Repository
*
* @param repo
* @param transactionService
Expand All @@ -62,7 +66,7 @@ public SessionFactory(final Repository repo,
}

/**
* TODO
* Validate the spring wiring
*/
@PostConstruct
public void init() {
Expand Down
Expand Up @@ -52,7 +52,7 @@ public class SessionProvider extends
private static final Logger logger = getLogger(SessionProvider.class);

/**
* TODO
* Yes, this provider really provides sessions
*/
public SessionProvider() {
super(Session.class);
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand All @@ -63,7 +67,8 @@ public class JMSTopicPublisher {
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
Expand All @@ -83,7 +88,7 @@ public void publishJCREvent(final Event fedoraEvent) throws JMSException,
}

/**
* TODO
* Connect to JCR Repostory and JMS queue
*
* @throws JMSException
* @throws RepositoryException
Expand All @@ -102,7 +107,7 @@ public void acquireConnections() throws JMSException, RepositoryException {
}

/**
* TODO
* Close external connections
*
* @throws JMSException
*/
Expand Down
Expand Up @@ -50,7 +50,7 @@
public class MetricsConfig {

/**
* TODO
* Provide the reporter factory to Spring
*
* @return
*/
Expand Down
15 changes: 12 additions & 3 deletions fcrepo-rss/src/main/java/org/fcrepo/syndication/RSSPublisher.java
Expand Up @@ -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;
Expand Down Expand Up @@ -71,7 +72,7 @@ public class RSSPublisher extends AbstractResource {
private final SyndFeed feed = new SyndFeedImpl();

/**
* TODO
* Get the RSS feed
*
* @return
* @throws FeedException
Expand Down Expand Up @@ -111,7 +112,7 @@ public SyndEntry apply(final Event event) {
};

/**
* TODO
* Engage the eventbus listener and set basic feed properties
*/
@Override
@PostConstruct
Expand All @@ -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
*/
Expand Down
Expand Up @@ -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.