Skip to content

Commit

Permalink
Helpful extra cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Nov 1, 2013
1 parent 7f3532a commit 023ec12
Showing 1 changed file with 28 additions and 33 deletions.
61 changes: 28 additions & 33 deletions fcrepo-jms/src/main/java/org/fcrepo/jms/legacy/LegacyMethod.java
Expand Up @@ -96,7 +96,7 @@ public class LegacyMethod {

/**
* TODO
*
*
* @param jcrEvent
* @param resource
* @throws RepositoryException
Expand Down Expand Up @@ -133,7 +133,7 @@ public LegacyMethod(final Event jcrEvent, final Node resource)

/**
* TODO
*
*
* @param atomEntry
*/
public LegacyMethod(final Entry atomEntry) {
Expand All @@ -142,7 +142,7 @@ public LegacyMethod(final Entry atomEntry) {

/**
* TODO
*
*
* @param atomEntry
*/
public LegacyMethod(final String atomEntry) {
Expand All @@ -151,7 +151,7 @@ public LegacyMethod(final String atomEntry) {

/**
* TODO
*
*
* @return
*/
public Entry getEntry() {
Expand All @@ -160,7 +160,7 @@ public Entry getEntry() {

/**
* TODO
*
*
* @param content
*/
public void setContent(final String content) {
Expand All @@ -169,11 +169,11 @@ public void setContent(final String content) {

/**
* TODO
*
*
* @param val
*/
public void setUserId(String val) {
if (val == null) {
public void setUserId(final String val) {
if (val == null || "<anonymous>".equals(val)) {
delegate.addAuthor("unknown", null, getBaseURL());
} else {
delegate.addAuthor(val, null, getBaseURL());
Expand All @@ -182,7 +182,7 @@ public void setUserId(String val) {

/**
* TODO
*
*
* @return
*/
public String getUserID() {
Expand All @@ -191,7 +191,7 @@ public String getUserID() {

/**
* TODO
*
*
* @param date
*/
public void setModified(final Date date) {
Expand All @@ -200,7 +200,7 @@ public void setModified(final Date date) {

/**
* TODO
*
*
* @return
*/
public Date getModified() {
Expand All @@ -209,7 +209,7 @@ public Date getModified() {

/**
* TODO
*
*
* @param val
*/
public void setMethodName(final String val) {
Expand All @@ -218,18 +218,18 @@ public void setMethodName(final String val) {

/**
* TODO
*
*
* @return
*/
public String getMethodName() {
return delegate.getTitle();
}

private void setLabelledCategory(String label, String val) {
private void setLabelledCategory(final String label, final String val) {
final List<Category> vals = delegate.getCategories(FEDORA_ID_SCHEME);
Category found = null;
if (vals != null && !vals.isEmpty()) {
for (Category c : vals) {
for (final Category c : vals) {
if (label.equals(c.getLabel())) {
found = c.setTerm(val);
}
Expand All @@ -240,7 +240,7 @@ private void setLabelledCategory(String label, String val) {
}
}

private String getLabelledCategory(String label) {
private String getLabelledCategory(final String label) {
final List<Category> categories =
delegate.getCategories(FEDORA_ID_SCHEME);
for (final Category c : categories) {
Expand All @@ -253,7 +253,7 @@ private String getLabelledCategory(String label) {

/**
* TODO
*
*
* @param val
*/
public void setPid(final String val) {
Expand All @@ -263,7 +263,7 @@ public void setPid(final String val) {

/**
* TODO
*
*
* @return
*/
public String getPid() {
Expand All @@ -272,7 +272,7 @@ public String getPid() {

/**
* TODO
*
*
* @param val
*/
public void setDsId(final String val) {
Expand All @@ -281,7 +281,7 @@ public void setDsId(final String val) {

/**
* TODO
*
*
* @return
*/
public String getDsId() {
Expand All @@ -292,15 +292,15 @@ public String getDsId() {
* Adds node path as a category
* @param path
*/
private void setPath(String path) {
private void setPath(final String path) {
setLabelledCategory("path", path);
}

protected String getBaseURL() {
StringBuilder url = new StringBuilder();
String host = System.getProperty("fcrepo.host", "localhost");
String port = System.getProperty("fcrepo.port", "8080");
String ctxt = System.getProperty("fcrepo.ctxt", "rest");
final StringBuilder url = new StringBuilder();
final String host = System.getProperty("fcrepo.host", "localhost");
final String port = System.getProperty("fcrepo.port", "8080");
final String ctxt = System.getProperty("fcrepo.ctxt", "rest");

url.append(port.equalsIgnoreCase("443") ? "https://" : "http://");
url.append(host);
Expand All @@ -313,7 +313,7 @@ protected String getBaseURL() {

/**
* TODO
*
*
* @param writer
* @throws IOException
*/
Expand Down Expand Up @@ -381,19 +381,14 @@ protected static String mapMethodName(final int eventType,
return isObjectNode ? INGEST_METHOD : ADD_DS_METHOD;
case NODE_REMOVED:
return isObjectNode ? PURGE_OBJ_METHOD : PURGE_DS_METHOD;
case PROPERTY_ADDED:
return isObjectNode ? MODIFY_OBJ_METHOD : MODIFY_DS_METHOD;
case PROPERTY_CHANGED:
return isObjectNode ? MODIFY_OBJ_METHOD : MODIFY_DS_METHOD;
case PROPERTY_REMOVED:
default :
return isObjectNode ? MODIFY_OBJ_METHOD : MODIFY_DS_METHOD;
}
return null;
}

/**
* TODO
*
*
* @param jmsMessage
* @return
*/
Expand Down

0 comments on commit 023ec12

Please sign in to comment.