/**
* <p>Loads some users during the first construction.</p>
*/
@PostConstruct
public void create() {
final IdentityManager identityManager = partitionManager.createIdentityManager();
final RelationshipManager relationshipManager = partitionManager.createRelationshipManager();
User john = new User("john");
john.setEmail("john@doe.com");
john.setFirstName("John");
john.setLastName("Doe");
User hacker = new User("hacker");
hacker.setEmail("hacker@illegal.ru");
hacker.setFirstName("Hacker");
hacker.setLastName("anonymous");
identityManager.add(john);
identityManager.add(hacker);
final Password defaultPassword = new Password("123");
identityManager.updateCredential(john, defaultPassword);
identityManager.updateCredential(hacker, defaultPassword);
Role roleDeveloper = new Role("simple");
Role roleAdmin = new Role("admin");
identityManager.add(roleDeveloper);
identityManager.add(roleAdmin);
relationshipManager.add(new Grant(john, roleDeveloper));
relationshipManager.add(new Grant(john, roleAdmin));
}