ResourceEvent.java

  1. /*
  2.  * Copyright (c) 2002-2022, City of Paris
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  *  1. Redistributions of source code must retain the above copyright notice
  10.  *     and the following disclaimer.
  11.  *
  12.  *  2. Redistributions in binary form must reproduce the above copyright notice
  13.  *     and the following disclaimer in the documentation and/or other materials
  14.  *     provided with the distribution.
  15.  *
  16.  *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
  17.  *     contributors may be used to endorse or promote products derived from
  18.  *     this software without specific prior written permission.
  19.  *
  20.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21.  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23.  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
  24.  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25.  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  26.  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27.  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28.  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30.  * POSSIBILITY OF SUCH DAMAGE.
  31.  *
  32.  * License 1.0
  33.  */
  34. package fr.paris.lutece.portal.business.event;

  35. import fr.paris.lutece.portal.service.search.IndexationService;

  36. /**
  37.  *
  38.  * ResourceEvent
  39.  *
  40.  */
  41. public class ResourceEvent
  42. {
  43.     private String _strIdResource;
  44.     private String _strTypeResource;
  45.     private IEventParam<?> _param;
  46.     private int _nIdPortlet = IndexationService.ALL_DOCUMENT;

  47.     /**
  48.      * default constructor
  49.      */
  50.     public ResourceEvent( )
  51.     {
  52.     }

  53.     /**
  54.      * Constructor with fields
  55.      *
  56.      * @param strIdDocument
  57.      *            the resource identifier
  58.      * @param strTypeResource
  59.      *            the type of the resource
  60.      * @param nIdPortlet
  61.      *            the portlet identifier of the resource
  62.      */
  63.     public ResourceEvent( String strIdDocument, String strTypeResource, int nIdPortlet )
  64.     {
  65.         _strIdResource = strIdDocument;
  66.         _strTypeResource = strTypeResource;
  67.         _nIdPortlet = nIdPortlet;
  68.     }

  69.     /**
  70.      * Gets the resource identifier
  71.      *
  72.      * @return the resource identifier
  73.      */
  74.     public String getIdResource( )
  75.     {
  76.         return _strIdResource;
  77.     }

  78.     /**
  79.      * Sets the resource identifier
  80.      *
  81.      * @param strIdDocument
  82.      *            the resource identifier
  83.      */
  84.     public void setIdResource( String strIdDocument )
  85.     {
  86.         _strIdResource = strIdDocument;
  87.     }

  88.     /**
  89.      * Gets the type of the resource
  90.      *
  91.      * @return the type of the resource
  92.      */
  93.     public String getTypeResource( )
  94.     {
  95.         return _strTypeResource;
  96.     }

  97.     /**
  98.      * Sets the type of the resource
  99.      *
  100.      * @param indexerName
  101.      *            the type of the resource
  102.      */
  103.     public void setTypeResource( String indexerName )
  104.     {
  105.         _strTypeResource = indexerName;
  106.     }

  107.     /**
  108.      * Gets the portlet identifier of the resource
  109.      *
  110.      * @return the portlet identifier of the resource
  111.      */
  112.     public int getIdPortlet( )
  113.     {
  114.         return _nIdPortlet;
  115.     }

  116.     /**
  117.      * Sets the portlet identifier of the resource
  118.      *
  119.      * @param nIdPortlet
  120.      *            the portlet identifier of the resource
  121.      */
  122.     public void setIdPortlet( int nIdPortlet )
  123.     {
  124.         _nIdPortlet = nIdPortlet;
  125.     }

  126.     /**
  127.      * Sets the event Param.
  128.      *
  129.      * @param param
  130.      */
  131.     public void setParam( IEventParam<?> param )
  132.     {
  133.         _param = param;
  134.     }

  135.     /**
  136.      * Gets the event param
  137.      *
  138.      * @return the param
  139.      */
  140.     public IEventParam<?> getParam( )
  141.     {
  142.         return _param;
  143.     }
  144. }