@ Override public CompletableFuture < DeleteScopeStatus > deleteScope ( final String scopeName ) { return getScope ( scopeName ) . deleteScope ( ) . handle ( ( result , e ) -> { Throwable ex = Exceptions . unwrap ( e ) ; if ( ex == null ) { return DeleteScopeStatus . newBuilder ( ) . setStatus ( DeleteScopeStatus . Status . SUCCESS ) . build ( ) ; } if ( ex instanceof StoreException . DataNotFoundException ) { return DeleteScopeStatus . newBuilder ( ) . setStatus ( DeleteScopeStatus . Status . SCOPE_NOT_FOUND ) . build ( ) ; } else if ( ex instanceof StoreException . DataNotEmptyException ) { return DeleteScopeStatus . newBuilder ( ) . setStatus ( DeleteScopeStatus . Status . SCOPE_NOT_EMPTY ) . build ( ) ; } else { log . debug ( "DeleteScope failed due to {} " , ex ) ; return DeleteScopeStatus . newBuilder ( ) . setStatus ( DeleteScopeStatus . Status . FAILURE ) . build ( ) ; } } ) ; }
Delete a scope with given name .