com.continuent.tungsten.replicator.dbms
Class StatementData

java.lang.Object
  extended by com.continuent.tungsten.replicator.dbms.DBMSData
      extended by com.continuent.tungsten.replicator.dbms.StatementData
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LoadDataFileQuery

public class StatementData
extends DBMSData

Defines a SQL statement that must be replicated.

Version:
1.0
Author:
Teemu Ollakka
See Also:
Serialized Form

Field Summary
static java.lang.String CREATE_OR_DROP_DB
           
 
Fields inherited from class com.continuent.tungsten.replicator.dbms.DBMSData
options
 
Constructor Summary
StatementData(java.lang.String query)
           
StatementData(java.lang.String query, java.lang.Long timestamp, java.lang.String defaultSchema)
          Creates a new instance including timestamp and default schema.
 
Method Summary
 void appendToQuery(java.lang.String buffer)
          Append to the query, translating if necessary to a byte buffer if the query is stored in bytes.
 java.lang.String getCharset()
          Returns the Java character set name of the statement as represented in bytes or null if not known.
 java.lang.String getDefaultSchema()
          Returns the default schema or null if default schema should be inferred from a previous SqlStatement instance in the same transaction.
 int getErrorCode()
           
 java.lang.Object getParsingMetadata()
           
 java.lang.String getQuery()
          Returns the SQL statement that must be replicated.
 byte[] getQueryAsBytes()
           
 java.lang.Long getTimestamp()
          Returns the current timestamp in order to be able to process values that refer to current time or a null if timestamp is not relevant to this query.
 void setCharset(java.lang.String charset)
          Sets the character set name for this statement as represented in bytes.
 void setDefaultSchema(java.lang.String defaultSchema)
           
 void setErrorCode(int errorCode)
           
 void setParsingMetadata(java.lang.Object o)
           
 void setQuery(byte[] query)
           
 void setQuery(java.lang.String query)
           
 void setTimestamp(java.lang.Long timestamp)
           
 java.lang.String toString()
           
 
Methods inherited from class com.continuent.tungsten.replicator.dbms.DBMSData
addOption, getOption, getOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATE_OR_DROP_DB

public static final java.lang.String CREATE_OR_DROP_DB
See Also:
Constant Field Values
Constructor Detail

StatementData

public StatementData(java.lang.String query)

StatementData

public StatementData(java.lang.String query,
                     java.lang.Long timestamp,
                     java.lang.String defaultSchema)
Creates a new instance including timestamp and default schema.

Method Detail

getDefaultSchema

public java.lang.String getDefaultSchema()
Returns the default schema or null if default schema should be inferred from a previous SqlStatement instance in the same transaction.


getTimestamp

public java.lang.Long getTimestamp()
Returns the current timestamp in order to be able to process values that refer to current time or a null if timestamp is not relevant to this query.


getQuery

public java.lang.String getQuery()
Returns the SQL statement that must be replicated.


setDefaultSchema

public void setDefaultSchema(java.lang.String defaultSchema)

setTimestamp

public void setTimestamp(java.lang.Long timestamp)

setQuery

public void setQuery(java.lang.String query)

setQuery

public void setQuery(byte[] query)

appendToQuery

public void appendToQuery(java.lang.String buffer)
Append to the query, translating if necessary to a byte buffer if the query is stored in bytes.

Parameters:
buffer - String value to be appended.

getCharset

public java.lang.String getCharset()
Returns the Java character set name of the statement as represented in bytes or null if not known.


setCharset

public void setCharset(java.lang.String charset)
Sets the character set name for this statement as represented in bytes.

Parameters:
charset - Java character set name

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setErrorCode

public void setErrorCode(int errorCode)

getErrorCode

public int getErrorCode()

getQueryAsBytes

public byte[] getQueryAsBytes()

getParsingMetadata

public java.lang.Object getParsingMetadata()

setParsingMetadata

public void setParsingMetadata(java.lang.Object o)