public static CommandExecutor newInstance ( final PostgreSQLCommandPacketType commandPacketType , final PostgreSQLCommandPacket commandPacket , final BackendConnection backendConnection ) { log . debug ( "Execute packet type: {}, value: {}" , commandPacketType , commandPacket ) ; switch ( commandPacketType ) { case QUERY : return new PostgreSQLComQueryExecutor ( ( PostgreSQLComQueryPacket ) commandPacket , backendConnection ) ; case PARSE : return new PostgreSQLComParseExecutor ( ( PostgreSQLComParsePacket ) commandPacket , backendConnection ) ; case BIND : return new PostgreSQLComBindExecutor ( ( PostgreSQLComBindPacket ) commandPacket , backendConnection ) ; case DESCRIBE : return new PostgreSQLComDescribeExecutor ( ) ; case EXECUTE : return new PostgreSQLComExecuteExecutor ( ) ; case SYNC : return new PostgreSQLComSyncExecutor ( ) ; case TERMINATE : return new PostgreSQLComTerminationExecutor ( ) ; default : return new PostgreSQLUnsupportedCommandExecutor ( ) ; } }
Create new instance of command executor .