@Test(expected = InvalidOperationException.class) public void onCreateDatabaseEvent() throws Exception { PreCreateDatabaseEvent context = mock(PreCreateDatabaseEvent.class); when(context.getEventType()).thenReturn(PreEventType.CREATE_DATABASE); Database db = new Database(); db.setName(authorizedDatabaseName1); listener.onEvent(context); }
@Override public void onEvent(PreEventContext context) throws MetaException, NoSuchObjectException, InvalidOperationException { switch (context.getEventType()) { case READ_TABLE: Table table = ((PreReadTableEvent) context).getTable(); applyWhitelist(table.getDbName()); break; case READ_DATABASE: Database db = ((PreReadDatabaseEvent) context).getDatabase(); applyWhitelist(db.getName()); break; default: throw new InvalidOperationException(context.getEventType() + " is disabled from read-only metastores."); } }
ApiaryReadOnlyAuthPreEventListener extends MetaStorePreEventListener { @Override public void onEvent(PreEventContext context) throws MetaException, NoSuchObjectException, InvalidOperationException { switch (context.getEventType()) { case READ_TABLE: Table table = ((PreReadTableEvent) context).getTable(); applyWhitelist(table.getDbName()); break; case READ_DATABASE: Database db = ((PreReadDatabaseEvent) context).getDatabase(); applyWhitelist(db.getName()); break; default: throw new InvalidOperationException(context.getEventType() + " is disabled from read-only metastores."); } } }
ApiaryReadOnlyAuthPreEventListener extends MetaStorePreEventListener { @Override public void onEvent(PreEventContext context) throws MetaException, NoSuchObjectException, InvalidOperationException { switch (context.getEventType()) { case READ_TABLE: Table table = ((PreReadTableEvent) context).getTable(); applyWhitelist(table.getDbName()); break; case READ_DATABASE: Database db = ((PreReadDatabaseEvent) context).getDatabase(); applyWhitelist(db.getName()); break; default: throw new InvalidOperationException(context.getEventType() + " is disabled from read-only metastores."); } } ApiaryReadOnlyAuthPreEventListener(Configuration config); }
ApiaryReadOnlyAuthPreEventListener extends MetaStorePreEventListener { @Override public void onEvent(PreEventContext context) throws MetaException, NoSuchObjectException, InvalidOperationException { switch (context.getEventType()) { case READ_TABLE: Table table = ((PreReadTableEvent) context).getTable(); applyWhitelist(table.getDbName()); break; case READ_DATABASE: Database db = ((PreReadDatabaseEvent) context).getDatabase(); applyWhitelist(db.getName()); break; default: throw new InvalidOperationException(context.getEventType() + " is disabled from read-only metastores."); } } ApiaryReadOnlyAuthPreEventListener(Configuration config); @Override void onEvent(PreEventContext context); }
ApiaryReadOnlyAuthPreEventListener extends MetaStorePreEventListener { @Override public void onEvent(PreEventContext context) throws MetaException, NoSuchObjectException, InvalidOperationException { switch (context.getEventType()) { case READ_TABLE: Table table = ((PreReadTableEvent) context).getTable(); applyWhitelist(table.getDbName()); break; case READ_DATABASE: Database db = ((PreReadDatabaseEvent) context).getDatabase(); applyWhitelist(db.getName()); break; default: throw new InvalidOperationException(context.getEventType() + " is disabled from read-only metastores."); } } ApiaryReadOnlyAuthPreEventListener(Configuration config); @Override void onEvent(PreEventContext context);  }