Skip to content

Commit

Permalink
JavaDoc update
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberrolandvaltech committed Jul 16, 2018
1 parent c422d72 commit 58c8662
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
package de.valtech.aecu.core.groovy.console.bindings;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import javax.annotation.Nonnull;

import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.ResourceResolver;
import org.scribe.utils.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.valtech.aecu.core.groovy.console.bindings.actions.Action;
import de.valtech.aecu.core.groovy.console.bindings.actions.PrintPath;
import de.valtech.aecu.core.groovy.console.bindings.actions.multivalue.AddMultiValues;
Expand All @@ -22,19 +35,6 @@
import de.valtech.aecu.core.groovy.console.bindings.traversers.ForResources;
import de.valtech.aecu.core.groovy.console.bindings.traversers.TraversData;

import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.ResourceResolver;
import org.scribe.utils.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import javax.annotation.Nonnull;

public class ContentUpgrade {

private static Logger LOG = LoggerFactory.getLogger(ContentUpgrade.class);
Expand All @@ -51,7 +51,10 @@ public ContentUpgrade(@Nonnull ResourceResolver resourceResolver) {
}

/**
* content path filter methods
* Loops for given list of resources.
*
* @param paths list of paths
* @return upgrade object
**/
public ContentUpgrade forResources(@Nonnull String[] paths) {
LOG.debug("forResources: {}", paths.toString());
Expand All @@ -72,7 +75,10 @@ public ContentUpgrade forDescendantResourcesOf(@Nonnull String path) {
}

/**
* filters
* Filters by properties.
*
* @param conditionProperties properties to filter
* @return upgrade object
**/
public ContentUpgrade filterByProperties(@Nonnull Map<String, String> conditionProperties) {
LOG.debug("filterByProperties: {}", MapUtils.toString(conditionProperties));
Expand All @@ -99,7 +105,11 @@ public ContentUpgrade filterWith(@Nonnull FilterBy filter) {
}

/**
* properties edit methods
* Sets a property value.
*
* @param name property name
* @param value property value
* @return upgrade object
**/
public ContentUpgrade doSetProperty(@Nonnull String name, Object value) {
LOG.debug("doSetProperty: {} = {}", name, value);
Expand Down Expand Up @@ -153,9 +163,6 @@ public ContentUpgrade doReplaceValuesOfMultiValueProperty(@Nonnull String name,
return this;
}

/**
* resource edit methods
**/
public ContentUpgrade doCopyResourceToRelativePath(@Nonnull String relativePath) {
LOG.debug("doCopyResource to {}", relativePath);
actions.add(new CopyResourceToRelativePath(relativePath, resourceResolver));
Expand All @@ -176,16 +183,15 @@ public ContentUpgrade doDeleteResource() {

/**
* Print path
*
* @return upgrade object
*/
public ContentUpgrade printPath() {
LOG.debug("printPath");
actions.add(new PrintPath());
return this;
}

/**
* runner methods
**/
public StringBuffer run() throws PersistenceException {
LOG.debug("apply content upgrade");
return run(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public void storeExecutionInHistory(HistoryEntry history, ExecutionResult result
*
* @param history open history entry
* @param resolver resource resolver
* @return history entry
*/
public void finishHistoryEntry(HistoryEntry history, ResourceResolver resolver) {
Resource resource = resolver.getResource(history.getRepositoryPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public interface AecuServiceMBean {
* @param start start index (0 is last run)
* @param count number of entries to return
* @return history entries
* @throws AecuException error reading history
*/
@Description("Returns the last history entries")
String getHistory(@Name("Start index") int start, @Name("Count") int count) throws AecuException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class AecuServiceMBeanImpl extends AnnotatedStandardMBean implements Aecu

/**
* Constructor
*
* @throws NotCompliantMBeanException error setting up mbean
*/
public AecuServiceMBeanImpl() throws NotCompliantMBeanException {
super(AecuServiceMBean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ protected HistoryEntry finishHistoryEntry(HistoryEntry historyEntry, String hist
* This method builds the JSON String for the response. Eg: {"success":
* true,"historyEntryPath":"/var/aecu/2018/6/13/152892696338961314"}
*
* @param status success or fail
* @param historyEntryPath path to history node
* @return json String
*/
protected String prepareJson(boolean status, String historyEntryPath) {
Expand Down

0 comments on commit 58c8662

Please sign in to comment.