Package org.openxri.config

Examples of org.openxri.config.ServerConfig


    if (parentAuthority == null) throw new NullPointerException();
    if (! (parentAuthority instanceof DbAuthority)) throw new StoreNotFoundException("Parent authority is not from this store.");

    // check if the parent authority overrides the CREATE pipeline. if not, use the default.

    ServerConfig serverConfig = ServerConfigFactory.getSingleton();
    PipelineRegistry pipelineRegistry = (serverConfig == null) ? null : serverConfig.getPipelineRegistry();
    Pipeline createPipeline = null;

    String pipelineName = this.getAuthorityAttributes(parentAuthority).get(Pipeline.ATTRIBUTE_OVERRIDE_CREATE_PIPELINE);
    if (pipelineRegistry != null && pipelineName != null) createPipeline = pipelineRegistry.getPipelineByName(pipelineName);
    if (pipelineRegistry != null && createPipeline == null) createPipeline = pipelineRegistry.getDefaultCreatePipeline();
View Full Code Here


  @SuppressWarnings("unchecked")
  public Index() {

    this.setTitle(this.getString("title"));

    final ServerConfig openXRIConfig = ((OpenXRIAdminApplication) Application.get()).getOpenXRIServerConfig();
   
    // create and add components

    this.add(new Label("clazz", openXRIConfig.getClass().getName()));
   
    List<Object> keys = new ArrayList<Object> (openXRIConfig.getProperties().keySet());
   
    this.configEntriesListView = new ListView("configEntries", keys) {

      private static final long serialVersionUID = 4268418431817371342L;

      @Override
      protected void populateItem(ListItem item) {

        // create and add components

        String key = item.getModelObjectAsString();
        String value = openXRIConfig.getProperties().getProperty(key);

        item.add(new Label("configKey", new Model(key)));
        item.add(new Label("configValue", new Model(value)));
      }
    };
View Full Code Here

    }

    @Override
    protected void onSubmit() {

      ServerConfig serverConfig = ((OpenXRIAdminApplication) Application.get()).getOpenXRIServerConfig();
      URIMapper openXRIURIMapper = ((OpenXRIAdminApplication) Application.get()).getOpenXRIURIMapper();

      try {

        StringBuffer uri = new StringBuffer()
        .append("http://")
        .append(serverConfig.getHostName())
        .append(":")
        .append(serverConfig.getHostPort())
        .append(serverConfig.getServletPath());

        openXRIURIMapper.completeURI(uri, this.namespace);

        Index.this.completeResultFragment.setUri(uri.toString());
      } catch (Exception ex) {
View Full Code Here

    // find the class, invoke the constructor with a ServletContext and a Properties argument, then call the init() method.

    Class<?> clazz = classLoader.loadClass(className);

    Constructor<?> constructor = clazz.getConstructor(ServletContext.class, Properties.class);
    ServerConfig instance = (ServerConfig) constructor.newInstance(servletContext, properties);

    instance.init();

    // done

    log.debug("Successfully constructed ServerConfig implementation: " + className);
    return(instance);
View Full Code Here

  @SuppressWarnings("unchecked")
  public Index() {

    this.setTitle(this.getString("title"));

    ServerConfig openXRIConfig = ((OpenXRIAdminApplication) Application.get()).getOpenXRIServerConfig();
   
    // create and add components

    this.add(new Label("clazz", openXRIConfig.getClass().getName()));
   
    List<Object> keys = new ArrayList<Object> (openXRIConfig.getProperties().keySet());
   
    this.configEntriesListView = new ListView("configEntries", keys) {

      private static final long serialVersionUID = 4268418431817371342L;
View Full Code Here

    public ConfigForm(String id, String key) {

      super(id);

      ServerConfig openXRIConfig = ((OpenXRIAdminApplication) Application.get()).getOpenXRIServerConfig();
     
      // create and add components

      String value = openXRIConfig.getProperties().getProperty(key);

      this.configKey = new Label("configKey", new Model(key));
      this.configValue = new TextField("configValue", new Model(value));

      this.add(this.configKey);
View Full Code Here

    }

    @Override
    protected void onSubmit() {

      ServerConfig openXRIConfig = ((OpenXRIAdminApplication) Application.get()).getOpenXRIServerConfig();
     
      String key = this.configKey.getModelObjectAsString();
      String value = this.configValue.getModelObjectAsString();

      openXRIConfig.getProperties().setProperty(key, value);

      Index.this.info(Index.this.getString("updatesuccess"));
    }
View Full Code Here

    super(properties);
  }

  public void init() throws Exception {

    ServerConfig serverConfig = ServerConfigFactory.getSingleton();

    String httpPort = this.properties.getProperty(PROPERTIES_KEY_HTTPPORT, DEFAULT_HTTPPORT);
    String httpsPort = this.properties.getProperty(PROPERTIES_KEY_HTTPSPORT, DEFAULT_HTTPSPORT);
   
    String http = this.properties.getProperty(PROPERTIES_KEY_HTTP, DEFAULT_HTTP);
    if (Boolean.parseBoolean(http)) {

      StringBuffer buffer = new StringBuffer()
      .append("http://")
      .append(serverConfig.getHostName())
      .append(":")
      .append(httpPort)
      .append(serverConfig.getServletPath());

      this.httpURI = buffer.toString();
    }

    String https = this.properties.getProperty(PROPERTIES_KEY_HTTPS, DEFAULT_HTTPS);
    if (Boolean.parseBoolean(https)) {

      StringBuffer buffer = new StringBuffer()
      .append("https://")
      .append(serverConfig.getHostName())
      .append(":")
      .append(httpsPort)
      .append(serverConfig.getServletPath());

      this.httpsURI = buffer.toString();
    }

    String trust = this.properties.getProperty(PROPERTIES_KEY_TRUST, DEFAULT_TRUST);
View Full Code Here

          continue;
        }

        // check if the parent authority overrides the LOOKUP pipeline. if not, use the default.

        ServerConfig serverConfig = ServerConfigFactory.getSingleton();
        PipelineRegistry pipelineRegistry = (serverConfig == null) ? null : serverConfig.getPipelineRegistry();
        Pipeline lookupPipeline = null;

        if (this.store instanceof StoreAttributable) {

          StoreAttributable storeAttributable = (StoreAttributable) this.store;
View Full Code Here

          continue;
        }

        // check if the authority overrides the LOOKUP pipeline. if not, use the default.

        ServerConfig serverConfig = ServerConfigFactory.getSingleton();
        PipelineRegistry pipelineRegistry = (serverConfig == null) ? null : serverConfig.getPipelineRegistry();
        Pipeline lookupPipeline = null;

        if (this.store instanceof StoreAttributable) {

          StoreAttributable storeAttributable = (StoreAttributable) this.store;
View Full Code Here

TOP

Related Classes of org.openxri.config.ServerConfig

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.