Class AbstractTask

java.lang.Object
jp.ecuacion.tool.housekeepfiles.bl.task.AbstractTask
Direct Known Subclasses:
AbstractTaskLocal, AbstractTaskRemote

public abstract class AbstractTask extends Object
Author:
yosuk_000
  • Field Details

    • taskPtn

      protected TaskPtnEnum taskPtn
    • inputRuleForSrcPathInfo

      protected TaskAttrCheckPtnEnum inputRuleForSrcPathInfo
    • inputRuleForDestPathInfo

      protected TaskAttrCheckPtnEnum inputRuleForDestPathInfo
    • doesCreateOutputFileAutomatically

      protected boolean doesCreateOutputFileAutomatically
      その他、taskの動作にかかわる属性を定義。 以下は、zip・unzipを想定し「xml上はTOを指定しないが、結果的にTOファイルができるもの」を表す。デフォルトではfalseとし、対象のタスクのみこの値を書き換えるものとする
    • dlog

      protected jp.ecuacion.lib.core.logging.DetailLogger dlog
  • Constructor Details

    • AbstractTask

      public AbstractTask()
  • Method Details

    • getInputRuleForSrcPath

      public TaskAttrCheckPtnEnum getInputRuleForSrcPath()
    • getInputRuleForDestPath

      public TaskAttrCheckPtnEnum getInputRuleForDestPath()
    • doesCreateOutputFileAutomatically

      public boolean doesCreateOutputFileAutomatically()
    • check

      public void check(HousekeepFilesTaskRecord dtRec) throws jp.ecuacion.lib.core.exception.checked.AppException
      taskに対するHousekeepFilesTaskRecordのinput情報の内容チェック。task実行の前にcheckをする関係でdoTaskとは分けている。
      Throws:
      jp.ecuacion.lib.core.exception.checked.AppException
    • taskDependentCheck

      public abstract void taskDependentCheck(HousekeepFilesTaskRecord taskRec, List<jp.ecuacion.lib.core.exception.checked.SingleAppException> exList)
      checkから呼び出される。各taskにてチェック実装。
    • checkNeedRemoteServer

      protected void checkNeedRemoteServer(HousekeepFilesTaskRecord taskRec, List<jp.ecuacion.lib.core.exception.checked.SingleAppException> exList)
    • getTaskActionKind

      public abstract TaskActionKindEnum getTaskActionKind()
      taskの種類を指定。それによりfrom, toの入力要否などを設定。
    • getConnectionProtocol

      public abstract String getConnectionProtocol()
      "SFTP"などのprotocolを設定。localの場合はnull。
    • getConnection

      public abstract ConnectionToRemoteServer getConnection(String remoteServer, Map<String,HousekeepFilesAuthRecord> authMap) throws Exception
      それぞれのremote通信に対するconnection。
      Throws:
      Exception
    • isSrcPathLocal

      public abstract Boolean isSrcPathLocal()
    • isDestPathLocal

      public abstract Boolean isDestPathLocal()
    • getRemoteFileInfo

      protected abstract FileInfo getRemoteFileInfo(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path)
    • getRemoteFileInfoList

      protected abstract List<FileInfo> getRemoteFileInfoList(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path)
    • doTask

      public void doTask(ConnectionToRemoteServer conn, HousekeepFilesTaskRecord taskRec, String srcPath, String destPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) throws Exception
      task実行。外部からtaskを実行する際はこれを呼ぶ。
      Throws:
      Exception
    • doTaskInternal

      protected abstract void doTaskInternal(ConnectionToRemoteServer conn, HousekeepFilesTaskRecord taskRec, String srcPath, String destPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) throws Exception
      doTaskから呼び出される。各taskにて処理実装。
      Throws:
      Exception
    • hasSrcPathInfo

      public boolean hasSrcPathInfo()
      taskが元パス情報を保持しているかをbooleanで返す。
    • hasDestPathInfo

      public boolean hasDestPathInfo()
      taskが先パス情報を保持しているかをbooleanで返す。
    • getToPathFileInfo

      public FileInfo getToPathFileInfo(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) throws Exception
      Throws:
      Exception
    • getFromDirFileInfoList

      public List<FileInfo> getFromDirFileInfoList(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) throws jp.ecuacion.lib.core.exception.checked.AppException
      Throws:
      jp.ecuacion.lib.core.exception.checked.AppException
    • localDirExists

      protected boolean localDirExists(String dirPath)
    • getLocalFileInfo

      protected FileInfo getLocalFileInfo(String path) throws jp.ecuacion.lib.core.exception.checked.BizLogicAppException
      ローカルディスク上の一覧取得。
      Throws:
      jp.ecuacion.lib.core.exception.checked.BizLogicAppException
    • getLocalFileInfoList

      protected List<FileInfo> getLocalFileInfoList(String path) throws jp.ecuacion.lib.core.exception.checked.BizLogicAppException
      ローカルディスク上の一覧取得。
      Throws:
      jp.ecuacion.lib.core.exception.checked.BizLogicAppException
    • treatIncident

      protected void treatIncident(IncidentTreatedAsEnum pattern, jp.ecuacion.lib.core.exception.checked.AppException ex, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) throws jp.ecuacion.lib.core.exception.checked.AppException
      設定がwarnかerrorかで処理を分ける。
      Throws:
      jp.ecuacion.lib.core.exception.checked.AppException
    • treatDestPathExists

      protected void treatDestPathExists(HousekeepFilesTaskRecord taskRec, String destPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) throws jp.ecuacion.lib.core.exception.checked.AppException
      Throws:
      jp.ecuacion.lib.core.exception.checked.AppException