001    /**
002     * Copyright (c) 2000-present 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.portal.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for VirtualHost. This utility wraps
024     * {@link com.liferay.portal.service.impl.VirtualHostLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see VirtualHostLocalService
032     * @see com.liferay.portal.service.base.VirtualHostLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.VirtualHostLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class VirtualHostLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.VirtualHostLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the virtual host to the database. Also notifies the appropriate model listeners.
046            *
047            * @param virtualHost the virtual host
048            * @return the virtual host that was added
049            */
050            public static com.liferay.portal.model.VirtualHost addVirtualHost(
051                    com.liferay.portal.model.VirtualHost virtualHost) {
052                    return getService().addVirtualHost(virtualHost);
053            }
054    
055            /**
056            * Creates a new virtual host with the primary key. Does not add the virtual host to the database.
057            *
058            * @param virtualHostId the primary key for the new virtual host
059            * @return the new virtual host
060            */
061            public static com.liferay.portal.model.VirtualHost createVirtualHost(
062                    long virtualHostId) {
063                    return getService().createVirtualHost(virtualHostId);
064            }
065    
066            /**
067            * @throws PortalException
068            */
069            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
070                    com.liferay.portal.model.PersistedModel persistedModel)
071                    throws com.liferay.portal.kernel.exception.PortalException {
072                    return getService().deletePersistedModel(persistedModel);
073            }
074    
075            /**
076            * Deletes the virtual host from the database. Also notifies the appropriate model listeners.
077            *
078            * @param virtualHost the virtual host
079            * @return the virtual host that was removed
080            */
081            public static com.liferay.portal.model.VirtualHost deleteVirtualHost(
082                    com.liferay.portal.model.VirtualHost virtualHost) {
083                    return getService().deleteVirtualHost(virtualHost);
084            }
085    
086            /**
087            * Deletes the virtual host with the primary key from the database. Also notifies the appropriate model listeners.
088            *
089            * @param virtualHostId the primary key of the virtual host
090            * @return the virtual host that was removed
091            * @throws PortalException if a virtual host with the primary key could not be found
092            */
093            public static com.liferay.portal.model.VirtualHost deleteVirtualHost(
094                    long virtualHostId)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    return getService().deleteVirtualHost(virtualHostId);
097            }
098    
099            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
100                    return getService().dynamicQuery();
101            }
102    
103            /**
104            * Performs a dynamic query on the database and returns the matching rows.
105            *
106            * @param dynamicQuery the dynamic query
107            * @return the matching rows
108            */
109            public static <T> java.util.List<T> dynamicQuery(
110                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
111                    return getService().dynamicQuery(dynamicQuery);
112            }
113    
114            /**
115            * Performs a dynamic query on the database and returns a range of the matching rows.
116            *
117            * <p>
118            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.VirtualHostModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
119            * </p>
120            *
121            * @param dynamicQuery the dynamic query
122            * @param start the lower bound of the range of model instances
123            * @param end the upper bound of the range of model instances (not inclusive)
124            * @return the range of matching rows
125            */
126            public static <T> java.util.List<T> dynamicQuery(
127                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
128                    int end) {
129                    return getService().dynamicQuery(dynamicQuery, start, end);
130            }
131    
132            /**
133            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
134            *
135            * <p>
136            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.VirtualHostModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
137            * </p>
138            *
139            * @param dynamicQuery the dynamic query
140            * @param start the lower bound of the range of model instances
141            * @param end the upper bound of the range of model instances (not inclusive)
142            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
143            * @return the ordered range of matching rows
144            */
145            public static <T> java.util.List<T> dynamicQuery(
146                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
147                    int end,
148                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
149                    return getService()
150                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
151            }
152    
153            /**
154            * Returns the number of rows matching the dynamic query.
155            *
156            * @param dynamicQuery the dynamic query
157            * @return the number of rows matching the dynamic query
158            */
159            public static long dynamicQueryCount(
160                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
161                    return getService().dynamicQueryCount(dynamicQuery);
162            }
163    
164            /**
165            * Returns the number of rows matching the dynamic query.
166            *
167            * @param dynamicQuery the dynamic query
168            * @param projection the projection to apply to the query
169            * @return the number of rows matching the dynamic query
170            */
171            public static long dynamicQueryCount(
172                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
173                    com.liferay.portal.kernel.dao.orm.Projection projection) {
174                    return getService().dynamicQueryCount(dynamicQuery, projection);
175            }
176    
177            public static com.liferay.portal.model.VirtualHost fetchVirtualHost(
178                    long companyId, long layoutSetId) {
179                    return getService().fetchVirtualHost(companyId, layoutSetId);
180            }
181    
182            public static com.liferay.portal.model.VirtualHost fetchVirtualHost(
183                    java.lang.String hostname) {
184                    return getService().fetchVirtualHost(hostname);
185            }
186    
187            public static com.liferay.portal.model.VirtualHost fetchVirtualHost(
188                    long virtualHostId) {
189                    return getService().fetchVirtualHost(virtualHostId);
190            }
191    
192            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
193                    return getService().getActionableDynamicQuery();
194            }
195    
196            /**
197            * Returns the OSGi service identifier.
198            *
199            * @return the OSGi service identifier
200            */
201            public static java.lang.String getOSGiServiceIdentifier() {
202                    return getService().getOSGiServiceIdentifier();
203            }
204    
205            public static com.liferay.portal.model.PersistedModel getPersistedModel(
206                    java.io.Serializable primaryKeyObj)
207                    throws com.liferay.portal.kernel.exception.PortalException {
208                    return getService().getPersistedModel(primaryKeyObj);
209            }
210    
211            public static com.liferay.portal.model.VirtualHost getVirtualHost(
212                    long companyId, long layoutSetId)
213                    throws com.liferay.portal.kernel.exception.PortalException {
214                    return getService().getVirtualHost(companyId, layoutSetId);
215            }
216    
217            public static com.liferay.portal.model.VirtualHost getVirtualHost(
218                    java.lang.String hostname)
219                    throws com.liferay.portal.kernel.exception.PortalException {
220                    return getService().getVirtualHost(hostname);
221            }
222    
223            /**
224            * Returns the virtual host with the primary key.
225            *
226            * @param virtualHostId the primary key of the virtual host
227            * @return the virtual host
228            * @throws PortalException if a virtual host with the primary key could not be found
229            */
230            public static com.liferay.portal.model.VirtualHost getVirtualHost(
231                    long virtualHostId)
232                    throws com.liferay.portal.kernel.exception.PortalException {
233                    return getService().getVirtualHost(virtualHostId);
234            }
235    
236            /**
237            * Returns a range of all the virtual hosts.
238            *
239            * <p>
240            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.VirtualHostModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
241            * </p>
242            *
243            * @param start the lower bound of the range of virtual hosts
244            * @param end the upper bound of the range of virtual hosts (not inclusive)
245            * @return the range of virtual hosts
246            */
247            public static java.util.List<com.liferay.portal.model.VirtualHost> getVirtualHosts(
248                    int start, int end) {
249                    return getService().getVirtualHosts(start, end);
250            }
251    
252            /**
253            * Returns the number of virtual hosts.
254            *
255            * @return the number of virtual hosts
256            */
257            public static int getVirtualHostsCount() {
258                    return getService().getVirtualHostsCount();
259            }
260    
261            public static com.liferay.portal.model.VirtualHost updateVirtualHost(
262                    long companyId, long layoutSetId, java.lang.String hostname) {
263                    return getService().updateVirtualHost(companyId, layoutSetId, hostname);
264            }
265    
266            /**
267            * Updates the virtual host in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
268            *
269            * @param virtualHost the virtual host
270            * @return the virtual host that was updated
271            */
272            public static com.liferay.portal.model.VirtualHost updateVirtualHost(
273                    com.liferay.portal.model.VirtualHost virtualHost) {
274                    return getService().updateVirtualHost(virtualHost);
275            }
276    
277            public static VirtualHostLocalService getService() {
278                    if (_service == null) {
279                            _service = (VirtualHostLocalService)PortalBeanLocatorUtil.locate(VirtualHostLocalService.class.getName());
280    
281                            ReferenceRegistry.registerReference(VirtualHostLocalServiceUtil.class,
282                                    "_service");
283                    }
284    
285                    return _service;
286            }
287    
288            /**
289             * @deprecated As of 6.2.0
290             */
291            @Deprecated
292            public void setService(VirtualHostLocalService service) {
293            }
294    
295            private static VirtualHostLocalService _service;
296    }