class AcmObjectLockServiceImpl implements AcmObjectLockService, ApplicationEventPublisherAware {

    @Override
    public String getDocumentsWithLock(String objectType, Authentication auth, String lockHeldByUser, int firstRow, int maxRows,
            String sort, String fqParams) throws MuleException
    {
        StringBuilder query = new StringBuilder();
        query.append("{!join from=parent_ref_s to=id}object_type_s:OBJECT_LOCK ");
        if (!StringUtils.isEmpty(objectType))
        {
            query.append(" AND ");
            query.append("parent_type_s").append(":").append(objectType);
        }
        if (lockHeldByUser != null && !StringUtils.isEmpty(lockHeldByUser))
        {
            query.append(" AND ");
            query.append("creator_lcs").append(":").append(lockHeldByUser);
        }
        log.debug("executing query for documents with lock: {}", query.toString());

        return executeQuery(query.toString(), auth, firstRow, maxRows, sort, fqParams);
    }

}