@Test public void testAuthenticateSuc() { String username = getTestRequiredProperty("testUser"); String password = getTestRequiredProperty("testPassword"); Map<String, Object> emptyMap = Collections.emptyMap(); facade.authenticate(ObjectClass.ACCOUNT, username, new GuardedString(password.toCharArray()), new OperationOptions(emptyMap)); }
public Uid authenticate(ObjectClass objectClass, String username, GuardedString password, OperationOptions options) { LOG.info("Authenticate user: {0}", username); Connection conn = null; try { conn = createConnection(username, password); } catch (RuntimeException e) { if (e.getCause() instanceof SQLException) { SQLException sqlE = (SQLException) e.getCause(); if ("28000".equals(sqlE.getSQLState()) && -4214 == sqlE.getErrorCode()) { LOG.info(e, "DB2.authenticate : Invalid user/passord for user: {0}", username); throw new InvalidCredentialException(cfg.getConnectorMessages().format( DB2Messages.AUTHENTICATE_INVALID_CREDENTIALS, null), e.getCause()); } } throw e; } finally { SQLUtil.closeQuietly(conn); } LOG.info("User authenticated : {0}", username); return new Uid(username.toUpperCase()); }
DB2Connector implements AuthenticateOp, SchemaOp, CreateOp,
        SearchOp<FilterWhereBuilder>, DeleteOp, UpdateAttributeValuesOp, TestOp, PoolableConnector,
        AttributeNormalizer { public Uid authenticate(ObjectClass objectClass, String username, GuardedString password, OperationOptions options) { LOG.info("Authenticate user: {0}", username); Connection conn = null; try { conn = createConnection(username, password); } catch (RuntimeException e) { if (e.getCause() instanceof SQLException) { SQLException sqlE = (SQLException) e.getCause(); if ("28000".equals(sqlE.getSQLState()) && -4214 == sqlE.getErrorCode()) { LOG.info(e, "DB2.authenticate : Invalid user/passord for user: {0}", username); throw new InvalidCredentialException(cfg.getConnectorMessages().format( DB2Messages.AUTHENTICATE_INVALID_CREDENTIALS, null), e.getCause()); } } throw e; } finally { SQLUtil.closeQuietly(conn); } LOG.info("User authenticated : {0}", username); return new Uid(username.toUpperCase()); } }
DB2Connector implements AuthenticateOp, SchemaOp, CreateOp,
        SearchOp<FilterWhereBuilder>, DeleteOp, UpdateAttributeValuesOp, TestOp, PoolableConnector,
        AttributeNormalizer { public Uid authenticate(ObjectClass objectClass, String username, GuardedString password, OperationOptions options) { LOG.info("Authenticate user: {0}", username); Connection conn = null; try { conn = createConnection(username, password); } catch (RuntimeException e) { if (e.getCause() instanceof SQLException) { SQLException sqlE = (SQLException) e.getCause(); if ("28000".equals(sqlE.getSQLState()) && -4214 == sqlE.getErrorCode()) { LOG.info(e, "DB2.authenticate : Invalid user/passord for user: {0}", username); throw new InvalidCredentialException(cfg.getConnectorMessages().format( DB2Messages.AUTHENTICATE_INVALID_CREDENTIALS, null), e.getCause()); } } throw e; } finally { SQLUtil.closeQuietly(conn); } LOG.info("User authenticated : {0}", username); return new Uid(username.toUpperCase()); } DB2Connector(); }
DB2Connector implements AuthenticateOp, SchemaOp, CreateOp,
        SearchOp<FilterWhereBuilder>, DeleteOp, UpdateAttributeValuesOp, TestOp, PoolableConnector,
        AttributeNormalizer { public Uid authenticate(ObjectClass objectClass, String username, GuardedString password, OperationOptions options) { LOG.info("Authenticate user: {0}", username); Connection conn = null; try { conn = createConnection(username, password); } catch (RuntimeException e) { if (e.getCause() instanceof SQLException) { SQLException sqlE = (SQLException) e.getCause(); if ("28000".equals(sqlE.getSQLState()) && -4214 == sqlE.getErrorCode()) { LOG.info(e, "DB2.authenticate : Invalid user/passord for user: {0}", username); throw new InvalidCredentialException(cfg.getConnectorMessages().format( DB2Messages.AUTHENTICATE_INVALID_CREDENTIALS, null), e.getCause()); } } throw e; } finally { SQLUtil.closeQuietly(conn); } LOG.info("User authenticated : {0}", username); return new Uid(username.toUpperCase()); } 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 Uid authenticate(ObjectClass objectClass, String username, GuardedString password, OperationOptions options) { LOG.info("Authenticate user: {0}", username); Connection conn = null; try { conn = createConnection(username, password); } catch (RuntimeException e) { if (e.getCause() instanceof SQLException) { SQLException sqlE = (SQLException) e.getCause(); if ("28000".equals(sqlE.getSQLState()) && -4214 == sqlE.getErrorCode()) { LOG.info(e, "DB2.authenticate : Invalid user/passord for user: {0}", username); throw new InvalidCredentialException(cfg.getConnectorMessages().format( DB2Messages.AUTHENTICATE_INVALID_CREDENTIALS, null), e.getCause()); } } throw e; } finally { SQLUtil.closeQuietly(conn); } LOG.info("User authenticated : {0}", username); return new Uid(username.toUpperCase()); } 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);  }