Package net.raymanoz.command

Source Code of net.raymanoz.command.ListCommand

package net.raymanoz.command;

import net.raymanoz.migrate.Script;
import net.raymanoz.migrate.ScriptList;

public class ListCommand implements Command {

  private static final String COMMAND_STRING = "list";
  private CommandAssembler assembler;
 
  public ListCommand(CommandAssembler assembler) {
    this.assembler = assembler;
  }


  public void execute(String[] args) {
    execute();
  }

  public void execute() {
    ScriptList scriptList = getScriptList();
    if(scriptList.size() == 0) {
      System.out.println("No migrate actions found");
    } else {
      for(Script script : scriptList) {
        System.out.println(script.getPatch() + " - " + script.getFileName());
      }
    }
  }

  protected ScriptList getScriptList() {
    return assembler.buildScriptList(1);
  }

  public String getCommandString() {
    return COMMAND_STRING;
  }


  @Override
  public String[] helpMessage() {
    // TODO Auto-generated method stub
    return null;
  }

}
TOP

Related Classes of net.raymanoz.command.ListCommand

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.