Example usage for com.liferay.portal.kernel.exception DuplicateOpenIdException DuplicateOpenIdException

List of usage examples for com.liferay.portal.kernel.exception DuplicateOpenIdException DuplicateOpenIdException

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.exception DuplicateOpenIdException DuplicateOpenIdException.

Prototype

public DuplicateOpenIdException(Throwable cause) 

Source Link

Usage

From source file:com.liferay.users.admin.web.internal.portlet.action.UpdateContactInformationMVCActionCommand.java

License:Open Source License

private void _validateOpenId(long companyId, long userId, String openId) throws Exception {

    if (Validator.isNull(openId)) {
        return;//  ww w.ja  v a  2s.  c  o m
    }

    User user = _userLocalService.fetchUserByOpenId(companyId, openId);

    if ((user != null) && (user.getUserId() != userId)) {
        throw new DuplicateOpenIdException("{userId=" + userId + "}");
    }
}