public class FileOutput extends AbstractOutput
<Output name="File" class="jp.co.sds_corp.transfer.output.FileOutput">dir要素で出力先のディレクトリを指定します。
<dir>data/hist</dir>file要素で出力するファイル名を指定します。 dir要素とfile要素を分ける必要はありません。 file要素にPATHごと指定することが可能です。
<file>data.dat</file>file要素では
SimplePatternLayout
を使用することが可能です。
<file>%d{yyyyMMdd}.dat</file>fastopen要素をtrueに設定すると、データ受信するたびにファイルをオープンするかを指定します。 trueを設定すると毎回ファイルをオープンしないので、処理速度は向上しますが 一部のOSでは、他のプロセスがファイルを監視する場合に、遅延が発生する場合があります。 デフォルトはfalseです。
<fastopen>true</fastopen>
layout要素で、データのフォーマット情報を指定します。
この要素の詳細については、PatternLayout
を参照してください。
<layout class="jp.co.sds_corp.transfer.layout.PatternLayout"> <format>%C\t%c\t%T\t%B\t%A{0.00}\t%d{yyyy/MM/dd HH:mm:ss}\n</format> </layout> </Output>
コンストラクタと説明 |
---|
FileOutput() |
修飾子とタイプ | メソッドと説明 |
---|---|
protected void |
checkDir(String file)
指定されたファイルのPATHを検査します。
|
protected ILayout |
createLayout(jp.co.sds_corp.util.config.IConfiguration config)
レイアウト情報を生成します。
|
String |
getDir()
出力するディレクトリを返します。
|
String |
getFile()
出力するファイル名を返します。
|
ILayout |
getFileLayout()
ファイル名を変換するlayout(fileLayout)を取得します。
|
String |
getFileName(IData data)
出力するファイル名を返します。
|
PrintWriter |
getWriter(String toF)
出力先を取得します。
|
void |
init(jp.co.sds_corp.util.config.IConfiguration config)
指定された初期情報でFileOutputを初期化します。
|
boolean |
isFastOpen()
高速出力フラグを返します。
|
void |
received(ReceiveEvent e)
データに何らかの変更があったときに呼び出されます。
|
void |
setFileLayout(ILayout var)
ファイル名を変換するlayout(fileLayout)を設定します。
|
String |
toString()
この出力先の文字列表現を返します。
|
addFilter, getFilterList, isDebug, isValid, removeFilter, setDebug, start, statusChanged, stop
getName, getStatus, getStatusString, isInterrupted, isValid, saveConfig, setInterrupt, setName, setStatus, setValid
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public void init(jp.co.sds_corp.util.config.IConfiguration config) throws Exception
init
インタフェース内 jp.co.sds_corp.util.config.IConfigurable
init
クラス内 AbstractOutput
config
- 初期情報Exception
protected ILayout createLayout(jp.co.sds_corp.util.config.IConfiguration config) throws Exception
config
- 初期情報Exception
public boolean isFastOpen()
public String getDir()
public String getFile()
public void setFileLayout(ILayout var)
var
- 設定するデータpublic ILayout getFileLayout()
protected void checkDir(String file) throws Exception
Exception
public PrintWriter getWriter(String toF) throws Exception
toF
- 出力するファイル名Exception
public void received(ReceiveEvent e) throws Exception
e
- イベントソースおよびデータの変更内容を指定します。Exception
public String toString()
toString
クラス内 jp.co.sds_corp.util.daemon.AbstractService
Copyright © 2021 S.D.S Co.,Ltd.. All rights reserved.