DefaultBehaviour.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.behaviour.built_in;

  21. import org.openspcoop2.core.config.PortaApplicativa;
  22. import org.openspcoop2.pdd.core.AbstractCore;
  23. import org.openspcoop2.pdd.core.GestoreMessaggi;
  24. import org.openspcoop2.pdd.core.behaviour.Behaviour;
  25. import org.openspcoop2.pdd.core.behaviour.BehaviourEmitDiagnosticException;
  26. import org.openspcoop2.pdd.core.behaviour.BehaviourException;
  27. import org.openspcoop2.pdd.core.behaviour.BehaviourForwardTo;
  28. import org.openspcoop2.pdd.core.behaviour.IBehaviour;
  29. import org.openspcoop2.protocol.sdk.Busta;
  30. import org.openspcoop2.protocol.sdk.state.RequestInfo;

  31. /**
  32.  * DefaultBehaviour
  33.  *
  34.  * @author Andrea Poli (apoli@link.it)
  35.  * @author $Author$
  36.  * @version $Rev$, $Date$
  37.  */
  38. public class DefaultBehaviour extends AbstractCore implements IBehaviour {

  39.     @Override
  40.     public Behaviour behaviour(GestoreMessaggi gestoreMessaggioRichiesta, Busta busta,
  41.             PortaApplicativa pa, RequestInfo requestInfo) throws BehaviourException,BehaviourEmitDiagnosticException {
  42.         try{
  43.             Behaviour behaviour = new Behaviour();
  44.             BehaviourForwardTo forwardTo = new BehaviourForwardTo();
  45.             behaviour.getForwardTo().add(forwardTo);
  46.             return behaviour;
  47.         }catch(Exception e){
  48.             throw new BehaviourException(e.getMessage(),e);
  49.         }
  50.        
  51.     }

  52. }