Package org.exist.config

Examples of org.exist.config.ConfigurationException


    int id = -1;
    XmldbURI home = null;
   
    final String name = node.getAttribute(NAME);
    if (name == null ) //|| name.length() == 0
      {throw new ConfigurationException("account needs a name");}
   
    Attr attr;
    if (majorVersion == 0) {
      attr = node.getAttributeNode(PASS);
      digestPassword = attr == null ? null : attr.getValue();
    } else {
      attr = node.getAttributeNode(PASS);
      password = attr == null ? null : attr.getValue();

      attr = node.getAttributeNode(DIGEST_PASS);
      digestPassword = attr == null ? null : attr.getValue();
    }
    final Attr userId = node.getAttributeNode(USER_ID);
    if (userId == null)
      {throw new ConfigurationException("attribute id is missing");}
    try {
      id = Integer.parseInt(userId.getValue());
    } catch (final NumberFormatException e) {
      throw new ConfigurationException("illegal user id: " + userId + " for account " + name);
    }
    final Attr homeAttr = node.getAttributeNode(HOME);
    home = homeAttr == null ? null : XmldbURI.create(homeAttr.getValue());
   
    //TODO: workaround for 'null' admin's password. It should be removed after 6 months (@ 10 July 2010)
View Full Code Here


        if (account == null) {
            return false;
        }

        if (account.getRealmId() == null) {
            throw new ConfigurationException("Account must have realm id.");
        }
       
        accountLocks.getWriteLock(account).lock();
        try {
            return findRealmForRealmId(account.getRealmId()).updateAccount(account);
View Full Code Here

        if (group == null) {
            return false;
        }

        if (group.getRealmId() == null) {
            throw new ConfigurationException("Group must have realm id.");
        }

        groupLocks.getWriteLock(group).lock();
        try {
            return findRealmForRealmId(group.getRealmId()).updateGroup(group);
View Full Code Here

        if (group == null) {
            return false;
        }

        if (group.getRealmId() == null) {
            throw new ConfigurationException("Group must have realm id.");
        }
       
        groupLocks.getWriteLock(group).lock();
        try {
            return findRealmForRealmId(group.getRealmId()).deleteGroup(group);
View Full Code Here

        if (account == null)
            {return false;}

        if (account.getRealmId() == null) {
            throw new ConfigurationException("Account must have realm id.");
        }
       
        accountLocks.getWriteLock(account).lock();
        try {
            return findRealmForRealmId(account.getRealmId()).deleteAccount(account);
View Full Code Here

    }

    @Override
    public Group addGroup(Group group) throws PermissionDeniedException, EXistException {
        if(group.getRealmId() == null) {
            throw new ConfigurationException("Group must have realm id.");
        }

        if(group.getName() == null || group.getName().isEmpty()) {
            throw new ConfigurationException("Group must have name.");
        }

        final int id;
        if(group.getId() != Group.UNDEFINED_ID) {
            id = group.getId();
        } else {
            id = getNextGroupId();
        }
       
        final AbstractRealm registeredRealm = (AbstractRealm)findRealmForRealmId(group.getRealmId());
        if (registeredRealm.hasGroup(group.getName())) {
            throw new ConfigurationException("The group '"+group.getName()+"' at realm '" + group.getRealmId() + "' already exist.");
        }
       
        final GroupImpl newGroup = new GroupImpl(registeredRealm, id, group.getName(), group.getManagers());
        for(final SchemaType metadataKey : group.getMetadataKeys()) {
            final String metadataValue = group.getMetadataValue(metadataKey);
View Full Code Here

    @Override
    public final Account addAccount(Account account) throws  PermissionDeniedException, EXistException{
        if(account.getRealmId() == null) {
          LOG.debug("Account must have realm id.");
            throw new ConfigurationException("Account must have realm id.");
        }
   
        if(account.getName() == null || account.getName().isEmpty()) {
          LOG.debug("Account must have name.");
            throw new ConfigurationException("Account must have name.");
        }
   
        final int id;
        if(account.getId() != Account.UNDEFINED_ID) {
            id = account.getId();
View Full Code Here

    }
   
    @Override
    public final Account addAccount(DBBroker broker, Account account) throws  PermissionDeniedException, EXistException{
        if(account.getRealmId() == null) {
            throw new ConfigurationException("Account must have realm id.");
        }
   
        if(account.getName() == null || account.getName().isEmpty()) {
            throw new ConfigurationException("Account must have name.");
        }
   
        final int id;
        if(account.getId() != Account.UNDEFINED_ID) {
            id = account.getId();
View Full Code Here

        for(final Realm realm : realms) {
            if(realm.getId().equals(realmId)) {
                return realm;
            }
        }
        throw new ConfigurationException("The realm id = '" + realmId + "' not found.");
    }
View Full Code Here

              return addGroup(new GroupAider(ID, OAUTH));
            }
          });
               
          if (primaryGroup == null)
            throw new ConfigurationException("OAuth realm can not create primary group 'OAuth'.");
         
        } catch (PermissionDeniedException e) {
          throw e;
        } catch (ConfigurationException e) {
          throw new PermissionDeniedException(e);
View Full Code Here

TOP

Related Classes of org.exist.config.ConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.