Example usage for com.liferay.portal.kernel.lock Lock getUserUuid

List of usage examples for com.liferay.portal.kernel.lock Lock getUserUuid

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.lock Lock getUserUuid.

Prototype

public String getUserUuid();

Source Link

Usage

From source file:com.liferay.exportimport.lar.PortletDataContextImpl.java

License:Open Source License

@Override
public void importLocks(Class<?> clazz, String key, String newKey) throws PortalException {

    Lock lock = _locksMap.get(getPrimaryKeyString(clazz, key));

    if (lock == null) {
        return;/* ww w .j  a v a  2  s.c  om*/
    }

    long userId = getUserId(lock.getUserUuid());

    long expirationTime = 0;

    if (lock.getExpirationDate() != null) {
        Date expirationDate = lock.getExpirationDate();

        expirationTime = expirationDate.getTime();
    }

    _lockManager.lock(userId, clazz.getName(), newKey, lock.getOwner(), lock.isInheritable(), expirationTime);
}