com.tobesoft.xplatform.tx
Class JavaTypePlatformResponse

java.lang.Object
  extended bycom.tobesoft.xplatform.tx.PlatformTransaction
      extended bycom.tobesoft.xplatform.tx.JavaTypePlatformResponse
Direct Known Subclasses:
HttpJavaTypePlatformResponse

public class JavaTypePlatformResponse
extends com.tobesoft.xplatform.tx.PlatformTransaction

OutputStream 또는 Writer으로 데이터(VariableDataSet)를 송신한다.

데이터 송신은 다음의 순서로 진행되어야 한다.

  1. 객체 초기화 - JavaTypePlatformResponse 생성
  2. 송신 시작 - JavaTypePlatformResponse.start() 호출 (생략 가능)
  3. Variable 송신 - JavaTypePlatformResponse.sendVariable(String, int, Object) 호출
  4. Variable 송신 반복
  5. DataSet 송신 - JavaTypePlatformResponse.sendDataSet(String) 호출
  6. DataSetColumnHeader 송신 - JavaTypePlatformResponse.sendDataSetHeader(String, int, int) 호출
  7. DataSetColumnHeader 송신 반복
  8. DataSetConstantColumnHeader 송신 - JavaTypePlatformResponse.sendDataSetConstantHeader(String, int, int, Object) 호출 (생략 가능)
  9. DataSetConstantColumnHeader 송신 반복
  10. DataSet의 행(row) 데이터 송신 - JavaTypePlatformResponse.sendDataSetRow(Object[]) 호출
  11. DataSet의 행(row) 데이터 송신 반복
  12. DataSet 송신 반복
  13. 송신 종료 - JavaTypePlatformResponse.end() 호출 (반드시 호출 필요)

Variable 송신과 DataSet 송신은 각각 생략이 가능하며, DataSet 송신 후에 Variable 송신하는 경우에는 예외가 발생한다. 또한, DataSet 행(row) 데이터의 갯수와 순서 등 데이터의 정합성은 사용자가 보장해야 한다.

Author:
Choi, Jongkwan
See Also:
PlatformResponse, PartPlatformResponse

Constructor Summary
JavaTypePlatformResponse()
          기본 생성자이다.
JavaTypePlatformResponse(java.io.OutputStream out)
          OutputStream을 가지는 생성자이다.
JavaTypePlatformResponse(java.io.OutputStream out, PlatformRequest req)
          OutputStreamPlatformRequest를 가지는 생성자이다.
JavaTypePlatformResponse(java.io.OutputStream out, java.lang.String contentType)
          OutputStream과 송수신 형식(contentType)을 가지는 생성자이다.
JavaTypePlatformResponse(java.io.OutputStream out, java.lang.String contentType, java.lang.String charset)
          OutputStream, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.
JavaTypePlatformResponse(PlatformRequest req)
          PlatformRequest를 가지는 생성자이다.
JavaTypePlatformResponse(java.lang.String contentType)
          송수신 형식(contentType)을 가지는 생성자이다.
JavaTypePlatformResponse(java.lang.String contentType, java.lang.String charset)
          송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.
JavaTypePlatformResponse(java.io.Writer writer)
          Writer를 가지는 생성자이다.
JavaTypePlatformResponse(java.io.Writer writer, PlatformRequest req)
          WriterPlatformRequest를 가지는 생성자이다.
JavaTypePlatformResponse(java.io.Writer writer, java.lang.String contentType)
          Writer와 송수신 형식(contentType)을 가지는 생성자이다.
JavaTypePlatformResponse(java.io.Writer writer, java.lang.String contentType, java.lang.String charset)
          Writer, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.
 
Method Summary
 void addProtocolType(java.lang.String protocolType)
          프로토콜 형식(protocolType)을 추가한다.
 void clearProtocolTypes()
          모든 프로토콜 형식(protocolType)을 삭제한다.
 boolean containsProtocolType(java.lang.String protocolType)
          프로토콜 형식(protocolType)의 포함 여부를 검사한다.
 void end()
          데이터 송신을 종료한다.
 java.lang.String getCharset()
          문자셋(charset)을 반환한다.
 java.lang.String getContentType()
          송수신 형식(contentType)을 반환한다.
protected  java.lang.String getCurrentCharset()
          현재 문자셋(charset)을 반환한다.
protected  java.lang.String getCurrentContentType()
          현재 송수신 형식(contentType)을 반환한다.
 PlatformData getData()
          데이터를 반환한다.
 JavaTypeDataConverter getDataConverter()
          JavaTypeDataConverter를 반환한다.
 DataTypeChanger getDataTypeChanger()
          DataTypeChanger를 반환한다.
protected  java.lang.String getDefaultCharset()
          기본 문자셋(charset)을 반환한다.
protected  java.lang.String getDefaultContentType()
          기본 송수신 형식(contentType)을 반환한다.
 java.lang.Object getProperty(java.lang.String key)
          속성값을 반환한다.
 java.lang.String getProtocolType(int index)
          프로토콜 형식(protocolType)을 반환한다.
 int getProtocolTypeCount()
          프로토콜 형식(protocolType)의 갯수를 반환한다.
protected  boolean isCurrentVerbose()
          현재 INFO 로그의 출력 여부를 검사한다.
 boolean isVerbose()
          INFO 로그의 출력 여부를 검사한다.
 void removeProtocolType(int index)
          프로토콜 형식(protocolType)을 삭제한다.
 void removeProtocolType(java.lang.String protocolType)
          프로토콜 형식(protocolType)을 삭제한다.
 void sendDataSet(java.lang.String name)
          DataSet을 송신한다.
 void sendDataSetConstantHeader(java.lang.String name, int dataType, int dataSize, java.lang.Object value)
          DataSetConstantsColumnHeader를 송신한다.
 void sendDataSetHeader(java.lang.String name, int dataType, int dataSize)
          DataSetColumnHeader를 송신한다.
 void sendDataSetRow(java.lang.Object value)
          DataSet의 행(row) 데이터를 송신한다.
 void sendDataSetRow(java.lang.Object[] values)
          DataSet의 행(row) 데이터를 송신한다.
 void sendDataSetRow(java.lang.Object value1, java.lang.Object value2)
          DataSet의 행(row) 데이터를 송신한다.
 void sendDataSetRow(java.lang.Object value1, java.lang.Object value2, java.lang.Object value3)
          DataSet의 행(row) 데이터를 송신한다.
 void sendDataSetRow(java.lang.Object value1, java.lang.Object value2, java.lang.Object value3, java.lang.Object value4)
          DataSet의 행(row) 데이터를 송신한다.
 void sendDataSetRow(java.lang.Object value1, java.lang.Object value2, java.lang.Object value3, java.lang.Object value4, java.lang.Object value5)
          DataSet의 행(row) 데이터를 송신한다.
 void sendVariable(java.lang.String name, int dataType, java.lang.Object value)
          Variable을 송신한다.
 void setCharset(java.lang.String charset)
          문자셋(charset)을 설정한다.
 void setContentType(java.lang.String contentType)
          송수신 형식(contentType)을 설정한다.
 void setData(PlatformData data)
          데이터를 설정한다.
 void setDataConverter(JavaTypeDataConverter dataConverter)
          JavaTypeDataConverter를 설정한다.
 void setDataTypeChanger(DataTypeChanger dataTypeChanger)
          DataTypeChanger를 설정한다.
 void setProperty(java.lang.String key, java.lang.Object value)
          속성값을 설정한다.
 void setVerbose(boolean verbose)
          INFO 로그의 출력 여부를 설정한다.
 void start()
          데이터 송신을 시작한다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTypePlatformResponse

public JavaTypePlatformResponse()
기본 생성자이다.


JavaTypePlatformResponse

public JavaTypePlatformResponse(java.lang.String contentType)
송수신 형식(contentType)을 가지는 생성자이다.

Parameters:
contentType - 송수신 형식
See Also:
PlatformType.CONTENT_TYPE_XML, PlatformType.CONTENT_TYPE_BINARY

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.lang.String contentType,
                                java.lang.String charset)
송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.

Parameters:
contentType - 송수신 형식
charset - 문자셋
See Also:
PlatformType.CONTENT_TYPE_XML, PlatformType.CONTENT_TYPE_BINARY

JavaTypePlatformResponse

public JavaTypePlatformResponse(PlatformRequest req)
PlatformRequest를 가지는 생성자이다. PlatformRequest의 송수신 형식(contentType)과 문자셋(charset)이 적용된다.

Parameters:
req - PlatformRequest

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.OutputStream out)
OutputStream을 가지는 생성자이다.

Parameters:
out - OutputStream

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.OutputStream out,
                                java.lang.String contentType)
OutputStream과 송수신 형식(contentType)을 가지는 생성자이다.

Parameters:
out - OutputStream
contentType - 송수신 형식
See Also:
PlatformType.CONTENT_TYPE_XML, PlatformType.CONTENT_TYPE_BINARY

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.OutputStream out,
                                java.lang.String contentType,
                                java.lang.String charset)
OutputStream, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.

Parameters:
out - OutputStream
contentType - 송수신 형식
charset - 문자셋
See Also:
PlatformType.CONTENT_TYPE_XML, PlatformType.CONTENT_TYPE_BINARY

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.OutputStream out,
                                PlatformRequest req)
OutputStreamPlatformRequest를 가지는 생성자이다. PlatformRequest의 송수신 형식(contentType)과 문자셋(charset)이 적용된다.

Parameters:
out - OutputStream
req - PlatformRequest

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.Writer writer)
Writer를 가지는 생성자이다.

Parameters:
writer - Writer

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.Writer writer,
                                java.lang.String contentType)
Writer와 송수신 형식(contentType)을 가지는 생성자이다.

Parameters:
writer - Writer
contentType - 송수신 형식
See Also:
PlatformType.CONTENT_TYPE_XML

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.Writer writer,
                                java.lang.String contentType,
                                java.lang.String charset)
Writer, 송수신 형식(contentType)과 문자셋(charset)을 가지는 생성자이다.

Parameters:
writer - Writer
contentType - 송수신 형식
charset - 문자셋
See Also:
PlatformType.CONTENT_TYPE_XML

JavaTypePlatformResponse

public JavaTypePlatformResponse(java.io.Writer writer,
                                PlatformRequest req)
WriterPlatformRequest를 가지는 생성자이다. PlatformRequest의 송수신 형식(contentType)과 문자셋(charset)이 적용된다.

Parameters:
writer - Writer
req - PlatformRequest
Method Detail

getDataConverter

public JavaTypeDataConverter getDataConverter()
JavaTypeDataConverter를 반환한다.

Returns:
JavaTypeDataConverter

setDataConverter

public void setDataConverter(JavaTypeDataConverter dataConverter)
JavaTypeDataConverter를 설정한다.

Parameters:
dataConverter - JavaTypeDataConverter

start

public void start()
           throws PlatformException
데이터 송신을 시작한다.

Throws:
PlatformException

end

public void end()
         throws PlatformException
데이터 송신을 종료한다.

Throws:
PlatformException

sendVariable

public void sendVariable(java.lang.String name,
                         int dataType,
                         java.lang.Object value)
                  throws PlatformException
Variable을 송신한다.

Parameters:
name - 식별자
dataType - 데이터 형식
value - 값
Throws:
PlatformException

sendDataSet

public void sendDataSet(java.lang.String name)
                 throws PlatformException
DataSet을 송신한다.

Parameters:
name - 식별자
Throws:
PlatformException

sendDataSetHeader

public void sendDataSetHeader(java.lang.String name,
                              int dataType,
                              int dataSize)
                       throws PlatformException
DataSetColumnHeader를 송신한다.

Parameters:
name - 식별자
dataType - 데이터 형식
dataSize - 데이터 크기
Throws:
PlatformException

sendDataSetConstantHeader

public void sendDataSetConstantHeader(java.lang.String name,
                                      int dataType,
                                      int dataSize,
                                      java.lang.Object value)
                               throws PlatformException
DataSetConstantsColumnHeader를 송신한다.

Parameters:
name - 식별자
dataType - 데이터 형식
dataSize - 데이터 크기
value - 값
Throws:
PlatformException

sendDataSetRow

public void sendDataSetRow(java.lang.Object value)
                    throws PlatformException
DataSet의 행(row) 데이터를 송신한다.

Parameters:
value - 값
Throws:
PlatformException

sendDataSetRow

public void sendDataSetRow(java.lang.Object value1,
                           java.lang.Object value2)
                    throws PlatformException
DataSet의 행(row) 데이터를 송신한다.

Parameters:
value1 - 값1
value2 - 값2
Throws:
PlatformException

sendDataSetRow

public void sendDataSetRow(java.lang.Object value1,
                           java.lang.Object value2,
                           java.lang.Object value3)
                    throws PlatformException
DataSet의 행(row) 데이터를 송신한다.

Parameters:
value1 - 값1
value2 - 값2
value3 - 값3
Throws:
PlatformException

sendDataSetRow

public void sendDataSetRow(java.lang.Object value1,
                           java.lang.Object value2,
                           java.lang.Object value3,
                           java.lang.Object value4)
                    throws PlatformException
DataSet의 행(row) 데이터를 송신한다.

Parameters:
value1 - 값1
value2 - 값2
value3 - 값3
value4 - 값4
Throws:
PlatformException

sendDataSetRow

public void sendDataSetRow(java.lang.Object value1,
                           java.lang.Object value2,
                           java.lang.Object value3,
                           java.lang.Object value4,
                           java.lang.Object value5)
                    throws PlatformException
DataSet의 행(row) 데이터를 송신한다.

Parameters:
value1 - 값1
value2 - 값2
value3 - 값3
value4 - 값4
value5 - 값5
Throws:
PlatformException

sendDataSetRow

public void sendDataSetRow(java.lang.Object[] values)
                    throws PlatformException
DataSet의 행(row) 데이터를 송신한다.

Parameters:
values - 값들
Throws:
PlatformException

getContentType

public java.lang.String getContentType()
송수신 형식(contentType)을 반환한다. 송수신 형식은 XML, Binary 등 데이터의 표현 형식을 의미한다.

Returns:
송수신 형식
See Also:
PlatformType.CONTENT_TYPE_XML, PlatformType.CONTENT_TYPE_BINARY, PlatformType.CONTENT_TYPE_SSV

setContentType

public void setContentType(java.lang.String contentType)
송수신 형식(contentType)을 설정한다. 송수신 형식은 XML, Binary 등 데이터의 표현 형식을 의미한다.

Parameters:
contentType - 송수신 형식
See Also:
PlatformType.CONTENT_TYPE_XML, PlatformType.CONTENT_TYPE_BINARY, PlatformType.CONTENT_TYPE_SSV

getCharset

public java.lang.String getCharset()
문자셋(charset)을 반환한다.

Returns:
문자셋

setCharset

public void setCharset(java.lang.String charset)
문자셋(charset)을 설정한다.

Parameters:
charset - 문자셋

getProtocolType

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

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

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(int index)
프로토콜 형식(protocolType)을 삭제한다.

Parameters:
index - 위치

removeProtocolType

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

Parameters:
protocolType - 프로토콜 형식

containsProtocolType

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

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

clearProtocolTypes

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


getProtocolTypeCount

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

Returns:
프로토콜 형식의 갯수

getData

public PlatformData getData()
데이터를 반환한다.


setData

public void setData(PlatformData data)
데이터를 설정한다.


getDataTypeChanger

public DataTypeChanger getDataTypeChanger()
DataTypeChanger를 반환한다.

Returns:
DataTypeChanger

setDataTypeChanger

public void setDataTypeChanger(DataTypeChanger dataTypeChanger)
DataTypeChanger를 설정한다.

Parameters:
dataTypeChanger - DataTypeChanger

isVerbose

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

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

setVerbose

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

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

getProperty

public java.lang.Object getProperty(java.lang.String key)
속성값을 반환한다.

Parameters:
key - 속성명
Returns:
속성값

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
속성값을 설정한다.

Parameters:
key - 속성명
value - 속성값

getCurrentContentType

protected java.lang.String getCurrentContentType()
현재 송수신 형식(contentType)을 반환한다.

Returns:
송수신 형식

getCurrentCharset

protected java.lang.String getCurrentCharset()
현재 문자셋(charset)을 반환한다.

Returns:
문자셋

isCurrentVerbose

protected boolean isCurrentVerbose()
현재 INFO 로그의 출력 여부를 검사한다.

Returns:
INFO 로그의 출력 여부
See Also:
PlatformTransaction.isVerbose()

getDefaultContentType

protected java.lang.String getDefaultContentType()
기본 송수신 형식(contentType)을 반환한다.

Returns:
기본 송수신 형식
See Also:
PlatformType.DEFAULT_CONTENT_TYPE

getDefaultCharset

protected java.lang.String getDefaultCharset()
기본 문자셋(charset)을 반환한다.

Returns:
기본 문자셋
See Also:
PlatformType.DEFAULT_CHAR_SET


Copyright © 2000-2011 TOBESOFT Co., Ltd.