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  public class ServiceContext implements Serializable {
40  
41      public ServiceContext() {
42          _attributes = new LinkedHashMap<String, Serializable>();
43          _expandoBridgeAttributes = new LinkedHashMap<String, Serializable>();
44      }
45  
46      public boolean getAddCommunityPermissions() {
47          return _addCommunityPermissions;
48      }
49  
50      public boolean getAddGuestPermissions() {
51          return _addGuestPermissions;
52      }
53  
54      public Serializable getAttribute(String name) {
55          return _attributes.get(name);
56      }
57  
58      public Map<String, Serializable> getAttributes() {
59          return _attributes;
60      }
61  
62      public String[] getCommunityPermissions() {
63          return _communityPermissions;
64      }
65  
66      public long getCompanyId() {
67          return _companyId;
68      }
69  
70      public Map<String, Serializable> getExpandoBridgeAttributes() {
71          return _expandoBridgeAttributes;
72      }
73  
74      public String[] getGuestPermissions() {
75          return _guestPermissions;
76      }
77  
78      public String getLanguageId() {
79          return _languageId;
80      }
81  
82      public String getLayoutFullURL() {
83          return _layoutFullURL;
84      }
85  
86      public String getLayoutURL() {
87          return _layoutURL;
88      }
89  
90      public String getPathMain() {
91          return _pathMain;
92      }
93  
94      public long getPlid() {
95          return _plid;
96      }
97  
98      public String getPortalURL() {
99          return _portalURL;
100     }
101 
102     public PortletPreferencesIds getPortletPreferencesIds() {
103         return _portletPreferencesIds;
104     }
105 
106     public long getScopeGroupId() {
107         return _scopeGroupId;
108     }
109 
110     public String[] getTagsCategories() {
111         return _tagsCategories;
112     }
113 
114     public String[] getTagsEntries() {
115         return _tagsEntries;
116     }
117 
118     public String getUserDisplayURL() {
119         return _userDisplayURL;
120     }
121 
122     public long getUserId() {
123         return _userId;
124     }
125 
126     public void setAddCommunityPermissions(boolean addCommunityPermissions) {
127         _addCommunityPermissions = addCommunityPermissions;
128     }
129 
130     public void setAddGuestPermissions(boolean addGuestPermissions) {
131         _addGuestPermissions = addGuestPermissions;
132     }
133 
134     public void setAttribute(String name, Serializable value) {
135         _attributes.put(name, value);
136     }
137 
138     public void setAttributes(Map<String, Serializable> attributes) {
139         _attributes = attributes;
140     }
141 
142     public void setCommunityPermissions(String[] communityPermissions) {
143         _communityPermissions = communityPermissions;
144     }
145 
146     public void setCompanyId(long companyId) {
147         _companyId = companyId;
148     }
149 
150     public void setExpandoBridgeAttributes(
151         Map<String, Serializable> expandoBridgeAttributes) {
152 
153         _expandoBridgeAttributes = expandoBridgeAttributes;
154     }
155 
156     public void setGuestPermissions(String[] guestPermissions) {
157         _guestPermissions = guestPermissions;
158     }
159 
160     public void setLanguageId(String languageId) {
161         _languageId = languageId;
162     }
163 
164     public void setLayoutFullURL(String layoutFullURL) {
165         _layoutFullURL = layoutFullURL;
166     }
167 
168     public void setLayoutURL(String layoutURL) {
169         _layoutURL = layoutURL;
170     }
171 
172     public void setPathMain(String pathMain) {
173         _pathMain = pathMain;
174     }
175 
176     public void setPlid(long plid) {
177         _plid = plid;
178     }
179 
180     public void setPortalURL(String portalURL) {
181         _portalURL = portalURL;
182     }
183 
184     public void setPortletPreferencesIds(
185         PortletPreferencesIds portletPreferencesIds) {
186 
187         _portletPreferencesIds = portletPreferencesIds;
188     }
189 
190     public void setScopeGroupId(long scopeGroupId) {
191         _scopeGroupId = scopeGroupId;
192     }
193 
194     public void setTagsCategories(String[] tagsCategories) {
195         _tagsCategories = tagsCategories;
196     }
197 
198     public void setTagsEntries(String[] tagsEntries) {
199         _tagsEntries = tagsEntries;
200     }
201 
202     public void setUserDisplayURL(String userDisplayURL) {
203         _userDisplayURL = userDisplayURL;
204     }
205 
206     public void setUserId(long userId) {
207         _userId = userId;
208     }
209 
210     private boolean _addCommunityPermissions;
211     private boolean _addGuestPermissions;
212     private Map<String, Serializable> _attributes;
213     private String[] _communityPermissions;
214     private long _companyId;
215     private Map<String, Serializable> _expandoBridgeAttributes;
216     private String[] _guestPermissions;
217     private String _languageId;
218     private String _layoutFullURL;
219     private String _layoutURL;
220     private String _pathMain;
221     private String _portalURL;
222     private PortletPreferencesIds _portletPreferencesIds;
223     private long _scopeGroupId;
224     private String[] _tagsCategories;
225     private String[] _tagsEntries;
226     private String _userDisplayURL;
227     private long _plid;
228     private long _userId;
229 
230 }