public ReplicationResult trigger ( ) { assertNotEmpty ( source , "Source" ) ; assertNotEmpty ( target , "Target" ) ; InputStream response = null ; try { JsonObject json = createJson ( ) ; if ( log . isLoggable ( Level . FINE ) ) { log . fine ( json . toString ( ) ) ; } final URI uri = new DatabaseURIHelper ( client . getBaseUri ( ) ) . path ( "_replicate" ) . build ( ) ; response = client . post ( uri , json . toString ( ) ) ; final InputStreamReader reader = new InputStreamReader ( response , "UTF-8" ) ; return client . getGson ( ) . fromJson ( reader , ReplicationResult . class ) ; } catch ( UnsupportedEncodingException e ) { // This should never happen as every implementation of the java platform is required // to support UTF-8. throw new RuntimeException ( e ) ; } finally { close ( response ) ; } }
Triggers a replication request .