當前位置: 首頁>>代碼示例>>Java>>正文


Java FunctionDescriptor類代碼示例

本文整理匯總了Java中org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor的典型用法代碼示例。如果您正苦於以下問題:Java FunctionDescriptor類的具體用法?Java FunctionDescriptor怎麽用?Java FunctionDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FunctionDescriptor類屬於org.graylog.plugins.pipelineprocessor.ast.functions包,在下文中一共展示了FunctionDescriptor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Map<String, String>> descriptor() {
    //noinspection unchecked
    return FunctionDescriptor.<Map<String, String>>builder()
            .name(NAME)
            .returnType((Class<? extends Map<String, String>>) new TypeLiteral<Map<String, String>>() {}.getRawType())
            .params(valueParam,
                    splitParam,
                    valueSplitParam,
                    ignoreEmptyValuesParam,
                    allowDupeKeysParam,
                    duplicateHandlingParam,
                    trimCharactersParam,
                    trimValueCharactersParam
            )
            .description("Extracts key/value pairs from a string")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:19,代碼來源:KeyValue.java

示例2: commonFunctions

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
protected static HashMap<String, Function<?>> commonFunctions() {
    final HashMap<String, Function<?>> functions = Maps.newHashMap();
    functions.put("trigger_test", new AbstractFunction<Void>() {
        @Override
        public Void evaluate(FunctionArgs args, EvaluationContext context) {
            actionsTriggered.set(true);
            return null;
        }

        @Override
        public FunctionDescriptor<Void> descriptor() {
            return FunctionDescriptor.<Void>builder()
                    .name("trigger_test")
                    .returnType(Void.class)
                    .params(of())
                    .build();
        }
    });
    return functions;
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:21,代碼來源:BaseParserTest.java

示例3: exitFunctionCall

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public void exitFunctionCall(RuleLangParser.FunctionCallContext ctx) {
    final FunctionExpression expr = (FunctionExpression) parseContext.expressions().get(ctx);
    final FunctionDescriptor<?> descriptor = expr.getFunction().descriptor();
    final FunctionArgs args = expr.getArgs();
    for (ParameterDescriptor p : descriptor.params()) {
        final Expression argExpr = args.expression(p.name());
        if (argExpr != null && !p.type().isAssignableFrom(argExpr.getType())) {
            parseContext.addError(new IncompatibleArgumentType(ctx, expr, p, argExpr));
        }
    }
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:13,代碼來源:PipelineRuleParser.java

示例4: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Void> descriptor() {
    return FunctionDescriptor.<Void>builder()
            .name(NAME)
            .returnType(Void.class)
            .params(of(valueParam) )
            .description("Print any passed value as string in the graylog-server log. Note that this will only appear in the " +
                    "log of the graylog-server node that is processing the message you are trying to debug.")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:11,代碼來源:Debug.java

示例5: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Boolean> descriptor() {
    return FunctionDescriptor.<Boolean>builder()
            .name(NAME)
            .returnType(Boolean.class)
            .params(of(
                    cidrParam,
                    ipParam))
            .description("Checks if an IP address matches a CIDR subnet mask")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:12,代碼來源:CidrMatch.java

示例6: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<IpAddress> descriptor() {
    return FunctionDescriptor.<IpAddress>builder()
            .name(NAME)
            .returnType(IpAddress.class)
            .params(of(
                    ipParam,
                    defaultParam
            ))
            .description("Converts a value to an IPAddress using its string representation")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:13,代碼來源:IpAddressConversion.java

示例7: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Boolean> descriptor() {
    return FunctionDescriptor.<Boolean>builder()
            .name(NAME)
            .returnType(Boolean.class)
            .params(of(valueParam))
            .description("Checks whether a value is 'null'")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:10,代碼來源:IsNull.java

示例8: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Boolean> descriptor() {
    return FunctionDescriptor.<Boolean>builder()
            .name(NAME)
            .returnType(Boolean.class)
            .params(of(
                    idParam,
                    nameParam))
            .description("Checks if a message arrived on a given input")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:12,代碼來源:FromInput.java

示例9: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<DateTime> descriptor() {
    return FunctionDescriptor.<DateTime>builder()
            .name(getName())
            .returnType(DateTime.class)
            .params(ImmutableList.<ParameterDescriptor>builder()
                            .addAll(params())
                            .add(timeZoneParam)
                            .build())
            .description(description())
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:13,代碼來源:TimezoneAwareFunction.java

示例10: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<String> descriptor() {
    return FunctionDescriptor.<String>builder()
            .name(NAME)
            .returnType(String.class)
            .params(of(value, format, timeZoneParam))
            .description("Formats a date using the given format string")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:10,代碼來源:FormatDate.java

示例11: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Period> descriptor() {
    return FunctionDescriptor.<Period>builder()
            .name(NAME)
            .description("Parses a ISO 8601 period from the specified string.")
            .pure(true)
            .returnType(Period.class)
            .params(value)
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:11,代碼來源:PeriodParseFunction.java

示例12: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Period> descriptor() {
    return FunctionDescriptor.<Period>builder()
            .name(getName())
            .description(getDescription())
            .pure(true)
            .returnType(Period.class)
            .params(value)
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:11,代碼來源:AbstractPeriodComponentFunction.java

示例13: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<String> descriptor() {
    return FunctionDescriptor.<String>builder()
            .name(getName())
            .returnType(String.class)
            .params(of(
                    valueParam)
            )
            .description(description())
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:12,代碼來源:SingleArgStringFunction.java

示例14: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<Map<String, Object>> descriptor() {
    //noinspection unchecked
    return FunctionDescriptor.<Map<String, Object>>builder()
            .name(NAME)
            .returnType((Class<? extends Map<String, Object>>) new TypeLiteral<Map<String, Object>>() {}.getRawType())
            .params(of(
                    jsonParam,
                    pathsParam
            ))
            .description("Selects a map of fields containing the result of their JsonPath expressions")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:14,代碼來源:SelectJsonPath.java

示例15: descriptor

import org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor; //導入依賴的package包/類
@Override
public FunctionDescriptor<JsonNode> descriptor() {
    return FunctionDescriptor.<JsonNode>builder()
            .name(NAME)
            .returnType(JsonNode.class)
            .params(of(
                    valueParam
            ))
            .description("Parses a string as a JSON tree")
            .build();
}
 
開發者ID:Graylog2,項目名稱:graylog-plugin-pipeline-processor,代碼行數:12,代碼來源:JsonParse.java


注:本文中的org.graylog.plugins.pipelineprocessor.ast.functions.FunctionDescriptor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。