1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  import com.liferay.portal.model.PortletPreferencesIds;
26  
27  import java.io.Serializable;
28  
29  import java.util.LinkedHashMap;
30  import java.util.Map;
31  
32  /**
33   * <a href="ServiceContext.java.html"><b><i>View Source</i></b></a>
34   *
35   * @author Raymond Augé
36   * @author Brian Wing Shun Chan
37   * @author Jorge Ferrer
38   *
39   */
40  public class ServiceContext implements Serializable {
41  
42      public ServiceContext() {
43          _attributes = new LinkedHashMap<String, Serializable>();
44          _expandoBridgeAttributes = new LinkedHashMap<String, Serializable>();
45      }
46  
47      public boolean getAddCommunityPermissions() {
48          return _addCommunityPermissions;
49      }
50  
51      public boolean getAddGuestPermissions() {
52          return _addGuestPermissions;
53      }
54  
55      public Serializable getAttribute(String name) {
56          return _attributes.get(name);
57      }
58  
59      public Map<String, Serializable> getAttributes() {
60          return _attributes;
61      }
62  
63      public String[] getCommunityPermissions() {
64          return _communityPermissions;
65      }
66  
67      public long getCompanyId() {
68          return _companyId;
69      }
70  
71      public Map<String, Serializable> getExpandoBridgeAttributes() {
72          return _expandoBridgeAttributes;
73      }
74  
75      public String[] getGuestPermissions() {
76          return _guestPermissions;
77      }
78  
79      public String getLanguageId() {
80          return _languageId;
81      }
82  
83      public String getLayoutURL() {
84          return _layoutURL;
85      }
86  
87      public String getPathMain() {
88          return _pathMain;
89      }
90  
91      public long getPlid() {
92          return _plid;
93      }
94  
95      public String getPortalURL() {
96          return _portalURL;
97      }
98  
99      public PortletPreferencesIds getPortletPreferencesIds() {
100         return _portletPreferencesIds;
101     }
102 
103     public long getScopeGroupId() {
104         return _scopeGroupId;
105     }
106 
107     public String[] getTagsCategories() {
108         return _tagsCategories;
109     }
110 
111     public String[] getTagsEntries() {
112         return _tagsEntries;
113     }
114 
115     public String getUserDisplayURL() {
116         return _userDisplayURL;
117     }
118 
119     public long getUserId() {
120         return _userId;
121     }
122 
123     public void setAddCommunityPermissions(boolean addCommunityPermissions) {
124         _addCommunityPermissions = addCommunityPermissions;
125     }
126 
127     public void setAddGuestPermissions(boolean addGuestPermissions) {
128         _addGuestPermissions = addGuestPermissions;
129     }
130 
131     public void setAttribute(String name, Serializable value) {
132         _attributes.put(name, value);
133     }
134 
135     public void setAttributes(Map<String, Serializable> attributes) {
136         _attributes = attributes;
137     }
138 
139     public void setCommunityPermissions(String[] communityPermissions) {
140         _communityPermissions = communityPermissions;
141     }
142 
143     public void setCompanyId(long companyId) {
144         _companyId = companyId;
145     }
146 
147     public void setExpandoBridgeAttributes(
148         Map<String, Serializable> expandoBridgeAttributes) {
149 
150         _expandoBridgeAttributes = expandoBridgeAttributes;
151     }
152 
153     public void setGuestPermissions(String[] guestPermissions) {
154         _guestPermissions = guestPermissions;
155     }
156 
157     public void setLanguageId(String languageId) {
158         _languageId = languageId;
159     }
160 
161     public void setLayoutURL(String layoutURL) {
162         _layoutURL = layoutURL;
163     }
164 
165     public void setPathMain(String pathMain) {
166         _pathMain = pathMain;
167     }
168 
169     public void setPlid(long plid) {
170         _plid = plid;
171     }
172 
173     public void setPortalURL(String portalURL) {
174         _portalURL = portalURL;
175     }
176 
177     public void setPortletPreferencesIds(
178         PortletPreferencesIds portletPreferencesIds) {
179 
180         _portletPreferencesIds = portletPreferencesIds;
181     }
182 
183     public void setScopeGroupId(long scopeGroupId) {
184         _scopeGroupId = scopeGroupId;
185     }
186 
187     public void setTagsCategories(String[] tagsCategories) {
188         _tagsCategories = tagsCategories;
189     }
190 
191     public void setTagsEntries(String[] tagsEntries) {
192         _tagsEntries = tagsEntries;
193     }
194 
195     public void setUserDisplayURL(String userDisplayURL) {
196         _userDisplayURL = userDisplayURL;
197     }
198 
199     public void setUserId(long userId) {
200         _userId = userId;
201     }
202 
203     private boolean _addCommunityPermissions;
204     private boolean _addGuestPermissions;
205     private Map<String, Serializable> _attributes;
206     private String[] _communityPermissions;
207     private long _companyId;
208     private Map<String, Serializable> _expandoBridgeAttributes;
209     private String[] _guestPermissions;
210     private String _languageId;
211     private String _layoutURL;
212     private String _pathMain;
213     private String _portalURL;
214     private PortletPreferencesIds _portletPreferencesIds;
215     private long _scopeGroupId;
216     private String[] _tagsCategories;
217     private String[] _tagsEntries;
218     private String _userDisplayURL;
219     private long _plid;
220     private long _userId;
221 
222 }