float longitude = minLongitude + longitudeDelta * i; Map<String, Float> location = MapUtils.hashMap("latitude", lattitude).map("longitude", longitude);
/** * Lazy creates a column family in the keyspace. If it doesn't exist, it will be created, then the call will sleep * until all nodes have acknowledged the schema change */ public void createColumnFamily( String keyspace, ColumnFamilyDefinition cfDef ) { if ( !keySpaceExists( keyspace ) ) { createKeySpace( keyspace ); } //add the cf if ( !cfExists( keyspace, cfDef.getName() ) ) { //default read repair chance to 0.1 cfDef.setReadRepairChance( 0.1d ); cfDef.setCompactionStrategy( "LeveledCompactionStrategy" ); cfDef.setCompactionStrategyOptions( new MapUtils.HashMapBuilder().map("sstable_size_in_mb", "512" ) ); cluster.addColumnFamily( cfDef, true ); logger.info( "Created column family {} in keyspace {}", cfDef.getName(), keyspace ); } }
float longitude = minLongitude + longitudeDelta * i; Map<String, Float> location = MapUtils.hashMap("latitude", lattitude).map("longitude", longitude);
"Request For Organization Account Activation " + organization.getName(), appendEmailFooter( emailMsg( hashMap( "organization_name", organization.getName() ) .map( "activation_url", activation_url ) .map( "organization_owners", organization_owners ), PROPERTIES_EMAIL_SYSADMIN_ORGANIZATION_ACTIVATION ) ) ); sendOrganizationEmail( organization, "Organization Account Confirmed", sendOrganizationEmail( organization, "Organization Account Confirmation", emailMsg( hashMap( "organization_name", organization.getName() ) .map( "confirmation_url", activation_url ), PROPERTIES_EMAIL_ORGANIZATION_CONFIRMATION ) ); sendSysAdminNewOrganizationActivatedNotificationEmail( organization );
MapUtils.hashMap("latitude", latitude).map("longitude", longitude);
properties.put( "actor", hashMap( "displayName", "Ed Anuff" ).map( "objectType", "person" ) ); properties.put( "verb", "tweet" ); properties.put( "content", "I ate a sammich" ); properties.put( "actor", hashMap( "displayName", "Ed Anuff" ).map( "objectType", "person" ) ); properties.put( "verb", "post" ); properties.put( "content", "I wrote a blog post" ); properties.put( "actor", hashMap( "displayName", "Ed Anuff" ).map( "objectType", "person" ) ); properties.put("verb", "tweet"); properties.put( "content", "I ate another sammich" ); properties.put("actor", hashMap("displayName", "Ed Anuff").map("objectType", "person")); properties.put("verb", "post"); properties.put( "content", "I wrote another blog post" );
@Override public void startAppUserPasswordResetFlow( UUID applicationId, User user ) throws Exception { String token = getPasswordResetTokenForAppUser(applicationId, user.getUuid()); OrganizationConfig orgConfig = getOrganizationConfigForApplication(applicationId); String resetPropertyUrl = orgConfig.getFullUrlTemplate(WorkflowUrl.USER_RESETPW_URL); String reset_url = buildUserAppUrl( applicationId, resetPropertyUrl, user, token); Map<String, String> pageContext = hashMap( "reset_url", reset_url ) .map( "reset_url_base", resetPropertyUrl ) .map( "user_uuid", user.getUuid().toString() ).map( "raw_token", token ) .map( "application_id", applicationId.toString() ); /* * String reset_url = String.format( * properties.getProperty(PROPERTIES_USER_RESETPW_URL), oi.getName(), * ai.getName(), user.getUuid().toString()) + "?token=" + token; */ sendHtmlMail( properties, user.getDisplayEmailAddress(), properties.getProperty( PROPERTIES_MAILER_EMAIL ), "Password Reset", appendEmailFooter( emailMsg( pageContext, PROPERTIES_EMAIL_USER_PASSWORD_RESET ) ) ); }
public void sendSysAdminNewOrganizationActivatedNotificationEmail( OrganizationInfo organization ) throws Exception { if ( properties.notifySysAdminOfNewOrganizations() ) { List<UserInfo> users = getAdminUsersForOrganization( organization.getUuid() ); String organization_owners = null; for ( UserInfo user : users ) { organization_owners = ( organization_owners == null ) ? user.getHTMLDisplayEmailAddress() : organization_owners + ", " + user.getHTMLDisplayEmailAddress(); } //TODO: email for org admin or sysadmin? sendHtmlMail( properties, getOrgSystemEmail(), properties.getProperty( PROPERTIES_MAILER_EMAIL ), "Organization Account Activated " + organization.getName(), appendEmailFooter( emailMsg( hashMap( "organization_name", organization.getName() ) .map( "organization_owners", organization_owners ), PROPERTIES_EMAIL_SYSADMIN_ORGANIZATION_ACTIVATED ) ) ); } }
public void sendAdminRequestAppUserActivationEmail( UUID applicationId, User user ) throws Exception { String token = getActivationTokenForAppUser(applicationId, user.getUuid()); OrganizationInfo organization = this.getOrganizationForApplication( applicationId ); OrganizationConfig orgConfig = getOrganizationConfigByUuid(organization.getUuid()); String activationPropertyUrl = orgConfig.getFullUrlTemplate(WorkflowUrl.USER_ACTIVATION_URL); String activation_url = buildUserAppUrl(applicationId, activationPropertyUrl, user, token); /* * String activation_url = String.format( * properties.getProperty(PROPERTIES_USER_ACTIVATION_URL), * applicationId.toString(), user.getUuid().toString()) + "?token=" + token; */ this.sendOrganizationEmail( organization, "Request For User Account Activation " + user.getEmail(), emailMsg( hashMap( "organization_name", organization.getName() ).map( "activation_url", activation_url ), PROPERTIES_EMAIL_ADMIN_USER_ACTIVATION ) ); }
public void sendAdminUserConfirmationEmail( UUID organizationId, UserInfo user ) throws Exception { String token = getConfirmationTokenForAdminUser(user.getUuid(), 0, organizationId); OrganizationConfig orgConfig = organizationId != null ? getOrganizationConfigByUuid(organizationId) : getOrganizationConfigForUserInfo(user); String confirmation_url = orgConfig.getFullUrl(WorkflowUrl.ADMIN_CONFIRMATION_URL, user.getUuid().toString()) + "?token=" + token; String reset_token = getPasswordResetTokenForAdminUser( user.getUuid(), 0, organizationId ); String resetPropertyUrl = orgConfig.getFullUrlTemplate(WorkflowUrl.ADMIN_RESETPW_URL); String reset_url = String.format(resetPropertyUrl, user.getUuid().toString()) + "?token=" + reset_token; sendAdminUserEmail(user, "User Account Confirmation: " + user.getEmail(), emailMsg(hashMap("confirm_email", user.getEmail()).map("confirmation_url", confirmation_url) .map("reset_url", reset_url), PROPERTIES_EMAIL_ADMIN_CONFIRMATION)); }
@Override public void startAdminUserPasswordResetFlow( UUID organizationId, UserInfo user ) throws Exception { String token = getPasswordResetTokenForAdminUser( user.getUuid(), 0, organizationId ); OrganizationConfig orgConfig = organizationId != null ? getOrganizationConfigByUuid(organizationId) : getOrganizationConfigForUserInfo(user); String resetPropertyUrl = orgConfig.getFullUrlTemplate(WorkflowUrl.ADMIN_RESETPW_URL); String reset_url = String.format(resetPropertyUrl, user.getUuid().toString()) + "?token=" + token; Map<String, String> pageContext = hashMap( "reset_url", reset_url ) .map( "reset_url_base", resetPropertyUrl ) .map( "user_uuid", user.getUuid().toString() ).map( "raw_token", token ); sendHtmlMail( properties, user.getDisplayEmailAddress(), properties.getProperty( PROPERTIES_MAILER_EMAIL ), "Password Reset", appendEmailFooter( emailMsg( pageContext, PROPERTIES_EMAIL_ADMIN_PASSWORD_RESET ) ) ); }
public static <S, T> HashMapBuilder<S, T> hashMap( S key, T value ) { return new HashMapBuilder<S, T>().map( key, value ); }
public void sendSysAdminRequestAdminActivationEmail( UUID organizationId, UserInfo user ) throws Exception { String token = getActivationTokenForAdminUser(user.getUuid(), 0, organizationId); //TODO: admin specific email OrganizationConfig orgConfig = organizationId != null ? getOrganizationConfigByUuid(organizationId) : getOrganizationConfigForUserInfo(user); String activation_url = orgConfig.getFullUrl(WorkflowUrl.ADMIN_ACTIVATION_URL, user.getUuid().toString()) + "?token=" + token; String adminSystemEmail = organizationId != null ? getAdminSystemEmailForOrganization(organizationId) : getAdminSystemEmailForApplication(user.getApplicationId()); sendHtmlMail(properties, adminSystemEmail, properties.getProperty(PROPERTIES_MAILER_EMAIL), "Request For Admin User Account Activation " + user.getEmail(), appendEmailFooter( emailMsg(hashMap("user_email", user.getEmail()).map("activation_url", activation_url), PROPERTIES_EMAIL_SYSADMIN_ADMIN_ACTIVATION))); }
@Test public void verifyLiveConnect() throws Exception { Application application = setup.getEmf().getEntityManager( applicationId ).getApplication(); Map pingProps = MapUtils.hashMap( "api_url", "" ).map( "client_secret", "" ) .map( "client_id", "dev.app.appservicesvalidation" ); PingIdentityProvider pingProvider = ( PingIdentityProvider ) setup.getProviderFactory().pingident( application ); pingProvider.saveToConfiguration( pingProps ); pingProvider.configure(); User user = pingProvider.createOrAuthenticate( "u0qoW7TS9eT8Vmt7UzrEWrhHbhDK" ); assertNotNull( user ); } }
@Test @Category(ExperimentalTest.class) public void verifyGetOrCreateOk() throws Exception { Application application = setup.getEmf().getEntityManager( applicationId ).getApplication(); Map fb_user = MapUtils.hashMap( "id", "12345678" ).map( "name", "Facebook User" ).map( "username", "fb.user" ); FacebookProvider facebookProvider = ( FacebookProvider ) providerFactory.facebook( application ); String fb_access_token = "CAAE...NJIZD"; User user1 = facebookProvider.createOrAuthenticate( fb_access_token ); assertNotNull( user1 ); }
public HashMapBuilder<S, T> map( S key, T value ) { put( key, value ); return this; } }