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

cicada.authorization.UserAuthClient Maven / Gradle / Ivy

There is a newer version: 1.0.6.6
Show newest version
package cicada.authorization;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import cicada.authorization.config.GetUserIdRet;
import cicada.authorization.config.UserSessionService;
import cicada.core.BeanFactory;

public class UserAuthClient
{
	static final Logger log = LoggerFactory.getLogger(UserAuthClient.class);
	static final byte[] lock = new byte[1];
	
	public static GetUserIdRet getUserId(String sessionId)
	{
		UserSessionService.Iface iface = BeanFactory.getBeanByType(UserSessionService.Iface.class);
		try
		{
			if (iface != null)
			{
				synchronized (lock)
				{
					GetUserIdRet result = iface.GetUserId(sessionId);
					return result;
				}
			}
		}
		catch (Exception e)
		{
			log.error("cicada.authorization 版块获取thrift 服务错误:{},详细信息:{}", e.getMessage(), e.getStackTrace());
		}
		log.error("cicada.authorization 版块获取thrift 服务错误,返回空值");
		return null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy