@Test public void testDelete() { String username = testProps.getProperty("testUser", String.class, "TEST"); Map<String, Object> emptyMap = Collections.emptyMap(); Set<Attribute> attributes = new HashSet<Attribute>(); attributes.add(new Name(username)); attributes.add(AttributeBuilder.buildPassword(new char[] { 'a', 'b', 'c' })); Uid uid = findUser(username); if (uid == null) { uid = facade.create(ObjectClass.ACCOUNT, attributes, new OperationOptions(emptyMap)); assertNotNull(uid); } facade.delete(ObjectClass.ACCOUNT, new Uid(username), new OperationOptions(emptyMap)); uid = findUser(username); assertNull("User not deleted", uid); }
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);  }