NotifierResult.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.pdd.core.handlers.notifier;

  21. import java.util.ArrayList;
  22. import java.util.List;

  23. import org.slf4j.Logger;
  24. import org.openspcoop2.utils.UtilsException;
  25. import org.openspcoop2.utils.io.notifier.StreamingHandler;
  26. import org.openspcoop2.utils.io.notifier.unblocked.AbstractStreamingHandler;
  27. import org.openspcoop2.utils.io.notifier.unblocked.PipedInputOutputStreamHandler;

  28. /**
  29.  * NotifierResult
  30.  *
  31.  * @author Poli Andrea (apoli@link.it)
  32.  * @author $Author$
  33.  * @version $Rev$, $Date$
  34.  */
  35. public class NotifierResult {

  36.     /**
  37.      * StreamingHandler da aggiungere
  38.      */
  39.     List<StreamingHandler> streamingHandlers = new ArrayList<StreamingHandler>();
  40.    
  41.     /**
  42.      * Nuovo stato del buffer
  43.      */
  44.     NotifierBufferState bufferState = NotifierBufferState.UNMODIFIED;


  45.    
  46.     public List<StreamingHandler> getStreamingHandlers() {
  47.         return this.streamingHandlers;
  48.     }

  49.     public void setStreamingHandlers(List<StreamingHandler> streamingHandlers) {
  50.         this.streamingHandlers = streamingHandlers;
  51.     }
  52.     public void addStreamingHandler(StreamingHandler streamingHandler) throws UtilsException{
  53.         this.streamingHandlers.add(streamingHandler);
  54.     }
  55.     public void addStreamingHandler(String idStreamingHandler,AbstractStreamingHandler stremingHandler,Logger log) throws UtilsException{
  56.         try{
  57.             PipedInputOutputStreamHandler handler = new PipedInputOutputStreamHandler(idStreamingHandler, stremingHandler, log);
  58.             this.streamingHandlers.add(handler);
  59.         }catch(Exception e){
  60.             throw new UtilsException(e.getMessage(),e);
  61.         }
  62.     }
  63.    
  64.    
  65.     public NotifierBufferState getBufferState() {
  66.         return this.bufferState;
  67.     }

  68.     public void setBufferState(NotifierBufferState bufferState) {
  69.         this.bufferState = bufferState;
  70.     }
  71.    
  72. }