package br.mp.mprj.portal.portlet.gestaomensagens.service.service;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.InvokableLocalService;

/**
 * Provides the local service utility for Agendamento. This utility wraps
 * {@link br.mp.mprj.portal.portlet.gestaomensagens.service.service.impl.AgendamentoLocalServiceImpl} and is the
 * primary access point for service operations in application layer code running
 * on the local server. Methods of this service will not have security checks
 * based on the propagated JAAS credentials because this service can only be
 * accessed from within the same VM.
 *
 * @author Henrique Simoes
 * @see AgendamentoLocalService
 * @see br.mp.mprj.portal.portlet.gestaomensagens.service.service.base.AgendamentoLocalServiceBaseImpl
 * @see br.mp.mprj.portal.portlet.gestaomensagens.service.service.impl.AgendamentoLocalServiceImpl
 * @generated
 */
public class AgendamentoLocalServiceUtil {
    private static AgendamentoLocalService _service;

    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify this class directly. Add custom service methods to {@link br.mp.mprj.portal.portlet.gestaomensagens.service.service.impl.AgendamentoLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
     */

    /**
    * Adds the agendamento to the database. Also notifies the appropriate model listeners.
    *
    * @param agendamento the agendamento
    * @return the agendamento that was added
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento addAgendamento(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento agendamento)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().addAgendamento(agendamento);
    }

    /**
    * Creates a new agendamento with the primary key. Does not add the agendamento to the database.
    *
    * @param agendamentoId the primary key for the new agendamento
    * @return the new agendamento
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento createAgendamento(
        long agendamentoId) {
        return getService().createAgendamento(agendamentoId);
    }

    /**
    * Deletes the agendamento with the primary key from the database. Also notifies the appropriate model listeners.
    *
    * @param agendamentoId the primary key of the agendamento
    * @return the agendamento that was removed
    * @throws PortalException if a agendamento with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento deleteAgendamento(
        long agendamentoId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().deleteAgendamento(agendamentoId);
    }

    /**
    * Deletes the agendamento from the database. Also notifies the appropriate model listeners.
    *
    * @param agendamento the agendamento
    * @return the agendamento that was removed
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento deleteAgendamento(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento agendamento)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().deleteAgendamento(agendamento);
    }

    public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
        return getService().dynamicQuery();
    }

    /**
    * Performs a dynamic query on the database and returns the matching rows.
    *
    * @param dynamicQuery the dynamic query
    * @return the matching rows
    * @throws SystemException if a system exception occurred
    */
    @SuppressWarnings("rawtypes")
    public static java.util.List dynamicQuery(
        com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().dynamicQuery(dynamicQuery);
    }

    /**
    * Performs a dynamic query on the database and returns a range of the matching rows.
    *
    * <p>
    * 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 br.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.AgendamentoModelImpl}. 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.
    * </p>
    *
    * @param dynamicQuery the dynamic query
    * @param start the lower bound of the range of model instances
    * @param end the upper bound of the range of model instances (not inclusive)
    * @return the range of matching rows
    * @throws SystemException if a system exception occurred
    */
    @SuppressWarnings("rawtypes")
    public static java.util.List dynamicQuery(
        com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
        int end) throws com.liferay.portal.kernel.exception.SystemException {
        return getService().dynamicQuery(dynamicQuery, start, end);
    }

    /**
    * Performs a dynamic query on the database and returns an ordered range of the matching rows.
    *
    * <p>
    * 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 br.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.AgendamentoModelImpl}. 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.
    * </p>
    *
    * @param dynamicQuery the dynamic query
    * @param start the lower bound of the range of model instances
    * @param end the upper bound of the range of model instances (not inclusive)
    * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
    * @return the ordered range of matching rows
    * @throws SystemException if a system exception occurred
    */
    @SuppressWarnings("rawtypes")
    public static java.util.List dynamicQuery(
        com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
        int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService()
                   .dynamicQuery(dynamicQuery, start, end, orderByComparator);
    }

    /**
    * Returns the number of rows that match the dynamic query.
    *
    * @param dynamicQuery the dynamic query
    * @return the number of rows that match the dynamic query
    * @throws SystemException if a system exception occurred
    */
    public static long dynamicQueryCount(
        com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().dynamicQueryCount(dynamicQuery);
    }

    /**
    * Returns the number of rows that match the dynamic query.
    *
    * @param dynamicQuery the dynamic query
    * @param projection the projection to apply to the query
    * @return the number of rows that match the dynamic query
    * @throws SystemException if a system exception occurred
    */
    public static long dynamicQueryCount(
        com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
        com.liferay.portal.kernel.dao.orm.Projection projection)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().dynamicQueryCount(dynamicQuery, projection);
    }

    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento fetchAgendamento(
        long agendamentoId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().fetchAgendamento(agendamentoId);
    }

    /**
    * Returns the agendamento with the matching UUID and company.
    *
    * @param uuid the agendamento's UUID
    * @param companyId the primary key of the company
    * @return the matching agendamento, or <code>null</code> if a matching agendamento could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento fetchAgendamentoByUuidAndCompanyId(
        java.lang.String uuid, long companyId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().fetchAgendamentoByUuidAndCompanyId(uuid, companyId);
    }

    /**
    * Returns the agendamento matching the UUID and group.
    *
    * @param uuid the agendamento's UUID
    * @param groupId the primary key of the group
    * @return the matching agendamento, or <code>null</code> if a matching agendamento could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento fetchAgendamentoByUuidAndGroupId(
        java.lang.String uuid, long groupId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().fetchAgendamentoByUuidAndGroupId(uuid, groupId);
    }

    /**
    * Returns the agendamento with the primary key.
    *
    * @param agendamentoId the primary key of the agendamento
    * @return the agendamento
    * @throws PortalException if a agendamento with the primary key could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento getAgendamento(
        long agendamentoId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().getAgendamento(agendamentoId);
    }

    public static com.liferay.portal.model.PersistedModel getPersistedModel(
        java.io.Serializable primaryKeyObj)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().getPersistedModel(primaryKeyObj);
    }

    /**
    * Returns the agendamento with the matching UUID and company.
    *
    * @param uuid the agendamento's UUID
    * @param companyId the primary key of the company
    * @return the matching agendamento
    * @throws PortalException if a matching agendamento could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento getAgendamentoByUuidAndCompanyId(
        java.lang.String uuid, long companyId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().getAgendamentoByUuidAndCompanyId(uuid, companyId);
    }

    /**
    * Returns the agendamento matching the UUID and group.
    *
    * @param uuid the agendamento's UUID
    * @param groupId the primary key of the group
    * @return the matching agendamento
    * @throws PortalException if a matching agendamento could not be found
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento getAgendamentoByUuidAndGroupId(
        java.lang.String uuid, long groupId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().getAgendamentoByUuidAndGroupId(uuid, groupId);
    }

    /**
    * Returns a range of all the agendamentos.
    *
    * <p>
    * 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 br.mp.mprj.portal.portlet.gestaomensagens.service.model.impl.AgendamentoModelImpl}. 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.
    * </p>
    *
    * @param start the lower bound of the range of agendamentos
    * @param end the upper bound of the range of agendamentos (not inclusive)
    * @return the range of agendamentos
    * @throws SystemException if a system exception occurred
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento> getAgendamentos(
        int start, int end)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().getAgendamentos(start, end);
    }

    /**
    * Returns the number of agendamentos.
    *
    * @return the number of agendamentos
    * @throws SystemException if a system exception occurred
    */
    public static int getAgendamentosCount()
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().getAgendamentosCount();
    }

    /**
    * Updates the agendamento in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
    *
    * @param agendamento the agendamento
    * @return the agendamento that was updated
    * @throws SystemException if a system exception occurred
    */
    public static br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento updateAgendamento(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento agendamento)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().updateAgendamento(agendamento);
    }

    /**
    * Returns the Spring bean ID for this bean.
    *
    * @return the Spring bean ID for this bean
    */
    public static java.lang.String getBeanIdentifier() {
        return getService().getBeanIdentifier();
    }

    /**
    * Sets the Spring bean ID for this bean.
    *
    * @param beanIdentifier the Spring bean ID for this bean
    */
    public static void setBeanIdentifier(java.lang.String beanIdentifier) {
        getService().setBeanIdentifier(beanIdentifier);
    }

    public static java.lang.Object invokeMethod(java.lang.String name,
        java.lang.String[] parameterTypes, java.lang.Object[] arguments)
        throws java.lang.Throwable {
        return getService().invokeMethod(name, parameterTypes, arguments);
    }

    /**
    * Retorna os agendamentos de determinada mensagem, de acordo com os tipos definidos em {@link TipoAgendamentoEnum} (posi&ccedil;&atilde;o do enum, ou seja, ordinal).
    *
    * @param mensagemId
    * @param tiposAgendamento
    * @return
    * @throws PortalException
    * @throws SystemException
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento> findByMensagemTipoAgendamentoMultiplos(
        long mensagemId, int[] tiposAgendamento)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService()
                   .findByMensagemTipoAgendamentoMultiplos(mensagemId,
            tiposAgendamento);
    }

    /**
    * Define as informa&ccedil;&otilde;es de agendamento nos atributos da mensagem.
    *
    * @param mensagem - inst&acirc;ncia de {@link Mensagem} devidamente inicializada.
    * @param carregarCalendario - definir se deve ou n&atilde;o carregar os Map's auxiliares para a montagem do calend&aacute;rio na p&aacute;gina.
    */
    public static void carregarAgendamento(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem mensagem,
        boolean carregarCalendario)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        getService().carregarAgendamento(mensagem, carregarCalendario);
    }

    /**
    * Localiza todos os Agendamentos que ainda estao
    * pendentes de envio e que possuem a data e hora anterior ao
    * momento atual.
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento> findByMensagensPendetesDeEnvio() {
        return getService().findByMensagensPendetesDeEnvio();
    }

    /**
    * Recupera o total de agendamentos por mensagem e situacao de envio.
    */
    public static int recuperaTotalAgendamentosPorSituacao(long mensagemId,
        int situacaoEnvio)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService()
                   .recuperaTotalAgendamentosPorSituacao(mensagemId,
            situacaoEnvio);
    }

    /**
    * Recupera uma lista de agendamentos por mensagem e situacao de envio.
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento> recuperaAgendamentosPorSituacao(
        long mensagemId, int situacaoEnvio)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService()
                   .recuperaAgendamentosPorSituacao(mensagemId, situacaoEnvio);
    }

    /**
    * Recupera uma lista de agendamentos por mensagem.
    */
    public static java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento> recuperaAgendamentos(
        long mensagemId)
        throws com.liferay.portal.kernel.exception.SystemException {
        return getService().recuperaAgendamentos(mensagemId);
    }

    public static void gerenciaAgendamentos(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem mensagem,
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento agendamento)
        throws com.liferay.portal.kernel.exception.SystemException {
        getService().gerenciaAgendamentos(mensagem, agendamento);
    }

    public static void enviaMensagem(
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Mensagem mensagem,
        br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento agendamento)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException,
            java.io.UnsupportedEncodingException,
            javax.mail.internet.AddressException {
        getService().enviaMensagem(mensagem, agendamento);
    }

    public static void enviaMensagem(
        java.util.List<br.mp.mprj.portal.portlet.gestaomensagens.service.model.Agendamento> listaAgendamento)
        throws com.liferay.portal.kernel.exception.PortalException {
        getService().enviaMensagem(listaAgendamento);
    }

    public static void clearService() {
        _service = null;
    }

    public static AgendamentoLocalService getService() {
        if (_service == null) {
            InvokableLocalService invokableLocalService = (InvokableLocalService) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(),
                    AgendamentoLocalService.class.getName());

            if (invokableLocalService instanceof AgendamentoLocalService) {
                _service = (AgendamentoLocalService) invokableLocalService;
            } else {
                _service = new AgendamentoLocalServiceClp(invokableLocalService);
            }

            ReferenceRegistry.registerReference(AgendamentoLocalServiceUtil.class,
                "_service");
        }

        return _service;
    }

    /**
     * @deprecated As of 6.2.0
     */
    public void setService(AgendamentoLocalService service) {
    }
}
