コード例 #1
0
  public void start() {

    String configDir = Container.getInstance().getConfiguration().getConfigurationDirectory();

    ILookup lookup = lookupContainer.getDaoLookup();
    XMLUserObjectDAO usersDao = new XMLUserObjectDAO(configDir + USER_CONFIG_FILE);
    lookup.addContentObject(User.class, usersDao);

    if (Agent.getRMProperty("server.userManagement.initialize").equals("true")) {
      createDefaultUserEntries();
    }

    MyClass<AgentObject> myClass = new MyClass<AgentObject>();
    myClass.remove(new User());
    myClass.add(User.class);
  }
コード例 #2
0
  /** Creates default users if there aren't any */
  public void createDefaultUserEntries() {

    XMLUserObjectDAO dao =
        (XMLUserObjectDAO) lookupContainer.getDaoLookup().getFirstContentObject(User.class);
    logger.info("Creating default users");

    ArrayList<String> roleList = new ArrayList<String>();
    roleList.add("user");
    dao.save(
        createUser(
            9999L,
            "[email protected]",
            "Kundlacz",
            "heiko.kundlacz",
            "heiko",
            false,
            roleList));
    roleList.add("admin");
    dao.save(
        createUser(1L, "[email protected]", "Administrator", "admin", "admin", false, roleList));
  }
コード例 #3
0
 public void stop() {
   lookupContainer.getDaoLookup().removeEntry(User.class);
 }