001
014
015 package com.liferay.portlet.messageboards.model.impl;
016
017 import com.liferay.portal.model.Lock;
018 import com.liferay.portal.service.LockLocalServiceUtil;
019 import com.liferay.portlet.messageboards.model.MBThread;
020
021
025 public class MBThreadImpl extends MBThreadBaseImpl {
026
027 public MBThreadImpl() {
028 }
029
030 @Override
031 public String getAttachmentsDir() {
032 return "messageboards/" + getThreadId();
033 }
034
035 @Override
036 public Lock getLock() {
037 try {
038 return LockLocalServiceUtil.getLock(
039 MBThread.class.getName(), getThreadId());
040 }
041 catch (Exception e) {
042 }
043
044 return null;
045 }
046
047 @Override
048 public boolean hasLock(long userId) {
049 try {
050 return LockLocalServiceUtil.hasLock(
051 userId, MBThread.class.getName(), getThreadId());
052 }
053 catch (Exception e) {
054 }
055
056 return false;
057 }
058
059 @Override
060 public boolean isLocked() {
061 try {
062 return LockLocalServiceUtil.isLocked(
063 MBThread.class.getName(), getThreadId());
064 }
065 catch (Exception e) {
066 }
067
068 return false;
069 }
070
071 }