Package org.elasticsearch.plugins.security

Examples of org.elasticsearch.plugins.security.MalformedConfigurationException


        .setRefresh(true).setOperationThreaded(false).get();

    if (resp.isExists()) {
      return resp.getSourceAsBytesRef();
    } else {
      throw new MalformedConfigurationException("document type " + type
          + " with id " + id + " does not exists");
    }
  }
View Full Code Here


        } else if (token == XContentParser.Token.END_OBJECT) {

          if (currentPerm != null && perms.contains(currentPerm)) {
            log.error("Duplicate permissions " + currentPerm);
            throw new MalformedConfigurationException(
                "Duplicate permissions found");
          }

          /*if (currentPerm != null && !currentPerm.isValid()) {
                        log.error("Perm not valid " + currentPerm);
                        throw new MalformedConfigurationException(
                                "Invalid permission found");
                    }*/

          if (currentPerm != null) {
             
              if(currentPerm.permLevel == null){
                  currentPerm.permLevel = getDefaultPermLevelForEvaluator();
              }
             
            perms.add(currentPerm);
            currentPerm = null;
          }

        } else if (token == XContentParser.Token.FIELD_NAME) {
          currentFieldName = this.parser.currentName();

        } else if (token.isValue()) {

          if ("hosts".equals(currentFieldName)) {
            currentPerm.addInetAddress(this.parser.text());
          }
          if ("users".equals(currentFieldName)) {
            currentPerm.addUser(this.parser.text());
          }
          if ("roles".equals(currentFieldName)) {
            currentPerm.addRole(this.parser.text());
          } else if ("indices".equals(currentFieldName)) {
            currentPerm.addIndice(this.parser.text());
          } else if ("types".equals(currentFieldName)) {
            currentPerm.addType(this.parser.text());
          } else if (permissionFieldName.equals(currentFieldName)) {
            final String text = this.parser.text();
            currentPerm.setPermLevel(this
                .createFromString(text == null ? null : text
                    .trim()));
          }

        }

      }

    } catch (final Exception e) {
      throw new MalformedConfigurationException(e);
    } finally {
      this.parser.close();
    }
   
   
   
   
   

    log.debug("Checking " + perms.size() + " perms");

    T permLevel = null;

    for (final Perm<T> p : perms) {

      if (p.isDefault()) {
        permLevel = p.permLevel;
        if (log.isDebugEnabled()) {
          log.debug("Default set to " + permLevel);
        }
        break;
      }
    }

    if (permLevel == null) {
      throw new MalformedConfigurationException(
          "No default configuration found");
    }

    /*for (final Perm<T> p : perms) {

View Full Code Here

TOP

Related Classes of org.elasticsearch.plugins.security.MalformedConfigurationException

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.