package org.kaaproject.kaa.server.verifiers.facebook.config;


import org.apache.avro.Schema;
import org.kaaproject.kaa.server.common.utils.CRC32Util;
import org.kaaproject.kaa.server.common.verifier.KaaUserVerifierConfig;
import org.kaaproject.kaa.server.common.verifier.UserVerifierConfig;
import org.kaaproject.kaa.server.verifiers.facebook.config.gen.FacebookAvroConfig;

@KaaUserVerifierConfig
public class FacebookVerifierConfig implements UserVerifierConfig {

    private static final String ORG_KAAPROJECT_KAA_SERVER_VERIFIERS_TRUSTFUL = "org.kaaproject.kaa.server.verifiers.facebook";

    @Override
    public int getId() {
        return CRC32Util.crc32(getName());
    }

    @Override
    public String getName() {
        return ORG_KAAPROJECT_KAA_SERVER_VERIFIERS_TRUSTFUL;
    }

    @Override
    public String getUserVerifierClass() {
        return "org.kaaproject.kaa.server.verifiers.trustful.TrustfulUserVerifier";
    }

    @Override
    public Schema getConfigSchema() {
        return FacebookAvroConfig.SCHEMA$;
    }
}

package org.kaaproject.kaa.server.verifiers.facebook.config;


import org.apache.avro.Schema;
import org.kaaproject.kaa.server.common.plugin.KaaPluginConfig;
import org.kaaproject.kaa.server.common.plugin.PluginConfig;
import org.kaaproject.kaa.server.common.plugin.PluginType;
import org.kaaproject.kaa.server.verifiers.facebook.config.gen.FacebookAvroConfig;

@KaaPluginConfig(pluginType = PluginType.USER_VERIFIER)
public class FacebookVerifierConfig implements PluginConfig {

    private static final String TRUSTFUL_VERIFIER_NAME = "Facebook verifier";

    @Override
    public String getPluginTypeName() {
        return TRUSTFUL_VERIFIER_NAME;
    }

    @Override
    public String getPluginClassName() {
        return "org.kaaproject.kaa.server.verifiers.facebook.FacebookUserVerifier";
    }

    @Override
    public Schema getPluginConfigSchema() {
        return FacebookAvroConfig.SCHEMA$;
    }
}

update FacebookVerifierConfig in accordance with PluginConfig interface