| Revision | 71 (tree) |
|---|---|
| Time | 2015-08-21 00:17:07 |
| Author | t_nakayama1971 |
(empty log message)
| @@ -15,10 +15,9 @@ | ||
| 15 | 15 | import org.apache.logging.log4j.LogManager; |
| 16 | 16 | |
| 17 | 17 | import common.sql.QueryUtil; |
| 18 | - | |
| 19 | 18 | import core.exception.PhysicalException; |
| 20 | 19 | import core.exception.ThrowableUtil; |
| 21 | -import core.util.bean.Tuple; | |
| 20 | +import core.util.bean.Pair; | |
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * ジョブファイル管理テーブル取得/更新クラス |
| @@ -178,14 +177,14 @@ | ||
| 178 | 177 | */ |
| 179 | 178 | @Override |
| 180 | 179 | public int setFiles(final Connection conn, final long seq, |
| 181 | - final int dtlno, final List<Tuple<String>> list) { | |
| 180 | + final int dtlno, final List<Pair<String, String>> list) { | |
| 182 | 181 | |
| 183 | 182 | int ret = 0; |
| 184 | 183 | if (list != null) { |
| 185 | 184 | int fseq = 1; |
| 186 | - for (final Tuple<String> strs : list) { | |
| 185 | + for (final Pair<String, String> strs : list) { | |
| 187 | 186 | // フルパスファイル名取得 |
| 188 | - String fullpath = strs.get(0); | |
| 187 | + String fullpath = strs.left(); | |
| 189 | 188 | if (fullpath == null) { |
| 190 | 189 | continue; |
| 191 | 190 | } |
| @@ -203,7 +202,7 @@ | ||
| 203 | 202 | info.setFileName(f.getName()); |
| 204 | 203 | info.setPathName(new File(f.getParent()).toURI().getPath()); |
| 205 | 204 | info.setFileSize(f.length()); |
| 206 | - info.setDownloadName(strs.get(1)); | |
| 205 | + info.setDownloadName(strs.right()); | |
| 207 | 206 | cnt = insertJobFile(conn, info); |
| 208 | 207 | } else { |
| 209 | 208 | cnt = updateJobFile(conn, seq, dtlno, fseq, |
| @@ -3,7 +3,7 @@ | ||
| 3 | 3 | import java.sql.Connection; |
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | -import core.util.bean.Tuple; | |
| 6 | +import core.util.bean.Pair; | |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * ジョブファイル管理テーブル取得/更新インタフェース |
| @@ -84,7 +84,7 @@ | ||
| 84 | 84 | * @param list 作成ファイルリスト |
| 85 | 85 | * @return 作成レコード数 |
| 86 | 86 | */ |
| 87 | - int setFiles(Connection conn, long jseq, int dtlno, List<Tuple<String>> list); | |
| 87 | + int setFiles(Connection conn, long jseq, int dtlno, List<Pair<String, String>> list); | |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * ファイル削除 |
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | import java.util.Objects; |
| 6 | 6 | import java.util.concurrent.CopyOnWriteArrayList; |
| 7 | 7 | |
| 8 | -import core.util.bean.Tuple; | |
| 8 | +import core.util.bean.Pair; | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * バッチ作成のための親抽象クラス |
| @@ -18,7 +18,8 @@ | ||
| 18 | 18 | /** メッセージテキスト */ |
| 19 | 19 | private String message = null; |
| 20 | 20 | /** 作成ファイルリスト */ |
| 21 | - private final CopyOnWriteArrayList<Tuple<String>> fileList = new CopyOnWriteArrayList<>(); | |
| 21 | + private final CopyOnWriteArrayList<Pair<String, String>> fileList = | |
| 22 | + new CopyOnWriteArrayList<>(); | |
| 22 | 23 | |
| 23 | 24 | /** |
| 24 | 25 | * メッセージ取得 |
| @@ -45,7 +46,7 @@ | ||
| 45 | 46 | * @return ファイルリスト |
| 46 | 47 | */ |
| 47 | 48 | @Override |
| 48 | - public final List<Tuple<String>> getOutputFiles() { | |
| 49 | + public final List<Pair<String, String>> getOutputFiles() { | |
| 49 | 50 | return Collections.unmodifiableList(this.fileList); |
| 50 | 51 | } |
| 51 | 52 |
| @@ -57,9 +58,9 @@ | ||
| 57 | 58 | */ |
| 58 | 59 | protected final void addFile(final String file, final String download) { |
| 59 | 60 | if (Objects.toString(download, "").trim().isEmpty()) { |
| 60 | - this.fileList.add(new Tuple<>(file, null)); | |
| 61 | + this.fileList.add(new Pair<>(file, null)); | |
| 61 | 62 | } else { |
| 62 | - this.fileList.add(new Tuple<>(file, download)); | |
| 63 | + this.fileList.add(new Pair<>(file, download)); | |
| 63 | 64 | } |
| 64 | 65 | } |
| 65 | 66 | } |
| @@ -2,7 +2,7 @@ | ||
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | |
| 5 | -import core.util.bean.Tuple; | |
| 5 | +import core.util.bean.Pair; | |
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * バッチ作成のためのインタフェース |
| @@ -65,5 +65,5 @@ | ||
| 65 | 65 | * |
| 66 | 66 | * @return ファイルリスト |
| 67 | 67 | */ |
| 68 | - List<Tuple<String>> getOutputFiles(); | |
| 68 | + List<Pair<String, String>> getOutputFiles(); | |
| 69 | 69 | } |
| @@ -4,6 +4,8 @@ | ||
| 4 | 4 | import java.sql.SQLException; |
| 5 | 5 | import java.sql.Timestamp; |
| 6 | 6 | |
| 7 | +import org.apache.logging.log4j.LogManager; | |
| 8 | + | |
| 7 | 9 | import batch.controller.JobUtil; |
| 8 | 10 | import batch.status.JobDetailStatus; |
| 9 | 11 | import batch.status.JobFileStatus; |
| @@ -109,6 +111,7 @@ | ||
| 109 | 111 | return postprocess(exitCode); |
| 110 | 112 | |
| 111 | 113 | } catch (final PhysicalException ex) { |
| 114 | + LogManager.getLogger().info(ex.getMessage()); | |
| 112 | 115 | return Batch.RET_FAILED; |
| 113 | 116 | } catch (final Throwable th) { |
| 114 | 117 | ThrowableUtil.error(th); |
| @@ -162,6 +165,7 @@ | ||
| 162 | 165 | } |
| 163 | 166 | } catch (final InterruptedException ex) { |
| 164 | 167 | Thread.interrupted(); |
| 168 | + LogManager.getLogger().info(ex.getMessage()); | |
| 165 | 169 | exitCode = Batch.RET_FAILED; |
| 166 | 170 | } |
| 167 | 171 |
| @@ -112,6 +112,7 @@ | ||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | } catch (final IllegalArgumentException ex) { |
| 115 | + LogManager.getLogger().info(ex.getMessage()); | |
| 115 | 116 | printUsage(BatchStatus.class.getName()); |
| 116 | 117 | Runtime.getRuntime().exit(Batch.RET_PARAM_ERROR); |
| 117 | 118 | } catch (final Throwable th) { |