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

pl.edu.icm.unity.stdext.credential.sms.SMSAuthnTemplateDef Maven / Gradle / Ivy

Go to download

Standard plugins which are distributed with the system: attribute syntaxes, identity types, credentials

There is a newer version: 4.0.2
Show newest version
/*
 * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
 * See LICENCE file for licensing information.
 */
package pl.edu.icm.unity.stdext.credential.sms;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

import pl.edu.icm.unity.base.msgtemplates.MessageTemplateDefinition;
import pl.edu.icm.unity.base.msgtemplates.MessageTemplateVariable;
import pl.edu.icm.unity.base.notifications.CommunicationTechnology;

/**
 * Defines template used for sending authn sms code by mobile.
 * @author P. Piernik
 * 
 */
@Component
public class SMSAuthnTemplateDef implements MessageTemplateDefinition
{
	public static final String NAME = "SMSAuthn";
	
	public static final String VAR_USER = "user";
	public static final String VAR_CODE = "code";
	
	public Map getVariables()
	{
		Map vars = new HashMap();
		vars.put(VAR_USER, new MessageTemplateVariable(VAR_USER, "MessageTemplateConsumer.SMSAuthn.var.user", false));
		vars.put(VAR_CODE, new MessageTemplateVariable(VAR_CODE, "MessageTemplateConsumer.SMSAuthn.var.code", false));
		return vars;
	}

	@Override
	public String getDescriptionKey()
	{
		return "MessageTemplateConsumer.SMSAuthn.desc";
	}

	@Override
	public String getName()
	{
		return NAME;
	}
	
	@Override
	public EnumSet getCompatibleTechnologies()
	{
		 return EnumSet.of(CommunicationTechnology.SMS);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy