001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.social.service;
016    
017    import com.liferay.portal.service.ServiceWrapper;
018    
019    /**
020     * <p>
021     * This class is a wrapper for {@link SocialRelationLocalService}.
022     * </p>
023     *
024     * @author    Brian Wing Shun Chan
025     * @see       SocialRelationLocalService
026     * @generated
027     */
028    public class SocialRelationLocalServiceWrapper
029            implements SocialRelationLocalService,
030                    ServiceWrapper<SocialRelationLocalService> {
031            public SocialRelationLocalServiceWrapper(
032                    SocialRelationLocalService socialRelationLocalService) {
033                    _socialRelationLocalService = socialRelationLocalService;
034            }
035    
036            /**
037            * Adds the social relation to the database. Also notifies the appropriate model listeners.
038            *
039            * @param socialRelation the social relation
040            * @return the social relation that was added
041            * @throws SystemException if a system exception occurred
042            */
043            public com.liferay.portlet.social.model.SocialRelation addSocialRelation(
044                    com.liferay.portlet.social.model.SocialRelation socialRelation)
045                    throws com.liferay.portal.kernel.exception.SystemException {
046                    return _socialRelationLocalService.addSocialRelation(socialRelation);
047            }
048    
049            /**
050            * Creates a new social relation with the primary key. Does not add the social relation to the database.
051            *
052            * @param relationId the primary key for the new social relation
053            * @return the new social relation
054            */
055            public com.liferay.portlet.social.model.SocialRelation createSocialRelation(
056                    long relationId) {
057                    return _socialRelationLocalService.createSocialRelation(relationId);
058            }
059    
060            /**
061            * Deletes the social relation with the primary key from the database. Also notifies the appropriate model listeners.
062            *
063            * @param relationId the primary key of the social relation
064            * @throws PortalException if a social relation with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public void deleteSocialRelation(long relationId)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    _socialRelationLocalService.deleteSocialRelation(relationId);
071            }
072    
073            /**
074            * Deletes the social relation from the database. Also notifies the appropriate model listeners.
075            *
076            * @param socialRelation the social relation
077            * @throws SystemException if a system exception occurred
078            */
079            public void deleteSocialRelation(
080                    com.liferay.portlet.social.model.SocialRelation socialRelation)
081                    throws com.liferay.portal.kernel.exception.SystemException {
082                    _socialRelationLocalService.deleteSocialRelation(socialRelation);
083            }
084    
085            /**
086            * Performs a dynamic query on the database and returns the matching rows.
087            *
088            * @param dynamicQuery the dynamic query
089            * @return the matching rows
090            * @throws SystemException if a system exception occurred
091            */
092            @SuppressWarnings("rawtypes")
093            public java.util.List dynamicQuery(
094                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
095                    throws com.liferay.portal.kernel.exception.SystemException {
096                    return _socialRelationLocalService.dynamicQuery(dynamicQuery);
097            }
098    
099            /**
100            * Performs a dynamic query on the database and returns a range of the matching rows.
101            *
102            * <p>
103            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
104            * </p>
105            *
106            * @param dynamicQuery the dynamic query
107            * @param start the lower bound of the range of model instances
108            * @param end the upper bound of the range of model instances (not inclusive)
109            * @return the range of matching rows
110            * @throws SystemException if a system exception occurred
111            */
112            @SuppressWarnings("rawtypes")
113            public java.util.List dynamicQuery(
114                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
115                    int end) throws com.liferay.portal.kernel.exception.SystemException {
116                    return _socialRelationLocalService.dynamicQuery(dynamicQuery, start, end);
117            }
118    
119            /**
120            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
121            *
122            * <p>
123            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
124            * </p>
125            *
126            * @param dynamicQuery the dynamic query
127            * @param start the lower bound of the range of model instances
128            * @param end the upper bound of the range of model instances (not inclusive)
129            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
130            * @return the ordered range of matching rows
131            * @throws SystemException if a system exception occurred
132            */
133            @SuppressWarnings("rawtypes")
134            public java.util.List dynamicQuery(
135                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
136                    int end,
137                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
138                    throws com.liferay.portal.kernel.exception.SystemException {
139                    return _socialRelationLocalService.dynamicQuery(dynamicQuery, start,
140                            end, orderByComparator);
141            }
142    
143            /**
144            * Returns the number of rows that match the dynamic query.
145            *
146            * @param dynamicQuery the dynamic query
147            * @return the number of rows that match the dynamic query
148            * @throws SystemException if a system exception occurred
149            */
150            public long dynamicQueryCount(
151                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152                    throws com.liferay.portal.kernel.exception.SystemException {
153                    return _socialRelationLocalService.dynamicQueryCount(dynamicQuery);
154            }
155    
156            public com.liferay.portlet.social.model.SocialRelation fetchSocialRelation(
157                    long relationId)
158                    throws com.liferay.portal.kernel.exception.SystemException {
159                    return _socialRelationLocalService.fetchSocialRelation(relationId);
160            }
161    
162            /**
163            * Returns the social relation with the primary key.
164            *
165            * @param relationId the primary key of the social relation
166            * @return the social relation
167            * @throws PortalException if a social relation with the primary key could not be found
168            * @throws SystemException if a system exception occurred
169            */
170            public com.liferay.portlet.social.model.SocialRelation getSocialRelation(
171                    long relationId)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    return _socialRelationLocalService.getSocialRelation(relationId);
175            }
176    
177            public com.liferay.portal.model.PersistedModel getPersistedModel(
178                    java.io.Serializable primaryKeyObj)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return _socialRelationLocalService.getPersistedModel(primaryKeyObj);
182            }
183    
184            /**
185            * Returns a range of all the social relations.
186            *
187            * <p>
188            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
189            * </p>
190            *
191            * @param start the lower bound of the range of social relations
192            * @param end the upper bound of the range of social relations (not inclusive)
193            * @return the range of social relations
194            * @throws SystemException if a system exception occurred
195            */
196            public java.util.List<com.liferay.portlet.social.model.SocialRelation> getSocialRelations(
197                    int start, int end)
198                    throws com.liferay.portal.kernel.exception.SystemException {
199                    return _socialRelationLocalService.getSocialRelations(start, end);
200            }
201    
202            /**
203            * Returns the number of social relations.
204            *
205            * @return the number of social relations
206            * @throws SystemException if a system exception occurred
207            */
208            public int getSocialRelationsCount()
209                    throws com.liferay.portal.kernel.exception.SystemException {
210                    return _socialRelationLocalService.getSocialRelationsCount();
211            }
212    
213            /**
214            * Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
215            *
216            * @param socialRelation the social relation
217            * @return the social relation that was updated
218            * @throws SystemException if a system exception occurred
219            */
220            public com.liferay.portlet.social.model.SocialRelation updateSocialRelation(
221                    com.liferay.portlet.social.model.SocialRelation socialRelation)
222                    throws com.liferay.portal.kernel.exception.SystemException {
223                    return _socialRelationLocalService.updateSocialRelation(socialRelation);
224            }
225    
226            /**
227            * Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
228            *
229            * @param socialRelation the social relation
230            * @param merge whether to merge the social relation with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
231            * @return the social relation that was updated
232            * @throws SystemException if a system exception occurred
233            */
234            public com.liferay.portlet.social.model.SocialRelation updateSocialRelation(
235                    com.liferay.portlet.social.model.SocialRelation socialRelation,
236                    boolean merge)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return _socialRelationLocalService.updateSocialRelation(socialRelation,
239                            merge);
240            }
241    
242            /**
243            * Returns the Spring bean ID for this bean.
244            *
245            * @return the Spring bean ID for this bean
246            */
247            public java.lang.String getBeanIdentifier() {
248                    return _socialRelationLocalService.getBeanIdentifier();
249            }
250    
251            /**
252            * Sets the Spring bean ID for this bean.
253            *
254            * @param beanIdentifier the Spring bean ID for this bean
255            */
256            public void setBeanIdentifier(java.lang.String beanIdentifier) {
257                    _socialRelationLocalService.setBeanIdentifier(beanIdentifier);
258            }
259    
260            /**
261            * Adds a social relation between the two users to the database.
262            *
263            * @param userId1 the user that is the subject of the relation
264            * @param userId2 the user at the other end of the relation
265            * @param type the type of the relation
266            * @return the social relation
267            * @throws PortalException if the users could not be found, if the users
268            were not from the same company, or if either of the users was the
269            default user
270            * @throws SystemException if a system exception occurred
271            */
272            public com.liferay.portlet.social.model.SocialRelation addRelation(
273                    long userId1, long userId2, int type)
274                    throws com.liferay.portal.kernel.exception.PortalException,
275                            com.liferay.portal.kernel.exception.SystemException {
276                    return _socialRelationLocalService.addRelation(userId1, userId2, type);
277            }
278    
279            /**
280            * Removes the relation (and its inverse in case of a bidirectional
281            * relation) from the database.
282            *
283            * @param relationId the primary key of the relation
284            * @throws PortalException if the relation could not be found
285            * @throws SystemException if a system exception occurred
286            */
287            public void deleteRelation(long relationId)
288                    throws com.liferay.portal.kernel.exception.PortalException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    _socialRelationLocalService.deleteRelation(relationId);
291            }
292    
293            /**
294            * Removes the matching relation (and its inverse in case of a bidirectional
295            * relation) from the database.
296            *
297            * @param userId1 the user that is the subject of the relation
298            * @param userId2 the user at the other end of the relation
299            * @param type the relation's type
300            * @throws PortalException if the relation or its inverse relation (if
301            applicable) could not be found
302            * @throws SystemException if a system exception occurred
303            */
304            public void deleteRelation(long userId1, long userId2, int type)
305                    throws com.liferay.portal.kernel.exception.PortalException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    _socialRelationLocalService.deleteRelation(userId1, userId2, type);
308            }
309    
310            /**
311            * Removes the relation (and its inverse in case of a bidirectional
312            * relation) from the database.
313            *
314            * @param relation the relation to be removed
315            * @throws PortalException if the relation is bidirectional and its inverse
316            relation could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public void deleteRelation(
320                    com.liferay.portlet.social.model.SocialRelation relation)
321                    throws com.liferay.portal.kernel.exception.PortalException,
322                            com.liferay.portal.kernel.exception.SystemException {
323                    _socialRelationLocalService.deleteRelation(relation);
324            }
325    
326            /**
327            * Removes all relations involving the user from the database.
328            *
329            * @param userId the primary key of the user
330            * @throws SystemException if a system exception occurred
331            */
332            public void deleteRelations(long userId)
333                    throws com.liferay.portal.kernel.exception.SystemException {
334                    _socialRelationLocalService.deleteRelations(userId);
335            }
336    
337            /**
338            * Removes all relations between User1 and User2.
339            *
340            * @param userId1 the user that is the subject of the relation
341            * @param userId2 the user at the other end of the relation
342            * @throws PortalException if the inverse relation could not be found
343            * @throws SystemException if a system exception occurred
344            */
345            public void deleteRelations(long userId1, long userId2)
346                    throws com.liferay.portal.kernel.exception.PortalException,
347                            com.liferay.portal.kernel.exception.SystemException {
348                    _socialRelationLocalService.deleteRelations(userId1, userId2);
349            }
350    
351            /**
352            * Returns a range of all the inverse relations of the given type for which
353            * the user is User2 of the relation.
354            *
355            * <p>
356            * Useful when paginating results. Returns a maximum of <code>end -
357            * start</code> instances. <code>start</code> and <code>end</code> are not
358            * primary keys, they are indexes in the result set. Thus, <code>0</code>
359            * refers to the first result in the set. Setting both <code>start</code>
360            * and <code>end</code> to {@link
361            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
362            * result set.
363            * </p>
364            *
365            * @param userId the primary key of the user
366            * @param type the relation's type
367            * @param start the lower bound of the range of results
368            * @param end the upper bound of the range of results (not inclusive)
369            * @return the range of matching relations
370            * @throws SystemException if a system exception occurred
371            */
372            public java.util.List<com.liferay.portlet.social.model.SocialRelation> getInverseRelations(
373                    long userId, int type, int start, int end)
374                    throws com.liferay.portal.kernel.exception.SystemException {
375                    return _socialRelationLocalService.getInverseRelations(userId, type,
376                            start, end);
377            }
378    
379            /**
380            * Returns the number of inverse relations of the given type for which the
381            * user is User2 of the relation.
382            *
383            * @param userId the primary key of the user
384            * @param type the relation's type
385            * @return the number of matching relations
386            * @throws SystemException if a system exception occurred
387            */
388            public int getInverseRelationsCount(long userId, int type)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    return _socialRelationLocalService.getInverseRelationsCount(userId, type);
391            }
392    
393            /**
394            * Returns the relation identified by its primary key.
395            *
396            * @param relationId the primary key of the relation
397            * @return Returns the relation
398            * @throws PortalException if the relation could not be found
399            * @throws SystemException if a system exception occurred
400            */
401            public com.liferay.portlet.social.model.SocialRelation getRelation(
402                    long relationId)
403                    throws com.liferay.portal.kernel.exception.PortalException,
404                            com.liferay.portal.kernel.exception.SystemException {
405                    return _socialRelationLocalService.getRelation(relationId);
406            }
407    
408            /**
409            * Returns the relation of the given type between User1 and User2.
410            *
411            * @param userId1 the user that is the subject of the relation
412            * @param userId2 the user at the other end of the relation
413            * @param type the relation's type
414            * @return Returns the relation
415            * @throws PortalException if the relation could not be found
416            * @throws SystemException if a system exception occurred
417            */
418            public com.liferay.portlet.social.model.SocialRelation getRelation(
419                    long userId1, long userId2, int type)
420                    throws com.liferay.portal.kernel.exception.PortalException,
421                            com.liferay.portal.kernel.exception.SystemException {
422                    return _socialRelationLocalService.getRelation(userId1, userId2, type);
423            }
424    
425            /**
426            * Returns a range of all the relations of the given type where the user is
427            * the subject of the relation.
428            *
429            * <p>
430            * Useful when paginating results. Returns a maximum of <code>end -
431            * start</code> instances. <code>start</code> and <code>end</code> are not
432            * primary keys, they are indexes in the result set. Thus, <code>0</code>
433            * refers to the first result in the set. Setting both <code>start</code>
434            * and <code>end</code> to {@link
435            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
436            * result set.
437            * </p>
438            *
439            * @param userId the primary key of the user
440            * @param type the relation's type
441            * @param start the lower bound of the range of results
442            * @param end the upper bound of the range of results (not inclusive)
443            * @return the range of relations
444            * @throws SystemException if a system exception occurred
445            */
446            public java.util.List<com.liferay.portlet.social.model.SocialRelation> getRelations(
447                    long userId, int type, int start, int end)
448                    throws com.liferay.portal.kernel.exception.SystemException {
449                    return _socialRelationLocalService.getRelations(userId, type, start, end);
450            }
451    
452            /**
453            * Returns a range of all the relations between User1 and User2.
454            *
455            * <p>
456            * Useful when paginating results. Returns a maximum of <code>end -
457            * start</code> instances. <code>start</code> and <code>end</code> are not
458            * primary keys, they are indexes in the result set. Thus, <code>0</code>
459            * refers to the first result in the set. Setting both <code>start</code>
460            * and <code>end</code> to {@link
461            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
462            * result set.
463            * </p>
464            *
465            * @param userId1 the user that is the subject of the relation
466            * @param userId2 the user at the other end of the relation
467            * @param start the lower bound of the range of results
468            * @param end the upper bound of the range of results (not inclusive)
469            * @return the range of relations
470            * @throws SystemException if a system exception occurred
471            */
472            public java.util.List<com.liferay.portlet.social.model.SocialRelation> getRelations(
473                    long userId1, long userId2, int start, int end)
474                    throws com.liferay.portal.kernel.exception.SystemException {
475                    return _socialRelationLocalService.getRelations(userId1, userId2,
476                            start, end);
477            }
478    
479            /**
480            * Returns the number of relations of the given type where the user is the
481            * subject of the relation.
482            *
483            * @param userId the primary key of the user
484            * @param type the relation's type
485            * @return the number of relations
486            * @throws SystemException if a system exception occurred
487            */
488            public int getRelationsCount(long userId, int type)
489                    throws com.liferay.portal.kernel.exception.SystemException {
490                    return _socialRelationLocalService.getRelationsCount(userId, type);
491            }
492    
493            /**
494            * Returns the number of relations between User1 and User2.
495            *
496            * @param userId1 the user that is the subject of the relation
497            * @param userId2 the user at the other end of the relation
498            * @return the number of relations
499            * @throws SystemException if a system exception occurred
500            */
501            public int getRelationsCount(long userId1, long userId2)
502                    throws com.liferay.portal.kernel.exception.SystemException {
503                    return _socialRelationLocalService.getRelationsCount(userId1, userId2);
504            }
505    
506            /**
507            * Returns <code>true</code> if a relation of the given type exists where
508            * the user with primary key <code>userId1</code> is User1 of the relation
509            * and the user with the primary key <code>userId2</code> is User2 of the
510            * relation.
511            *
512            * @param userId1 the user that is the subject of the relation
513            * @param userId2 the user at the other end of the relation
514            * @param type the relation's type
515            * @return <code>true</code> if the relation exists; <code>false</code>
516            otherwise
517            * @throws SystemException if a system exception occurred
518            */
519            public boolean hasRelation(long userId1, long userId2, int type)
520                    throws com.liferay.portal.kernel.exception.SystemException {
521                    return _socialRelationLocalService.hasRelation(userId1, userId2, type);
522            }
523    
524            /**
525            * Returns <code>true</code> if the users can be in a relation of the given
526            * type where the user with primary key <code>userId1</code> is User1 of the
527            * relation and the user with the primary key <code>userId2</code> is User2
528            * of the relation.
529            *
530            * <p>
531            * This method returns <code>false</code> if User1 and User2 are the same,
532            * if either user is the default user, or if a matching relation already
533            * exists.
534            * </p>
535            *
536            * @param userId1 the user that is the subject of the relation
537            * @param userId2 the user at the other end of the relation
538            * @param type the relation's type
539            * @return <code>true</code> if the two users can be in a new relation of
540            the given type; <code>false</code> otherwise
541            * @throws SystemException if a system exception occurred
542            */
543            public boolean isRelatable(long userId1, long userId2, int type)
544                    throws com.liferay.portal.kernel.exception.SystemException {
545                    return _socialRelationLocalService.isRelatable(userId1, userId2, type);
546            }
547    
548            /**
549             * @deprecated Renamed to {@link #getWrappedService}
550             */
551            public SocialRelationLocalService getWrappedSocialRelationLocalService() {
552                    return _socialRelationLocalService;
553            }
554    
555            /**
556             * @deprecated Renamed to {@link #setWrappedService}
557             */
558            public void setWrappedSocialRelationLocalService(
559                    SocialRelationLocalService socialRelationLocalService) {
560                    _socialRelationLocalService = socialRelationLocalService;
561            }
562    
563            public SocialRelationLocalService getWrappedService() {
564                    return _socialRelationLocalService;
565            }
566    
567            public void setWrappedService(
568                    SocialRelationLocalService socialRelationLocalService) {
569                    _socialRelationLocalService = socialRelationLocalService;
570            }
571    
572            private SocialRelationLocalService _socialRelationLocalService;
573    }