Example #1
0
 private int compareNullSafe(Configuration c) {
   int rc = 0;
   if ((this.getUser() == null && c.getUser() != null)) {
     rc = 1;
   } else if (c.getUser() == null && this.getUser() != null) {
     rc = -1;
   } else {
     // e1 and e2 != null
     rc = compareNullSafe(c.getUser());
   }
   return rc;
 }
Example #2
0
 private String loadLogin(CnATreeElement element) {
   String login = null;
   try {
     LoadConfiguration command = new LoadConfiguration(element);
     command = ServiceFactory.lookupCommandService().executeCommand(command);
     Configuration configuration = command.getConfiguration();
     if (configuration != null) {
       login = configuration.getUser();
     }
   } catch (CommandException e) {
     LOG.error("Error while loading account data.", e); // $NON-NLS-1$
   }
   return login;
 }
Example #3
0
 public static Configuration createDefaultAccount() {
   Configuration account = new Configuration();
   account.addRole(IRightsService.USERDEFAULTGROUPNAME);
   account.setAdminUser(false);
   account.setScopeOnly(false);
   account.setWebUser(true);
   account.setRcpUser(true);
   account.setNotificationExpirationDays(14);
   account.setAuditorNotificationExpirationDays(14);
   return account;
 }
  /* (non-Javadoc)
   * @see sernet.verinice.interfaces.ICommand#execute()
   */
  @SuppressWarnings("restriction")
  @Override
  public void execute() {

    IBaseDao<Configuration, Serializable> confDao = getDaoFactory().getDAO(Configuration.class);
    List<Configuration> confs = confDao.findAll();

    for (Configuration c : confs) {

      try {
        CnATreeElement elmt = (CnATreeElement) c.getPerson();
        if (elmt.getUuid().equals(pIso.getUuid())) {
          configuration = c;
          break;
        }
      } catch (Exception e) {
        LOG.error("Error", e);
      }
    }
  }
Example #5
0
 public static void hydrateElement(
     IBaseDao<Configuration, Serializable> dao,
     Configuration configuration,
     boolean includingCollections) {
   hydrateEntity(dao, configuration.getEntity());
 }