Codota Logo
Ruler
Code IndexAdd Codota to your IDE (free)

How to use
Ruler
in
io.vertx.zero.atom

Best Java code snippets using io.vertx.zero.atom.Ruler (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: silentbalanceyh/vertx-zero

static <R> R init(
    final Annal logger,
    final String key,
    final JsonObject config,
    final Function<JsonObject, R> executor) {
  Fn.outUp(() -> Ruler.verify(key, config), logger);
  return executor.apply(config);
}
origin: silentbalanceyh/vertx-zero

/**
 * Verify data for each up.god.file
 *
 * @param file
 * @param data
 * @throws ZeroException
 */
public static void verify(
    final String file,
    final JsonArray data)
    throws ZeroException {
  Fn.shuntZero(() -> {
    // 1. Rule for json array
    final JsonObject rule = getRule(file);
    verifyItem(data, rule);
    // 2. For json item
    Ut.etJArray(data, (value, field) -> {
      // 3. Value = JsonObject, identify if extension.
      final String filename = file + Strings.DOT + field;
      if (Ut.isJObject(value)) {
        // JsonObject
        verify(filename, (JsonObject) value);
      } else if (Ut.isJArray(value)) {
        // JsonArray
        verify(filename, (JsonArray) value);
      }
    });
  }, file, data);
}
origin: silentbalanceyh/vertx-zero

  private CircuitBreakerOptions visit(final JsonObject data)
      throws ZeroException {
    LOGGER.info(Info.INF_B_VERIFY, CIRCUIT, "Circuit", data.encode());
    Ruler.verify("circuit", data);
    return new CircuitBreakerOptions(data);
  }
}
origin: cn.vertxup/vertx-co

/**
 * Verify data for each up.god.file
 *
 * @param file
 * @param data
 * @throws ZeroException
 */
public static void verify(
    final String file,
    final JsonArray data)
    throws ZeroException {
  Fn.shuntZero(() -> {
    // 1. Rule for json array
    final JsonObject rule = getRule(file);
    verifyItem(data, rule);
    // 2. For json item
    Ut.etJArray(data, (value, field) -> {
      // 3. Value = JsonObject, identify if extension.
      final String filename = file + Strings.DOT + field;
      if (Ut.isJObject(value)) {
        // JsonObject
        verify(filename, (JsonObject) value);
      } else if (Ut.isJArray(value)) {
        // JsonArray
        verify(filename, (JsonArray) value);
      }
    });
  }, file, data);
}
origin: cn.vertxup/vertx-up

  private CircuitBreakerOptions visit(final JsonObject data)
      throws ZeroException {
    LOGGER.info(Info.INF_B_VERIFY, CIRCUIT, "Circuit", data.encode());
    Ruler.verify("circuit", data);
    return new CircuitBreakerOptions(data);
  }
}
origin: cn.vertxup/vertx-co

Fn.shuntZero(() -> {
  final JsonObject rule = getRule(file);
  verifyItem(data, rule);
        if (Ut.isJObject(value)) {
          verify(filename, (JsonObject) value);
        } else if (Ut.isJArray(value)) {
          verify(filename, (JsonArray) value);
origin: cn.vertxup/vertx-up

private ConcurrentMap<Integer, HttpServerOptions> visit(final JsonArray serverData)
    throws ZeroException {
  this.getLogger().info(Info.INF_B_VERIFY, KEY, this.type, serverData.encode());
  Ruler.verify(KEY, serverData);
  final ConcurrentMap<Integer, HttpServerOptions> map =
      new ConcurrentHashMap<>();
  this.extract(serverData, map);
  this.getLogger().info(Info.INF_A_VERIFY, KEY, this.type, map.keySet());
  return map;
}
origin: silentbalanceyh/vertx-zero

Fn.shuntZero(() -> {
  final JsonObject rule = getRule(file);
  verifyItem(data, rule);
        if (Ut.isJObject(value)) {
          verify(filename, (JsonObject) value);
        } else if (Ut.isJArray(value)) {
          verify(filename, (JsonArray) value);
origin: silentbalanceyh/vertx-zero

private ConcurrentMap<Integer, HttpServerOptions> visit(final JsonArray serverData)
    throws ZeroException {
  this.getLogger().info(Info.INF_B_VERIFY, KEY, this.type, serverData.encode());
  Ruler.verify(KEY, serverData);
  final ConcurrentMap<Integer, HttpServerOptions> map =
      new ConcurrentHashMap<>();
  this.extract(serverData, map);
  this.getLogger().info(Info.INF_A_VERIFY, KEY, this.type, map.keySet());
  return map;
}
origin: silentbalanceyh/vertx-zero

private ConcurrentMap<Integer, HttpServerOptions> visit(final JsonArray serverData)
    throws ZeroException {
  this.getLogger().info(Info.INF_B_VERIFY, KEY, this.getType(), serverData.encode());
  Ruler.verify(KEY, serverData);
  final ConcurrentMap<Integer, HttpServerOptions> map =
      new ConcurrentHashMap<>();
  this.extract(serverData, map);
  this.getLogger().info(Info.INF_A_VERIFY, KEY, this.getType(), map.keySet());
  return map;
}
origin: cn.vertxup/vertx-up

private ConcurrentMap<Integer, HttpServerOptions> visit(final JsonArray serverData)
    throws ZeroException {
  this.getLogger().info(Info.INF_B_VERIFY, KEY, this.getType(), serverData.encode());
  Ruler.verify(KEY, serverData);
  final ConcurrentMap<Integer, HttpServerOptions> map =
      new ConcurrentHashMap<>();
  this.extract(serverData, map);
  this.getLogger().info(Info.INF_A_VERIFY, KEY, this.getType(), map.keySet());
  return map;
}
origin: silentbalanceyh/vertx-zero

  @Override
  public Cliff transform(final JsonObject input) {
    Fn.outUp(() -> Ruler.verify("wall-jwt", input), LOGGER);
    final Cliff cliff = new Cliff();
    cliff.setType(WallType.JWT);
    cliff.setConfig(input.getJsonObject("config"));
    return cliff;
  }
}
origin: cn.vertxup/vertx-up

@Override
public ConcurrentMap<String, VertxOptions> visit(final String... keys)
    throws ZeroException {
  // 1. Must be the first line, fixed position.
  Ut.ensureEqualLength(this.getClass(), 0, (Object[]) keys);
  // 2. Visit the node for vertx
  final JsonObject data = this.NODE.read();
  // 3. Vertx node validation.
  final JsonObject vertxData = data.getJsonObject(KEY);
  LOGGER.info(Info.INF_B_VERIFY, KEY, this.getClass().getSimpleName(), vertxData);
  Fn.shuntZero(() -> Ruler.verify(KEY, vertxData), vertxData);
  // 4. Set cluster options
  this.clusterOptions = this.clusterTransformer.transform(data.getJsonObject(YKEY_CLUSTERED));
  // 5. Transfer Data
  return this.visit(vertxData.getJsonArray(YKEY_INSTANCE));
}
origin: cn.vertxup/vertx-up

  @Override
  public Cliff transform(final JsonObject input) {
    Fn.outUp(() -> Ruler.verify("wall-jwt", input), LOGGER);
    final Cliff cliff = new Cliff();
    cliff.setType(WallType.JWT);
    cliff.setConfig(input.getJsonObject("config"));
    return cliff;
  }
}
origin: silentbalanceyh/vertx-zero

  @Override
  public Cliff transform(final JsonObject input) {
    Fn.outUp(() -> Ruler.verify("wall-mongo", input), LOGGER);
    final Cliff cliff = new Cliff();
    cliff.setType(WallType.MONGO);
    cliff.setConfig(input.getJsonObject("config"));
    return cliff;
  }
}
origin: silentbalanceyh/vertx-zero

@Override
public ConcurrentMap<String, VertxOptions> visit(final String... keys)
    throws ZeroException {
  // 1. Must be the first line, fixed position.
  Ut.ensureEqualLength(this.getClass(), 0, (Object[]) keys);
  // 2. Visit the node for vertx
  final JsonObject data = this.NODE.read();
  // 3. Vertx node validation.
  final JsonObject vertxData = data.getJsonObject(KEY);
  LOGGER.info(Info.INF_B_VERIFY, KEY, this.getClass().getSimpleName(), vertxData);
  Fn.shuntZero(() -> Ruler.verify(KEY, vertxData), vertxData);
  // 4. Set cluster options
  this.clusterOptions = this.clusterTransformer.transform(data.getJsonObject(YKEY_CLUSTERED));
  // 5. Transfer Data
  return this.visit(vertxData.getJsonArray(YKEY_INSTANCE));
}
origin: cn.vertxup/vertx-up

  @Override
  public Cliff transform(final JsonObject input) {
    Fn.outUp(() -> Ruler.verify("wall-mongo", input), LOGGER);
    final Cliff cliff = new Cliff();
    cliff.setType(WallType.MONGO);
    cliff.setConfig(input.getJsonObject("config"));
    return cliff;
  }
}
origin: silentbalanceyh/vertx-zero

public TpConfig(final String key, final String rule) {
  final JsonObject config = TP.read();
  // Check up exception for key
  Fn.outUp(null == config || !config.containsKey(key),
      LOGGER, DynamicKeyMissingException.class,
      this.getClass(), key, config);
  // Check up exception for JsonObject
  final Class<?> type = config.getValue(key).getClass();
  Fn.outUp(JsonObject.class != type,
      LOGGER, DynamicConfigTypeException.class,
      this.getClass(), key, type);
  // Extract config information.
  final JsonObject raw = config.getJsonObject(key);
  this.endpoint = Fn.getNull(null, () -> raw.getString(KEY_ENDPOINT), raw.getValue(KEY_ENDPOINT));
  this.config = Fn.getNull(new JsonObject(), () -> raw.getJsonObject(KEY_CONFIG), raw.getValue(KEY_CONFIG));
  // Verify the config data.
  if (null != rule) {
    Fn.outUp(() -> Fn.shuntZero(() -> Ruler.verify(rule, this.config), this.config), LOGGER);
  }
}
origin: silentbalanceyh/vertx-zero

private ConcurrentMap<Integer, ServidorOptions> visit(final JsonArray serverData)
    throws ZeroException {
  LOGGER.info(Info.INF_B_VERIFY, KEY, ServerType.IPC, serverData.encode());
  Ruler.verify(KEY, serverData);
  final ConcurrentMap<Integer, ServidorOptions> map =
      new ConcurrentHashMap<>();
  Ut.itJArray(serverData, JsonObject.class, (item, index) -> {
    if (this.isServer(item)) {
      // 1. Extract port
      final int port = this.extractPort(item.getJsonObject(YKEY_CONFIG));
      // 2. Convert JsonObject to HttpServerOptions
      final ServidorOptions options = this.transformer.transform(item);
      Fn.safeNull(() -> {
        // 3. Add to map;
        map.put(port, options);
      }, port, options);
    }
  });
  LOGGER.info(Info.INF_A_VERIFY, KEY, ServerType.IPC, map.keySet());
  return map;
}
origin: cn.vertxup/vertx-up

static Record getRecord(final JsonObject config) {
  Fn.outUp(() -> Fn.shuntZero(() -> Ruler.verify(Key.RULE_KEY, config), config),
      LOGGER);
io.vertx.zero.atomRuler

Javadoc

Ruler checking for json object / json array

Most used methods

  • verify
    Verify data for each up.god.file
  • getRule
  • verifyItem
    JsonObject

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • findViewById (Activity)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now