// Path: src/main/java/com/bazoud/elasticsearch/river/git/beans/Context.java
// @Data
// @SuppressWarnings("PMD.UnusedPrivateField")
// public class Context {
//     private String name;
//     private String uri;
//     private File projectPath;
//     private Repository repository;
//     private String workingDir =
//         System.getProperty("user.home") + File.separator + ".elasticsearch-river-git";
//     private Collection<Ref> refs;
//     private Client client;
//     private Optional<Pattern> issuePattern = Optional.absent();
//     private String issueRegex;
//     private boolean indexingDiff;
//     private long updateRate = TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES);
//     private String type = "git";
//     private String riverName;
//     private String riverIndexName;
// }
// 
// Path: src/main/java/com/bazoud/elasticsearch/river/git/beans/IndexTag.java
// @Data
// @Builder
// @SuppressWarnings("PMD.UnusedPrivateField")
// public class IndexTag implements Id {
//     private String id;
//     private String tag;
//     private String ref;
//     private String sha1;
// }
// 
// Path: src/main/java/com/bazoud/elasticsearch/river/git/guava/MyFunction.java
// public abstract class MyFunction<F, T> implements Function<F, T> {
//     private static ESLogger logger = Loggers.getLogger(MyFunction.class);
// 
//     @Override
//     public T apply(F input) {
//         T output = null;
//         try {
//             output = doApply(input);
//         } catch (Throwable e) {
//             logger.error(this.getClass().getName(), e);
//             Throwables.propagate(e);
//         }
//         return output;
//     }
// 
//     public abstract T doApply(F input) throws Throwable;
// }


import java.util.Map;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import com.bazoud.elasticsearch.river.git.beans.Context;
import com.bazoud.elasticsearch.river.git.beans.IndexTag;
import com.bazoud.elasticsearch.river.git.guava.MyFunction;
import static com.bazoud.elasticsearch.river.git.IndexedDocumentType.TAG;
package com.bazoud.elasticsearch.river.git.flow.functions;





/**
 * @author Olivier Bazoud
 */
public class TagToIndexTag extends MyFunction<Map.Entry<String, Ref>, IndexTag> {
    private static ESLogger logger = Loggers.getLogger(TagToIndexTag.class);
    private Context context;
    private final RevWalk walk;

// Path: src/main/java/com/bazoud/elasticsearch/river/git/beans/Context.java
// @Data
// @SuppressWarnings("PMD.UnusedPrivateField")
// public class Context {
//     private String name;
//     private String uri;
//     private File projectPath;
//     private Repository repository;
//     private String workingDir =
//         System.getProperty("user.home") + File.separator + ".elasticsearch-river-git";
//     private Collection<Ref> refs;
//     private Client client;
//     private Optional<Pattern> issuePattern = Optional.absent();
//     private String issueRegex;
//     private boolean indexingDiff;
//     private long updateRate = TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES);
//     private String type = "git";
//     private String riverName;
//     private String riverIndexName;
// }
// 
// Path: src/main/java/com/bazoud/elasticsearch/river/git/beans/IndexTag.java
// @Data
// @Builder
// @SuppressWarnings("PMD.UnusedPrivateField")
// public class IndexTag implements Id {
//     private String id;
//     private String tag;
//     private String ref;
//     private String sha1;
// }
// 
// Path: src/main/java/com/bazoud/elasticsearch/river/git/guava/MyFunction.java
// public abstract class MyFunction<F, T> implements Function<F, T> {
//     private static ESLogger logger = Loggers.getLogger(MyFunction.class);
// 
//     @Override
//     public T apply(F input) {
//         T output = null;
//         try {
//             output = doApply(input);
//         } catch (Throwable e) {
//             logger.error(this.getClass().getName(), e);
//             Throwables.propagate(e);
//         }
//         return output;
//     }
// 
//     public abstract T doApply(F input) throws Throwable;
// }


// Path: src/main/java/com/bazoud/elasticsearch/river/git/flow/functions/TagToIndexTag.java
import java.util.Map;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import com.bazoud.elasticsearch.river.git.beans.Context;
import com.bazoud.elasticsearch.river.git.beans.IndexTag;
import com.bazoud.elasticsearch.river.git.guava.MyFunction;
import static com.bazoud.elasticsearch.river.git.IndexedDocumentType.TAG;

package com.bazoud.elasticsearch.river.git.flow.functions;





/**
 * @author Olivier Bazoud
 */
public class TagToIndexTag extends MyFunction<Map.Entry<String, Ref>, IndexTag> {
    private static ESLogger logger = Loggers.getLogger(TagToIndexTag.class);
    private Context context;
    private final RevWalk walk;

    public TagToIndexTag(Context context, RevWalk walk) {