Package com.bhle.access.bookreader.batch

Source Code of com.bhle.access.bookreader.batch.BookInfoTasklet

package com.bhle.access.bookreader.batch;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;

import com.bhle.access.bookreader.BookInfo;
import com.bhle.access.bookreader.BookInfoBuilder;
import com.bhle.access.util.FedoraURI;

public class BookInfoTasklet implements Tasklet {

  private String pid;

  public void setPid(String pid) {
    this.pid = pid;
  }

  @Override
  public RepeatStatus execute(StepContribution contribution,
      ChunkContext chunkContext) throws Exception {
    String guid = FedoraURI.getGuidFromPid(pid);

    BookInfo info = BookInfoBuilder.build(guid);
    BookInfoBuilder.save(info);
    return RepeatStatus.FINISHED;
  }

}
TOP

Related Classes of com.bhle.access.bookreader.batch.BookInfoTasklet

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.