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 MBThreadModelImpl implements MBThread {
026
027 public MBThreadImpl() {
028 }
029
030 public String getAttachmentsDir() {
031 return "messageboards/" + getThreadId();
032 }
033
034 public Lock getLock() {
035 try {
036 return LockLocalServiceUtil.getLock(
037 MBThread.class.getName(), getThreadId());
038 }
039 catch (Exception e) {
040 }
041
042 return null;
043 }
044
045 public boolean hasLock(long userId) {
046 try {
047 return LockLocalServiceUtil.hasLock(
048 userId, MBThread.class.getName(), getThreadId());
049 }
050 catch (Exception e) {
051 }
052
053 return false;
054 }
055
056 public boolean isLocked() {
057 try {
058 return LockLocalServiceUtil.isLocked(
059 MBThread.class.getName(), getThreadId());
060 }
061 catch (Exception e) {
062 }
063
064 return false;
065 }
066
067 }