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

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

Introduction

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

Prototype

public Date getExpirationDate();

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;/*from www  . java  2s.  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);
}