public static Query fromEmail( String email ) { Query q = new Query(); q.addIdentifier( Identifier.fromEmail( email ) ); return q; }
public User getAdminUserEntityByEmail( String email ) throws Exception { if ( email == null ) { return null; } return getUserEntityByIdentifier(smf.getManagementAppId(), Identifier.fromEmail(email)); }
try { user = managementService.getAppUserByIdentifier(entityManager.getApplication().getUuid(), Identifier.fromEmail(pingUser.get("username").toString())); } catch (Exception ex) { logger.error("Unable to create/authenticate", ex);
@Override public UserInfo getAdminUserByEmail( String email ) throws Exception { if ( email == null ) { return null; } return getUserInfo(smf.getManagementAppId(), getUserEntityByIdentifier(smf.getManagementAppId(), Identifier.fromEmail(email))); }
try { user = managementService.getAppUserByIdentifier( entityManager.getApplication().getUuid(), Identifier.fromEmail( fb_user_email ) );
@Test public void emailIdentifierTest() throws Exception { logger.debug( "emailIdentifierTest" ); EntityManager em = app.getEntityManager(); assertNotNull( em ); User user = new User(); user.setUsername( "foobar" ); user.setEmail( "foobar@usergrid.org" ); Entity createUser = em.create( user ); assertNotNull( createUser ); //we create 2 entities, otherwise this test will pass when it shouldn't User user2 = new User(); user2.setUsername( "foobar2" ); user2.setEmail( "foobar2@usergrid.org" ); Entity createUser2 = em.create( user2 ); assertNotNull( createUser2 ); app.waitForQueueDrainAndRefreshIndex(); // overlap Query query = new Query(); query.addIdentifier( Identifier.fromEmail( "foobar@usergrid.org" ) ); Results r = em.searchCollection( em.getApplicationRef(), "users", query ); assertEquals( "We should only get 1 result", 1, r.size() ); assertNull( "No cursor should be present", r.getCursor() ); assertEquals( "Saved entity returned", createUser, r.getEntity() ); }