#NEWLINE# @ need_db_opened #NEWLINE# def prepare( self , params = None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . _cluster_name = params [ 0 ] #NEWLINE# self . set_cluster_type ( params [ 1 ] ) #NEWLINE# self . _cluster_location = params [ 2 ] #NEWLINE# self . _datasegment_name = params [ 3 ] #NEWLINE# #UNINDENT# except ( IndexError , TypeError ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise PyOrientBadMethodCallException ( ( params [ 1 ] + ' is not a valid data cluster type' ) , [ ] ) #NEWLINE# #UNINDENT# if ( self . get_protocol ( ) < 24 ) : #NEWLINE# #INDENT# self . _append ( ( FIELD_STRING , self . _cluster_type ) ) #NEWLINE# self . _append ( ( FIELD_STRING , self . _cluster_name ) ) #NEWLINE# self . _append ( ( FIELD_STRING , self . _cluster_location ) ) #NEWLINE# self . _append ( ( FIELD_STRING , self . _datasegment_name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _append ( ( FIELD_STRING , self . _cluster_name ) ) #NEWLINE# #UNINDENT# if ( self . get_protocol ( ) >= 18 ) : #NEWLINE# #INDENT# self . _append ( ( FIELD_SHORT , self . _new_cluster_id ) ) #NEWLINE# #UNINDENT# return super ( DataClusterAddMessage , self ) . prepare ( )