001
014
015 package com.liferay.portlet.social.model.impl;
016
017 import com.liferay.portal.theme.ThemeDisplay;
018 import com.liferay.portlet.social.model.SocialRequest;
019 import com.liferay.portlet.social.model.SocialRequestFeedEntry;
020 import com.liferay.portlet.social.model.SocialRequestInterpreter;
021
022 import java.util.HashSet;
023 import java.util.Set;
024
025
028 public class SocialRequestInterpreterImpl
029 implements SocialRequestInterpreter {
030
031 public SocialRequestInterpreterImpl(
032 String portletId, SocialRequestInterpreter requestInterpreter) {
033
034 _portletId = portletId;
035 _requestInterpreter = requestInterpreter;
036
037 String[] classNames = _requestInterpreter.getClassNames();
038
039 for (String className : classNames) {
040 _classNames.add(className);
041 }
042 }
043
044 public String[] getClassNames() {
045 return _requestInterpreter.getClassNames();
046 }
047
048 public String getPortletId() {
049 return _portletId;
050 }
051
052 public boolean hasClassName(String className) {
053 if (_classNames.contains(className)) {
054 return true;
055 }
056 else {
057 return false;
058 }
059 }
060
061 public SocialRequestFeedEntry interpret(
062 SocialRequest request, ThemeDisplay themeDisplay) {
063
064 return _requestInterpreter.interpret(
065 request, themeDisplay);
066 }
067
068 public boolean processConfirmation(
069 SocialRequest request, ThemeDisplay themeDisplay) {
070
071 return _requestInterpreter.processConfirmation(
072 request, themeDisplay);
073 }
074
075 public boolean processRejection(
076 SocialRequest request, ThemeDisplay themeDisplay) {
077
078 return _requestInterpreter.processRejection(request, themeDisplay);
079 }
080
081 private String _portletId;
082 private SocialRequestInterpreter _requestInterpreter;
083 private Set<String> _classNames = new HashSet<String>();
084
085 }