com.tobesoft.xplatform.tx
Class PlatformFileClient

java.lang.Object
  extended bycom.tobesoft.xplatform.tx.PlatformFileClient

public class PlatformFileClient
extends java.lang.Object

파일으로 데이터(PlatformData)를 저장하고, 파일로부터 데이터(PlatformData)를 적재한다.

다음은 PlatformFileClient을 이용하는 예제이다.

 String sourcePath = "/home/user/req.xml";
 PlatformFileClient source = new PlatformFileClient(sourcePath);
 source.setSourceContentType(PlatformType.CONTENT_TYPE_XML);

 PlatformData data = source.receiveData();
 source.close();

 String targetPath = "/home/user/res.bin";
 PlatformFileClient target = new PlatformFileClient(targetPath);
 target.setTargetContentType(PlatformType.CONTENT_TYPE_BINARY);

 target.sendData(data);
 target.close();
 
또는
 String sourcePath = "/home/user/req.xml";
 String targetPath = "/home/user/res.bin";

 PlatformFileClient client = new PlatformFileClient(sourcePath, targetPath);
 client.setSourceContentType(PlatformType.CONTENT_TYPE_XML);
 client.setTargetContentType(PlatformType.CONTENT_TYPE_BINARY);

 PlatformData data = client.receiveData();
 client.sendData(data);

 client.close();
 

Author:
Choi, Jongkwan

Constructor Summary
PlatformFileClient(java.io.File file)
          입출력 File을 가지는 생성자이다.
PlatformFileClient(java.io.File source, java.io.File target)
          입력(source) File과 출력(target) File을 가지는 생성자이다.
PlatformFileClient(java.io.File source, java.io.File target, java.lang.String contentType)
          입력(source) File, 출력(target) File과 송수신 형식(contentType)을 가지는 생성자이다.
PlatformFileClient(java.io.File source, java.io.File target, java.lang.String contentType, java.lang.String charset)
          입력(source) File, 출력(target) File, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.
PlatformFileClient(java.io.File file, java.lang.String contentType)
          입력(source) File과 송수신 형식(contentType)을 가지는 생성자이다.
PlatformFileClient(java.io.File file, java.lang.String contentType, java.lang.String charset)
          입출력 File, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.
PlatformFileClient(java.lang.String path)
          입출력 파일의 경로를 가지는 생성자이다.
PlatformFileClient(java.lang.String source, java.lang.String target)
          입력(source) 파일의 경로와 출력(target) 파일의 경로를 가지는 생성자이다.
 
Method Summary
 void addProtocolType(java.lang.String protocolType)
          프로토콜 형식(protocolType)을 추가한다.
 void addSourceProtocolType(java.lang.String protocolType)
          입력(source) 프로토콜 형식(protocolType)을 추가한다.
 void addTargetProtocolType(java.lang.String protocolType)
          출력(target) 프로토콜 형식(protocolType)을 추가한다.
 void clearProtocolTypes()
          모든 프로토콜 형식(protocolType)을 삭제한다.
 void clearSourceProtocolTypes()
          모든 입력(source) 프로토콜 형식(protocolType)을 삭제한다.
 void clearTargetProtocolTypes()
          모든 출력(target) 프로토콜 형식(protocolType)을 삭제한다.
 void close()
          File 연결을 종료한다.
 boolean containsSourceProtocolType(java.lang.String protocolType)
          입력(source) 프로토콜 형식(protocolType)의 포함 여부를 검사한다.
 boolean containsTargetProtocolType(java.lang.String protocolType)
          출력(target) 프로토콜 형식(protocolType)의 포함 여부를 검사한다.
 java.io.File getSource()
          입력(source) File을 반환한다.
 java.lang.String getSourceCharset()
          입력(source) 문자셋(charset)을 반환한다.
 java.lang.String getSourceContentType()
          입력(source) 송수신 형식(contentType)을 반환한다.
 java.lang.String getSourceProtocolType(int index)
          입력(source) 프로토콜 형식(protocolType)을 반환한다.
 int getSourceProtocolTypeCount()
          입력(source) 프로토콜 형식(protocolType)의 갯수를 반환한다.
 java.io.File getTarget()
          출력(target) File을 반환한다.
 java.lang.String getTargetCharset()
          출력(target) 문자셋(charset)을 반환한다.
 java.lang.String getTargetContentType()
          출력(target) 송수신 형식(contentType)을 반환한다.
 java.lang.String getTargetProtocolType(int index)
          출력(target) 프로토콜 형식(protocolType)을 반환한다.
 int getTargetProtocolTypeCount()
          출력(target) 프로토콜 형식(protocolType)의 갯수를 반환한다.
 boolean isVerbose()
          INFO 로그의 출력 여부를 검사한다.
 PlatformData receiveData()
          데이터(PlatformData)를 적재한다.
 void removeProtocolType(java.lang.String protocolType)
          프로토콜 형식(protocolType)을 삭제한다.
 void removeSourceProtocolType(int index)
          입력(source) 프로토콜 형식(protocolType)을 삭제한다.
 void removeSourceProtocolType(java.lang.String protocolType)
          입력(source) 프로토콜 형식(protocolType)을 삭제한다.
 void removeTargetProtocolType(int index)
          출력(target) 프로토콜 형식(protocolType)을 삭제한다.
 void removeTargetProtocolType(java.lang.String protocolType)
          출력(target) 프로토콜 형식(protocolType)을 삭제한다.
 void sendData(PlatformData data)
          데이터(PlatformData)를 저장한다.
 void setCharset(java.lang.String charset)
          입력(source)과 출력(target)의 문자셋(charset)을 반환한다.
 void setContentType(java.lang.String contentType)
          입력(source)과 출력(target)의 송수신 형식(contentType)을 반환한다.
 void setSource(java.io.File source)
          입력(source) File을 설정한다.
 void setSourceCharset(java.lang.String charset)
          입력(source) 문자셋(charset)을 설정한다.
 void setSourceContentType(java.lang.String contentType)
          입력(source) 송수신 형식(contentType)을 설정한다.
 void setTarget(java.io.File target)
          출력(target) File을 설정한다.
 void setTargetCharset(java.lang.String charset)
          출력(target) 문자셋(charset)을 설정한다.
 void setTargetContentType(java.lang.String contentType)
          출력(target) 송수신 형식(contentType)을 설정한다.
 void setVerbose(boolean verbose)
          INFO 로그의 출력 여부를 설정한다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformFileClient

public PlatformFileClient(java.lang.String path)
입출력 파일의 경로를 가지는 생성자이다.

Parameters:
path - 입출력 파일의 경로

PlatformFileClient

public PlatformFileClient(java.lang.String source,
                          java.lang.String target)
입력(source) 파일의 경로와 출력(target) 파일의 경로를 가지는 생성자이다.

Parameters:
source - 입력(source) 파일의 경로
target - 출력(target) 파일의 경로

PlatformFileClient

public PlatformFileClient(java.io.File file)
입출력 File을 가지는 생성자이다.

Parameters:
file - 입출력 File

PlatformFileClient

public PlatformFileClient(java.io.File file,
                          java.lang.String contentType)
입력(source) File과 송수신 형식(contentType)을 가지는 생성자이다.


PlatformFileClient

public PlatformFileClient(java.io.File file,
                          java.lang.String contentType,
                          java.lang.String charset)
입출력 File, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.


PlatformFileClient

public PlatformFileClient(java.io.File source,
                          java.io.File target)
입력(source) File과 출력(target) File을 가지는 생성자이다.


PlatformFileClient

public PlatformFileClient(java.io.File source,
                          java.io.File target,
                          java.lang.String contentType)
입력(source) File, 출력(target) File과 송수신 형식(contentType)을 가지는 생성자이다.


PlatformFileClient

public PlatformFileClient(java.io.File source,
                          java.io.File target,
                          java.lang.String contentType,
                          java.lang.String charset)
입력(source) File, 출력(target) File, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.

Method Detail

getSource

public java.io.File getSource()
입력(source) File을 반환한다.


setSource

public void setSource(java.io.File source)
입력(source) File을 설정한다.


getTarget

public java.io.File getTarget()
출력(target) File을 반환한다.


setTarget

public void setTarget(java.io.File target)
출력(target) File을 설정한다.


setContentType

public void setContentType(java.lang.String contentType)
입력(source)과 출력(target)의 송수신 형식(contentType)을 반환한다.


getSourceContentType

public java.lang.String getSourceContentType()
입력(source) 송수신 형식(contentType)을 반환한다.


setSourceContentType

public void setSourceContentType(java.lang.String contentType)
입력(source) 송수신 형식(contentType)을 설정한다.


getTargetContentType

public java.lang.String getTargetContentType()
출력(target) 송수신 형식(contentType)을 반환한다.


setTargetContentType

public void setTargetContentType(java.lang.String contentType)
출력(target) 송수신 형식(contentType)을 설정한다.


setCharset

public void setCharset(java.lang.String charset)
입력(source)과 출력(target)의 문자셋(charset)을 반환한다.


getSourceCharset

public java.lang.String getSourceCharset()
입력(source) 문자셋(charset)을 반환한다.


setSourceCharset

public void setSourceCharset(java.lang.String charset)
입력(source) 문자셋(charset)을 설정한다.


getTargetCharset

public java.lang.String getTargetCharset()
출력(target) 문자셋(charset)을 반환한다.


setTargetCharset

public void setTargetCharset(java.lang.String charset)
출력(target) 문자셋(charset)을 설정한다.


addProtocolType

public void addProtocolType(java.lang.String protocolType)
프로토콜 형식(protocolType)을 추가한다. 프로토콜 형식은 압축, 암호화 등 데이터의 변형 형식을 의미한다.

Parameters:
protocolType - 프로토콜 형식
Throws:
java.lang.IllegalArgumentException - 프로토콜 형식(protocolType) 중복 추가시
See Also:
PlatformType.PROTOCOL_TYPE_ZLIB

removeProtocolType

public void removeProtocolType(java.lang.String protocolType)
프로토콜 형식(protocolType)을 삭제한다.

Parameters:
protocolType - 프로토콜 형식

clearProtocolTypes

public void clearProtocolTypes()
모든 프로토콜 형식(protocolType)을 삭제한다.


getSourceProtocolType

public java.lang.String getSourceProtocolType(int index)
입력(source) 프로토콜 형식(protocolType)을 반환한다. 프로토콜 형식은 압축, 암호화 등 데이터의 변형 형식을 의미한다.

Parameters:
index - 위치
See Also:
PlatformType.PROTOCOL_TYPE_ZLIB

addSourceProtocolType

public void addSourceProtocolType(java.lang.String protocolType)
입력(source) 프로토콜 형식(protocolType)을 추가한다. 프로토콜 형식은 압축, 암호화 등 데이터의 변형 형식을 의미한다.

Parameters:
protocolType - 프로토콜 형식
Throws:
java.lang.IllegalArgumentException - 프로토콜 형식(protocolType) 중복 추가시
See Also:
PlatformType.PROTOCOL_TYPE_ZLIB

removeSourceProtocolType

public void removeSourceProtocolType(int index)
입력(source) 프로토콜 형식(protocolType)을 삭제한다.

Parameters:
index - 위치

removeSourceProtocolType

public void removeSourceProtocolType(java.lang.String protocolType)
입력(source) 프로토콜 형식(protocolType)을 삭제한다.

Parameters:
protocolType - 프로토콜 형식

containsSourceProtocolType

public boolean containsSourceProtocolType(java.lang.String protocolType)
입력(source) 프로토콜 형식(protocolType)의 포함 여부를 검사한다.

Parameters:
protocolType - 프로토콜 형식
Returns:
프로토콜 형식의 포함 여부

clearSourceProtocolTypes

public void clearSourceProtocolTypes()
모든 입력(source) 프로토콜 형식(protocolType)을 삭제한다.


getSourceProtocolTypeCount

public int getSourceProtocolTypeCount()
입력(source) 프로토콜 형식(protocolType)의 갯수를 반환한다.

Returns:
입력(source) 프로토콜 형식의 갯수

getTargetProtocolType

public java.lang.String getTargetProtocolType(int index)
출력(target) 프로토콜 형식(protocolType)을 반환한다. 프로토콜 형식은 압축, 암호화 등 데이터의 변형 형식을 의미한다.

Parameters:
index - 위치
See Also:
PlatformType.PROTOCOL_TYPE_ZLIB

addTargetProtocolType

public void addTargetProtocolType(java.lang.String protocolType)
출력(target) 프로토콜 형식(protocolType)을 추가한다. 프로토콜 형식은 압축, 암호화 등 데이터의 변형 형식을 의미한다.

Parameters:
protocolType - 프로토콜 형식
Throws:
java.lang.IllegalArgumentException - 프로토콜 형식(protocolType) 중복 추가시
See Also:
PlatformType.PROTOCOL_TYPE_ZLIB

removeTargetProtocolType

public void removeTargetProtocolType(int index)
출력(target) 프로토콜 형식(protocolType)을 삭제한다.

Parameters:
index - 위치

removeTargetProtocolType

public void removeTargetProtocolType(java.lang.String protocolType)
출력(target) 프로토콜 형식(protocolType)을 삭제한다.

Parameters:
protocolType - 프로토콜 형식

containsTargetProtocolType

public boolean containsTargetProtocolType(java.lang.String protocolType)
출력(target) 프로토콜 형식(protocolType)의 포함 여부를 검사한다.

Parameters:
protocolType - 프로토콜 형식
Returns:
프로토콜 형식의 포함 여부

clearTargetProtocolTypes

public void clearTargetProtocolTypes()
모든 출력(target) 프로토콜 형식(protocolType)을 삭제한다.


getTargetProtocolTypeCount

public int getTargetProtocolTypeCount()
출력(target) 프로토콜 형식(protocolType)의 갯수를 반환한다.

Returns:
출력(target) 프로토콜 형식의 갯수

isVerbose

public boolean isVerbose()
INFO 로그의 출력 여부를 검사한다. 기본값은 "false" 이며, 로깅 컴퍼넌트의 INFO 로그가 출력되도록 설정되어 있고, verbose가 "true" 인 경우에만 로그가 출력된다.

Returns:
INFO 로그의 출력 여부
See Also:
setVerbose(boolean)

setVerbose

public void setVerbose(boolean verbose)
INFO 로그의 출력 여부를 설정한다.

Parameters:
verbose - INFO 로그의 출력 여부
See Also:
isVerbose()

sendData

public void sendData(PlatformData data)
              throws PlatformException
데이터(PlatformData)를 저장한다. 송수신 형식(contentType)이 설정되지 않은 경우 PlatformType.DEFAULT_CONTENT_TYPE이 적용된다.

Throws:
PlatformException

receiveData

public PlatformData receiveData()
                         throws PlatformException
데이터(PlatformData)를 적재한다. 송수신 형식(contentType)이 설정되지 않은 경우 PlatformType.DEFAULT_CONTENT_TYPE이 적용된다.

Throws:
PlatformException

close

public void close()
File 연결을 종료한다.



Copyright © 2000-2011 TOBESOFT Co., Ltd.