/*-
 * ~~~~~~licensing~~~~~~
 * system-group-component
 * ==========
 * Copyright (C) 2020 - 2021 EmDev LLC
 * ==========
 * Licensed 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.
 * ~~~~~~/licensing~~~~~~
 */
package ru.entaxy.esb.system.groups.component;

import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.apache.camel.support.DefaultEndpoint;

@UriEndpoint(
        scheme = "system-group",
        title = "System",
        syntax = "system-group:systemName",
        label = "custom",
        producerOnly = true)
public class SystemGroupEndpoint extends DefaultEndpoint {

    @UriPath
    @Metadata(required = true)
    private String systemName;
    @UriParam
    private String preferredConnector = null;

    public SystemGroupEndpoint() {
    }

    public SystemGroupEndpoint(String uri, SystemGroupComponent component) {
        super(uri, component);
    }

    public Producer createProducer() throws Exception {
        return new SystemGroupProducer(this);
    }

    public Consumer createConsumer(Processor processor) throws Exception {
        return null;
    }

    public boolean isSingleton() {
        return true;
    }

    public String getSystemName() {
        return systemName;
    }

    public void setSystemName(String systemName) {
        this.systemName = systemName;
    }

    public String getPreferredConnector() {
        return preferredConnector;
    }

    public void setPreferredConnector(String preferredConnector) {
        this.preferredConnector = preferredConnector;
    }

}
