/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.tatsuyafw.camel.component.fluentd;

import org.apache.camel.RuntimeCamelException;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriPath;

import java.net.URI;
import java.util.Optional;

public class FluentdConfiguration implements Cloneable {

    public static final int DEFAULT_PORT = 24224;

    @UriPath @Metadata(required = "true")
    private String host;
    @UriPath @Metadata(defaultValue = "" + DEFAULT_PORT)
    private int port;
    @UriPath @Metadata(defaultValue = "")
    private String tagPrefix;


    /**
     * Returns a copy of this configuration
     */
    public FluentdConfiguration copy() {
        try {
            return (FluentdConfiguration) clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeCamelException(e);
        }
    }

    public void configure(URI uri) {
        Optional<String> hostOpt = Optional.ofNullable(uri.getHost());
        hostOpt.ifPresent(hostname -> setHost(host));

        Optional<Integer> portOpt = Optional.ofNullable(uri.getPort());
        portOpt.ifPresent(port -> setPort(port));
    }

    public String getHost() {
        return this.host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return this.port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    @Override
    public String toString() {
        return "FluentdConfiguration[hostname=" + host + ":" + port + "]";
    }
}

@@ -937,16 +937,54 @@
 tadata;%0A
+import org.apache.camel.spi.UriParam;%0A
 import o
@@ -1343,27 +1343,8 @@
 data
-(defaultValue = %22%22)
 %0A   
@@ -1370,16 +1370,53 @@
 Prefix;%0A
+    @UriParam%0A    private String tag;
 %0A%0A    /*
@@ -1417,17 +1417,16 @@
     /**%0A
- 
     * Re
@@ -1460,17 +1460,16 @@
 uration%0A
- 
     */%0A 
@@ -1971,16 +1971,163 @@
 (port));
+%0A%0A        Optional%3CString%3E tagPrefixOpt = Optional.ofNullable(uri.getPath());%0A        tagPrefixOpt.ifPresent(tagPrefix -%3E setTagPrefix(tagPrefix));
 %0A    %7D%0A%0A
@@ -2386,24 +2386,318 @@
 ort;%0A    %7D%0A%0A
+    public String getTagPrefix() %7B%0A        return this.tagPrefix;%0A    %7D%0A%0A    public void setTagPrefix(String tagPrefix) %7B%0A        this.tagPrefix = tagPrefix;%0A    %7D%0A%0A    public String getTag() %7B%0A        return this.tag;%0A    %7D%0A%0A    public void setTag(String tag) %7B%0A        this.tag = tag;%0A    %7D%0A%0A
     @Overrid

Add tagPrefix UriParam