Examples of OGlobalConfiguration


Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

        obj = rootClass.cast(unmarshaller.unmarshal(new StringReader(configurationText)));
        obj.location = "memory";
      }

      // AUTO CONFIGURE SYSTEM CONFIGURATION
      OGlobalConfiguration config;
      if (obj.properties != null)
        for (OServerEntryConfiguration prop : obj.properties) {
          try {
            config = OGlobalConfiguration.findByKey(prop.name);
            if (config != null) {
              config.setValue(prop.value);
            }
          } catch (Exception e) {
          }
        }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

      data.commandInfo = "Get config";

      checkServerAccess("server.config.get");

      final String key = channel.readString();
      final OGlobalConfiguration cfg = OGlobalConfiguration.findByKey(key);
      String cfgValue = cfg != null ? cfg.getValueAsString() : "";

      channel.acquireExclusiveLock();
      try {
        sendOk(lastClientTxId);
        channel.writeString(cfgValue);
      } finally {
        channel.releaseExclusiveLock();
      }
      break;
    }

    case OChannelBinaryProtocol.REQUEST_CONFIG_SET: {
      data.commandInfo = "Get config";

      checkServerAccess("server.config.set");

      final String key = channel.readString();
      final String value = channel.readString();
      final OGlobalConfiguration cfg = OGlobalConfiguration.findByKey(key);
      if (cfg != null)
        cfg.setValue(value);

      channel.acquireExclusiveLock();
      try {
        sendOk(lastClientTxId);
      } finally {
        channel.releaseExclusiveLock();
      }
      break;
    }

    case OChannelBinaryProtocol.REQUEST_CONFIG_LIST: {
      data.commandInfo = "List config";

      checkServerAccess("server.config.get");

      channel.acquireExclusiveLock();
      try {
        sendOk(lastClientTxId);

        channel.writeShort((short) OGlobalConfiguration.values().length);
        for (OGlobalConfiguration cfg : OGlobalConfiguration.values()) {
          channel.writeString(cfg.getKey());
          channel.writeString(cfg.getValueAsString() != null ? cfg.getValueAsString() : "");
        }
      } finally {
        channel.releaseExclusiveLock();
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

  }

  @ConsoleCommand(description = "Return the value of a configuration value")
  public void configGet(@ConsoleParameter(name = "config-name", description = "Name of the configuration") final String iConfigName)
      throws IOException {
    final OGlobalConfiguration config = OGlobalConfiguration.findByKey(iConfigName);
    if (config == null)
      throw new IllegalArgumentException("Configuration variable '" + iConfigName + "' wasn't found");

    final String value;
    if (serverAdmin != null) {
      value = serverAdmin.getGlobalConfiguration(config);
      out.print("\nRemote configuration: ");
    } else {
      value = config.getValueAsString();
      out.print("\nLocal configuration: ");
    }
    out.println(iConfigName + " = " + value);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

  @ConsoleCommand(description = "Change the value of a configuration value")
  public void configSet(
      @ConsoleParameter(name = "config-name", description = "Name of the configuration") final String iConfigName,
      @ConsoleParameter(name = "config-value", description = "Value to set") final String iConfigValue) throws IOException {
    final OGlobalConfiguration config = OGlobalConfiguration.findByKey(iConfigName);
    if (config == null)
      throw new IllegalArgumentException("Configuration variable '" + iConfigName + "' wasn't found");

    if (serverAdmin != null) {
      serverAdmin.setGlobalConfiguration(config, iConfigValue);
      out.println("\nRemote configuration value changed correctly");
    } else {
      config.setValue(iConfigValue);
      out.println("\nLocal configuration value changed correctly");
    }
    out.println();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

  }

  @ConsoleCommand(description = "Return the value of a configuration value")
  public void configGet(@ConsoleParameter(name = "config-name", description = "Name of the configuration") final String iConfigName)
      throws IOException {
    final OGlobalConfiguration config = OGlobalConfiguration.findByKey(iConfigName);
    if (config == null)
      throw new IllegalArgumentException("Configuration variable '" + iConfigName + "' wasn't found");

    final String value;
    if (serverAdmin != null) {
      value = serverAdmin.getGlobalConfiguration(config);
      out.print("\nRemote configuration: ");
    } else {
      value = config.getValueAsString();
      out.print("\nLocal configuration: ");
    }
    out.println(iConfigName + " = " + value);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

  @ConsoleCommand(description = "Change the value of a configuration value")
  public void configSet(
      @ConsoleParameter(name = "config-name", description = "Name of the configuration") final String iConfigName,
      @ConsoleParameter(name = "config-value", description = "Value to set") final String iConfigValue) throws IOException {
    final OGlobalConfiguration config = OGlobalConfiguration.findByKey(iConfigName);
    if (config == null)
      throw new IllegalArgumentException("Configuration variable '" + iConfigName + "' wasn't found");

    if (serverAdmin != null) {
      serverAdmin.setGlobalConfiguration(config, iConfigValue);
      out.println("\nRemote configuration value changed correctly");
    } else {
      config.setValue(iConfigValue);
      out.println("\nLocal configuration value changed correctly");
    }
    out.println();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

        obj = rootClass.cast(unmarshaller.unmarshal(new StringReader(configurationText)));
        obj.location = "memory";
      }

      // AUTO CONFIGURE SYSTEM CONFIGURATION
      OGlobalConfiguration config;
      if (obj.properties != null)
        for (OServerEntryConfiguration prop : obj.properties) {
          try {
            config = OGlobalConfiguration.findByKey(prop.name);
            if (config != null) {
              config.setValue(prop.value);
            }
          } catch (Exception e) {
          }
        }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

        obj = rootClass.cast(unmarshaller.unmarshal(new StringReader(configurationText)));
        obj.location = "memory";
      }

      // AUTO CONFIGURE SYSTEM CONFIGURATION
      OGlobalConfiguration config;
      for (OServerEntryConfiguration prop : obj.properties) {
        try {
          config = OGlobalConfiguration.findByKey(prop.name);
          if (config != null) {
            config.setValue(prop.value);
          }
        } catch (Exception e) {
        }
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

      data.commandInfo = "Get config";

      checkServerAccess("server.config.get");

      final String key = channel.readString();
      final OGlobalConfiguration cfg = OGlobalConfiguration.findByKey(key);
      String cfgValue = cfg != null ? cfg.getValueAsString() : "";

      sendOk(lastClientTxId);
      channel.writeString(cfgValue);
      break;
    }

    case OChannelBinaryProtocol.REQUEST_CONFIG_SET: {
      data.commandInfo = "Get config";

      checkServerAccess("server.config.set");

      final String key = channel.readString();
      final String value = channel.readString();
      final OGlobalConfiguration cfg = OGlobalConfiguration.findByKey(key);
      if (cfg != null)
        cfg.setValue(value);

      sendOk(lastClientTxId);
      break;
    }

    case OChannelBinaryProtocol.REQUEST_CONFIG_LIST: {
      data.commandInfo = "List config";

      checkServerAccess("server.config.get");

      sendOk(lastClientTxId);

      channel.writeShort((short) OGlobalConfiguration.values().length);
      for (OGlobalConfiguration cfg : OGlobalConfiguration.values()) {
        channel.writeString(cfg.getKey());
        channel.writeString(cfg.getValueAsString() != null ? cfg.getValueAsString() : "");
      }

      break;
    }
View Full Code Here

Examples of com.orientechnologies.orient.core.config.OGlobalConfiguration

      data.commandInfo = "Get config";

      checkServerAccess("server.config.get");

      final String key = channel.readString();
      final OGlobalConfiguration cfg = OGlobalConfiguration.findByKey(key);
      String cfgValue = cfg != null ? cfg.getValueAsString() : "";

      channel.acquireExclusiveLock();
      try {
        sendOk(lastClientTxId);
        channel.writeString(cfgValue);
      } finally {
        channel.releaseExclusiveLock();
      }
      break;
    }

    case OChannelBinaryProtocol.REQUEST_CONFIG_SET: {
      data.commandInfo = "Get config";

      checkServerAccess("server.config.set");

      final String key = channel.readString();
      final String value = channel.readString();
      final OGlobalConfiguration cfg = OGlobalConfiguration.findByKey(key);
      if (cfg != null)
        cfg.setValue(value);

      channel.acquireExclusiveLock();
      try {
        sendOk(lastClientTxId);
      } finally {
        channel.releaseExclusiveLock();
      }
      break;
    }

    case OChannelBinaryProtocol.REQUEST_CONFIG_LIST: {
      data.commandInfo = "List config";

      checkServerAccess("server.config.get");

      channel.acquireExclusiveLock();
      try {
        sendOk(lastClientTxId);

        channel.writeShort((short) OGlobalConfiguration.values().length);
        for (OGlobalConfiguration cfg : OGlobalConfiguration.values()) {
          channel.writeString(cfg.getKey());
          channel.writeString(cfg.getValueAsString() != null ? cfg.getValueAsString() : "");
        }
      } finally {
        channel.releaseExclusiveLock();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.