All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bizmda.bizsip.integrator.config.SinksConfig Maven / Gradle / Ivy

There is a newer version: 1.0.0.Beta9
Show newest version
package com.bizmda.bizsip.integrator.config;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 史正烨
 */
@Slf4j
@Component
@Data
@ConfigurationProperties(prefix = "bizsip")
public class SinksConfig {
    private List> sinks;
    private Map> sinkMap = null;

    public Map getServerAdaptor(String id) {
        if (this.sinkMap == null) {
            this.setupSinkMap();
        }
        return this.sinkMap.get(id);
    }

    private void setupSinkMap() {
        log.info("serverAdaptor:{}",this.sinks);
        this.sinkMap = new HashMap<>();
        for (Map map:this.sinks) {
            this.sinkMap.put((String)map.get("id"),map);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy