@Test(expectedExceptions = UnknownUidException.class) public void testDeleteUnexisting() { assertNotNull(facade); String userName = "delUser"; Uid uid = createTestUser(userName); uid = findUser(userName); assertNotNull(uid); facade.delete(ObjectClass.ACCOUNT, uid, null); uid = findUser(userName); assertNull(uid); facade.delete(ObjectClass.ACCOUNT, new Uid("UNKNOWN"), null); Assert.fail("Delete of not existing user should fail"); }
public void delete(ObjectClass objClass, Uid uid, OperationOptions options) { checkObjectClass(objClass); final String uidValue = uid.getUidValue(); checkUserExist(uidValue); LOG.info("Deleting user : {0}", uidValue); try { revokeAllGrants(uidValue); adminConn.commit(); LOG.info("User deleted : {0}", uidValue); } catch (Exception e) { SQLUtil.rollbackQuietly(adminConn); String detailMsg = new SQLMsgRetriever().retrieveMsg(e); throw new ConnectorException(cfg.getConnectorMessages().format( DB2Messages.DELETE_OF_USER_FAILED, null, uidValue, detailMsg), e); } }
DB2Connector implements AuthenticateOp, SchemaOp, CreateOp,
        SearchOp<FilterWhereBuilder>, DeleteOp, UpdateAttributeValuesOp, TestOp, PoolableConnector,
        AttributeNormalizer { public void delete(ObjectClass objClass, Uid uid, OperationOptions options) { checkObjectClass(objClass); final String uidValue = uid.getUidValue(); checkUserExist(uidValue); LOG.info("Deleting user : {0}", uidValue); try { revokeAllGrants(uidValue); adminConn.commit(); LOG.info("User deleted : {0}", uidValue); } catch (Exception e) { SQLUtil.rollbackQuietly(adminConn); String detailMsg = new SQLMsgRetriever().retrieveMsg(e); throw new ConnectorException(cfg.getConnectorMessages().format( DB2Messages.DELETE_OF_USER_FAILED, null, uidValue, detailMsg), e); } } }
DB2Connector implements AuthenticateOp, SchemaOp, CreateOp,
        SearchOp<FilterWhereBuilder>, DeleteOp, UpdateAttributeValuesOp, TestOp, PoolableConnector,
        AttributeNormalizer { public void delete(ObjectClass objClass, Uid uid, OperationOptions options) { checkObjectClass(objClass); final String uidValue = uid.getUidValue(); checkUserExist(uidValue); LOG.info("Deleting user : {0}", uidValue); try { revokeAllGrants(uidValue); adminConn.commit(); LOG.info("User deleted : {0}", uidValue); } catch (Exception e) { SQLUtil.rollbackQuietly(adminConn); String detailMsg = new SQLMsgRetriever().retrieveMsg(e); throw new ConnectorException(cfg.getConnectorMessages().format( DB2Messages.DELETE_OF_USER_FAILED, null, uidValue, detailMsg), e); } } DB2Connector(); }
DB2Connector implements AuthenticateOp, SchemaOp, CreateOp,
        SearchOp<FilterWhereBuilder>, DeleteOp, UpdateAttributeValuesOp, TestOp, PoolableConnector,
        AttributeNormalizer { public void delete(ObjectClass objClass, Uid uid, OperationOptions options) { checkObjectClass(objClass); final String uidValue = uid.getUidValue(); checkUserExist(uidValue); LOG.info("Deleting user : {0}", uidValue); try { revokeAllGrants(uidValue); adminConn.commit(); LOG.info("User deleted : {0}", uidValue); } catch (Exception e) { SQLUtil.rollbackQuietly(adminConn); String detailMsg = new SQLMsgRetriever().retrieveMsg(e); throw new ConnectorException(cfg.getConnectorMessages().format( DB2Messages.DELETE_OF_USER_FAILED, null, uidValue, detailMsg), e); } } DB2Connector(); Uid authenticate(ObjectClass objectClass, String username, GuardedString password,
            OperationOptions options); Schema schema(); void checkAlive(); void dispose(); DB2Configuration getConfiguration(); void init(Configuration cfg); FilterTranslator<FilterWhereBuilder> createFilterTranslator(ObjectClass oclass,
            OperationOptions options); void executeQuery(ObjectClass oclass, FilterWhereBuilder where, ResultsHandler handler,
            OperationOptions options); Uid create(ObjectClass oclass, Set<Attribute> attrs, OperationOptions options); void delete(ObjectClass objClass, Uid uid, OperationOptions options); void test(); Uid update(ObjectClass objclass, Uid uid, Set<Attribute> attrs, OperationOptions options); Uid addAttributeValues(ObjectClass objclass, Uid uid, Set<Attribute> valuesToAdd,
            OperationOptions options); Uid removeAttributeValues(ObjectClass objclass, Uid uid, Set<Attribute> valuesToRemove,
            OperationOptions options); Attribute normalizeAttribute(ObjectClass oclass, Attribute attribute); }
DB2Connector implements AuthenticateOp, SchemaOp, CreateOp,
        SearchOp<FilterWhereBuilder>, DeleteOp, UpdateAttributeValuesOp, TestOp, PoolableConnector,
        AttributeNormalizer { public void delete(ObjectClass objClass, Uid uid, OperationOptions options) { checkObjectClass(objClass); final String uidValue = uid.getUidValue(); checkUserExist(uidValue); LOG.info("Deleting user : {0}", uidValue); try { revokeAllGrants(uidValue); adminConn.commit(); LOG.info("User deleted : {0}", uidValue); } catch (Exception e) { SQLUtil.rollbackQuietly(adminConn); String detailMsg = new SQLMsgRetriever().retrieveMsg(e); throw new ConnectorException(cfg.getConnectorMessages().format( DB2Messages.DELETE_OF_USER_FAILED, null, uidValue, detailMsg), e); } } DB2Connector(); Uid authenticate(ObjectClass objectClass, String username, GuardedString password,
            OperationOptions options); Schema schema(); void checkAlive(); void dispose(); DB2Configuration getConfiguration(); void init(Configuration cfg); FilterTranslator<FilterWhereBuilder> createFilterTranslator(ObjectClass oclass,
            OperationOptions options); void executeQuery(ObjectClass oclass, FilterWhereBuilder where, ResultsHandler handler,
            OperationOptions options); Uid create(ObjectClass oclass, Set<Attribute> attrs, OperationOptions options); void delete(ObjectClass objClass, Uid uid, OperationOptions options); void test(); Uid update(ObjectClass objclass, Uid uid, Set<Attribute> attrs, OperationOptions options); Uid addAttributeValues(ObjectClass objclass, Uid uid, Set<Attribute> valuesToAdd,
            OperationOptions options); Uid removeAttributeValues(ObjectClass objclass, Uid uid, Set<Attribute> valuesToRemove,
            OperationOptions options); Attribute normalizeAttribute(ObjectClass oclass, Attribute attribute);  }