Package com.esri.gpt.framework.context

Examples of com.esri.gpt.framework.context.ConfigurationException


      mc = _connections.returnConnection(reference);
    } catch (ClassNotFoundException e) {
      String sMsg = "Unable to open connection for driver: "+
                    reference.getDirectDriverClassName()+
                    " (connectionTag="+referenceTag+")";
      throw new ConfigurationException(sMsg,e);
    } catch (NamingException e) {
      String sMsg = "Unable to open connection for jndiName: "+
                    reference.getJndiName()+
                    " (connectionTag="+referenceTag+")";
      throw new ConfigurationException(sMsg,e);
    }
  } else {
    String sMsg = "A databaseReference has not been configured for connectionTag: "+
                  referenceTag;
    throw new ConfigurationException(sMsg);
  }
  return mc;
}
View Full Code Here


   

    // error check
    String errPfx = "gpt.xml: gptConfig/catalog/parameter/";
    if (this.documentUrlPattern.indexOf("{0}") == -1) {
      throw new ConfigurationException(errPfx+"@key=sitemap.documentUrlPattern must contain {0}");
    }
  }
View Full Code Here

    Object obj = cls.newInstance();
    if (obj instanceof DiscoveryQueryAdapter) {
      return (DiscoveryQueryAdapter)obj;
    } else {
      String sMsg = "The configured discoveryQueryAdapter parameter is invalid: "+className;
      throw new ConfigurationException(sMsg);
    }
  } catch (ConfigurationException t) {
    throw t;
  } catch (Throwable t) {
    String sMsg = "Error instantiating discovery query adapter: "+className;
    throw new ConfigurationException(sMsg,t);
  }
}
View Full Code Here

      if (obj instanceof LiveDataRendererFactoryBuilder) {
        LiveDataRendererFactoryBuilder builder = (LiveDataRendererFactoryBuilder) obj;
        return builder;
      } else {
        String sMsg = "The configured liveDataRendererFactoryBuilder parameter is invalid: "+className;
        throw new ConfigurationException(sMsg);
      }
    } catch (ConfigurationException t) {
      throw t;
    } catch (Throwable t) {
      String sMsg = "Error instantiating liveDataRendererFactoryBuilder: "+className;
      throw new ConfigurationException(sMsg, t);
    }
    }

  }
View Full Code Here

        Object obj = cls.newInstance();
        if (obj instanceof IProviderFactory) {
          return (IProviderFactory)obj;
        } else {
          String sMsg = "The configured "+key+" parameter is invalid: "+ className;
          throw new ConfigurationException(sMsg);
        }
      } catch (ConfigurationException t) {
        throw t;
      } catch (Throwable t) {
        String sMsg = "Error instantiating provider factory: " + className;
        throw new ConfigurationException(sMsg, t);
      }
    }
  }
View Full Code Here

      }
      tree.processTreeNode(context,root);
      return tree;
    } else {
      String msg = "Unable to locate <tree> root node within: "+relativePath;
      throw new ConfigurationException(msg);
    }
   
  }
View Full Code Here

      Object obj = cls.newInstance();
      if (obj instanceof TocTree) {
        return (TocTree)obj;
      } else {
        String msg = "The configured tree.className is invalid: "+className;
        throw new ConfigurationException(msg);
      }
    }
  }
View Full Code Here

   */
  public AsnIndexAdapter makeIndexAdapter(AsnContext context)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    if (!this.getEnabled()) {
      String msg = "The index is not enabled: "+this.getName();
      throw new ConfigurationException(msg);
    }
    String className = Val.chkStr(this.getIndexAdapterClass());
    if ((className.length() == 0) || className.equals(AsnIndexAdapter.class.getName())) {
      AsnIndexAdapter broker = new AsnIndexAdapter();
      broker.configure(this);
      return broker;
    } else {
      Class<?> cls = Class.forName(className);
      Object obj = cls.newInstance();
      if (obj instanceof AsnIndexAdapter) {
        AsnIndexAdapter broker = (AsnIndexAdapter)obj;
        broker.configure(this);
        return broker;
      } else {
        String msg = "The configured indexAdapterClass is invalid: "+ className;
        throw new ConfigurationException(msg);
      }
    }
  }
View Full Code Here

   */
  public void add(AsnOperation operation) {
    if (operation == null) {
      throw new IllegalArgumentException("The operation cannot be null.");
    } else if (operation.getSubject() == null) {
      throw new ConfigurationException("The operation.subject cannot be null.");
    } else if (operation.getPredicate() == null) {
      throw new ConfigurationException("The operation.predicate cannot be null.");
    } else if (operation.getAuthPolicy() == null) {
      throw new ConfigurationException("The operation.authPolicy cannot be null.");
    }
    this.operations.add(operation);
  }
View Full Code Here

 
    // ensure an authorization policy
    AsnOperation operation = context.getOperation();
    if (operation.getAuthPolicy() == null) {
      String msg = "An authorization policy was not configured.";
      throw new ConfigurationException(msg);
    }
   
    // check the user, ensure an authenticated user if required
    User user = context.getRequestContext().getUser();
    boolean userWasAuthenticated = false;
    if ((user != null) && user.getAuthenticationStatus().getWasAuthenticated()) {
      userWasAuthenticated = true;
    }
    if (operation.getAuthPolicy().getAuthenticationRequired() && !userWasAuthenticated) {
      throw new NotAuthorizedException("Not authorized.");
    }
   
    // determine the principals
    AsnPrincipals principals = null;
    boolean isWrite = false;
    if (action.equals(AsnAuthorizer.ACTION_CREATE)) {
      isWrite = true;
      principals = operation.getAuthPolicy().getCreatePrincipals();
      if (principals == null) {
        String msg = "Create principals were not configured.";
        throw new ConfigurationException(msg);
      }
     
    } else if (action.equals(AsnAuthorizer.ACTION_DELETE)) {
      isWrite = true;
      principals = operation.getAuthPolicy().getDeletePrincipals();
      if (principals == null) {
        String msg = "Delete principals were not configured.";
        throw new ConfigurationException(msg);
      }
     
    } else if (action.equals(AsnAuthorizer.ACTION_ENABLE) ||
               action.equals(AsnAuthorizer.ACTION_DISABLE)) {
      isWrite = true;
      principals = operation.getAuthPolicy().getEnableDisablePrincipals();
      if (principals == null) {
        String msg = "Enable/Disable principals were not configured.";
        throw new ConfigurationException(msg);
      }
     
    } else if (action.equals(AsnAuthorizer.ACTION_QUERY)) {
      principals = operation.getAuthPolicy().getQueryPrincipals();
      if (principals == null) {
        String msg = "Query principals were not configured.";
        throw new ConfigurationException(msg);
      }
     
    } else if (action.equals(AsnAuthorizer.ACTION_UPDATE)) {
      isWrite = true;
      principals = operation.getAuthPolicy().getQueryPrincipals();
      if (principals == null) {
        String msg = "Query principals were not configured.";
        throw new ConfigurationException(msg);
      }
    }
   
    // hard check to ensure an authenticated user for any modifications
    // (regardless of configuration)
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.context.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.