public Object execute ( final Map < Object , Object > iArgs ) { final ODatabaseDocumentInternal database = getDatabase ( ) ; database . checkSecurity ( ORule . ResourceGeneric . DATABASE , "sync" , ORole . PERMISSION_UPDATE ) ; final OStorage stg = database . getStorage ( ) ; if ( ! ( stg instanceof ODistributedStorage ) ) throw new ODistributedException ( "SYNC DATABASE command cannot be executed against a non distributed server" ) ; final ODistributedStorage dStg = ( ODistributedStorage ) stg ; final OHazelcastPlugin dManager = ( OHazelcastPlugin ) dStg . getDistributedManager ( ) ; if ( dManager == null || ! dManager . isEnabled ( ) ) throw new OCommandExecutionException ( "OrientDB is not started in distributed mode" ) ; final String databaseName = database . getName ( ) ; return dManager . installDatabase ( true , databaseName , parsedStatement . isForce ( ) , ! parsedStatement . isFull ( ) ) ; }
Execute the SYNC DATABASE .