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.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.service.EmailAddressServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    /**
026     * Provides the SOAP utility for the
027     * {@link EmailAddressServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it is difficult for SOAP to
030     * support certain types.
031     *
032     * <p>
033     * ServiceBuilder follows certain rules in translating the methods. For example,
034     * if the method in the service utility returns a {@link java.util.List}, that
035     * is translated to an array of {@link com.liferay.portal.model.EmailAddressSoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.EmailAddress}, that is translated to a
038     * {@link com.liferay.portal.model.EmailAddressSoap}. Methods that SOAP cannot
039     * safely wire are skipped.
040     * </p>
041     *
042     * <p>
043     * The benefits of using the SOAP utility is that it is cross platform
044     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
045     * even Perl, to call the generated services. One drawback of SOAP is that it is
046     * slow because it needs to serialize all calls into a text format (XML).
047     * </p>
048     *
049     * <p>
050     * You can see a list of services at http://localhost:8080/api/axis. Set the
051     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
052     * security.
053     * </p>
054     *
055     * <p>
056     * The SOAP utility is only generated for remote services.
057     * </p>
058     *
059     * @author Brian Wing Shun Chan
060     * @see EmailAddressServiceHttp
061     * @see com.liferay.portal.model.EmailAddressSoap
062     * @see EmailAddressServiceUtil
063     * @generated
064     */
065    @ProviderType
066    public class EmailAddressServiceSoap {
067            /**
068            * @deprecated As of 6.2.0, replaced by {@link #addEmailAddress(String,
069            long, String, int, boolean, ServiceContext)}
070            */
071            @Deprecated
072            public static com.liferay.portal.model.EmailAddressSoap addEmailAddress(
073                    java.lang.String className, long classPK, java.lang.String address,
074                    long typeId, boolean primary) throws RemoteException {
075                    try {
076                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.addEmailAddress(className,
077                                            classPK, address, typeId, primary);
078    
079                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
080                    }
081                    catch (Exception e) {
082                            _log.error(e, e);
083    
084                            throw new RemoteException(e.getMessage());
085                    }
086            }
087    
088            public static com.liferay.portal.model.EmailAddressSoap addEmailAddress(
089                    java.lang.String className, long classPK, java.lang.String address,
090                    long typeId, boolean primary,
091                    com.liferay.portal.service.ServiceContext serviceContext)
092                    throws RemoteException {
093                    try {
094                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.addEmailAddress(className,
095                                            classPK, address, typeId, primary, serviceContext);
096    
097                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
098                    }
099                    catch (Exception e) {
100                            _log.error(e, e);
101    
102                            throw new RemoteException(e.getMessage());
103                    }
104            }
105    
106            public static void deleteEmailAddress(long emailAddressId)
107                    throws RemoteException {
108                    try {
109                            EmailAddressServiceUtil.deleteEmailAddress(emailAddressId);
110                    }
111                    catch (Exception e) {
112                            _log.error(e, e);
113    
114                            throw new RemoteException(e.getMessage());
115                    }
116            }
117    
118            /**
119            * Returns the email address with the primary key.
120            *
121            * @param emailAddressId the primary key of the email address
122            * @return the email address with the primary key, or <code>null</code> if
123            an email address with the primary key could not be found or if
124            the user did not have permission to view the email address
125            * @throws PortalException if a portal exception occurred
126            */
127            public static com.liferay.portal.model.EmailAddressSoap fetchEmailAddress(
128                    long emailAddressId) throws RemoteException {
129                    try {
130                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.fetchEmailAddress(emailAddressId);
131    
132                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
133                    }
134                    catch (Exception e) {
135                            _log.error(e, e);
136    
137                            throw new RemoteException(e.getMessage());
138                    }
139            }
140    
141            public static com.liferay.portal.model.EmailAddressSoap getEmailAddress(
142                    long emailAddressId) throws RemoteException {
143                    try {
144                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.getEmailAddress(emailAddressId);
145    
146                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
147                    }
148                    catch (Exception e) {
149                            _log.error(e, e);
150    
151                            throw new RemoteException(e.getMessage());
152                    }
153            }
154    
155            public static com.liferay.portal.model.EmailAddressSoap[] getEmailAddresses(
156                    java.lang.String className, long classPK) throws RemoteException {
157                    try {
158                            java.util.List<com.liferay.portal.model.EmailAddress> returnValue = EmailAddressServiceUtil.getEmailAddresses(className,
159                                            classPK);
160    
161                            return com.liferay.portal.model.EmailAddressSoap.toSoapModels(returnValue);
162                    }
163                    catch (Exception e) {
164                            _log.error(e, e);
165    
166                            throw new RemoteException(e.getMessage());
167                    }
168            }
169    
170            public static com.liferay.portal.model.EmailAddressSoap updateEmailAddress(
171                    long emailAddressId, java.lang.String address, long typeId,
172                    boolean primary) throws RemoteException {
173                    try {
174                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.updateEmailAddress(emailAddressId,
175                                            address, typeId, primary);
176    
177                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
178                    }
179                    catch (Exception e) {
180                            _log.error(e, e);
181    
182                            throw new RemoteException(e.getMessage());
183                    }
184            }
185    
186            private static Log _log = LogFactoryUtil.getLog(EmailAddressServiceSoap.class);
187    }