Class AbstractTask
java.lang.Object
jp.ecuacion.tool.housekeepfiles.bl.task.AbstractTask
- Direct Known Subclasses:
AbstractTaskLocal,AbstractTaskRemote
- Author:
- yosuk_000
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jp.ecuacion.lib.core.logging.DetailLoggerprotected booleanその他、taskの動作にかかわる属性を定義。protected TaskAttrCheckPtnEnumprotected TaskAttrCheckPtnEnumprotected TaskPtnEnum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck(HousekeepFilesTaskRecord dtRec) taskに対するHousekeepFilesTaskRecordのinput情報の内容チェック。protected voidcheckNeedRemoteServer(HousekeepFilesTaskRecord taskRec, List<jp.ecuacion.lib.core.exception.checked.SingleAppException> exList) booleanvoiddoTask(ConnectionToRemoteServer conn, HousekeepFilesTaskRecord taskRec, String srcPath, String destPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) task実行。protected abstract voiddoTaskInternal(ConnectionToRemoteServer conn, HousekeepFilesTaskRecord taskRec, String srcPath, String destPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) doTaskから呼び出される。abstract ConnectionToRemoteServergetConnection(String remoteServer, Map<String, HousekeepFilesAuthRecord> authMap) それぞれのremote通信に対するconnection。abstract String"SFTP"などのprotocolを設定。getFromDirFileInfoList(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) protected FileInfogetLocalFileInfo(String path) ローカルディスク上の一覧取得。getLocalFileInfoList(String path) ローカルディスク上の一覧取得。protected abstract FileInfogetRemoteFileInfo(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) getRemoteFileInfoList(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) abstract TaskActionKindEnumtaskの種類を指定。getToPathFileInfo(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) booleantaskが先パス情報を保持しているかをbooleanで返す。booleantaskが元パス情報を保持しているかをbooleanで返す。abstract Booleanabstract Booleanprotected booleanlocalDirExists(String dirPath) abstract voidtaskDependentCheck(HousekeepFilesTaskRecord taskRec, List<jp.ecuacion.lib.core.exception.checked.SingleAppException> exList) checkから呼び出される。protected voidtreatDestPathExists(HousekeepFilesTaskRecord taskRec, String destPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) protected voidtreatIncident(IncidentTreatedAsEnum pattern, jp.ecuacion.lib.core.exception.checked.AppException ex, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) 設定がwarnかerrorかで処理を分ける。
-
Field Details
-
taskPtn
-
inputRuleForSrcPathInfo
-
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
-
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
taskの種類を指定。それによりfrom, toの入力要否などを設定。 -
getConnectionProtocol
"SFTP"などのprotocolを設定。localの場合はnull。 -
getConnection
public abstract ConnectionToRemoteServer getConnection(String remoteServer, Map<String, HousekeepFilesAuthRecord> authMap) throws Exceptionそれぞれのremote通信に対するconnection。- Throws:
Exception
-
isSrcPathLocal
-
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
-
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
-