View Javadoc
1   /*
2    * This file is part of Waarp Project (named also Waarp or GG).
3    *
4    *  Copyright (c) 2019, Waarp SAS, and individual contributors by the @author
5    *  tags. See the COPYRIGHT.txt in the distribution for a full listing of
6    * individual contributors.
7    *
8    *  All Waarp Project is free software: you can redistribute it and/or
9    * modify it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation, either version 3 of the License, or (at your
11   * option) any later version.
12   *
13   * Waarp is distributed in the hope that it will be useful, but WITHOUT ANY
14   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15   * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License along with
18   * Waarp . If not, see <http://www.gnu.org/licenses/>.
19   */
20  package org.waarp.openr66.context;
21  
22  import org.waarp.openr66.context.task.exception.OpenR66RunnerErrorException;
23  
24  /**
25   *
26   */
27  public interface R66BusinessInterface {
28    /**
29     * Called once the connection is opened
30     *
31     * @param session
32     *
33     * @throws OpenR66RunnerErrorException
34     */
35    void checkAtConnection(R66Session session) throws OpenR66RunnerErrorException;
36  
37    /**
38     * Called once the authentication is done
39     *
40     * @param session
41     *
42     * @throws OpenR66RunnerErrorException
43     */
44    void checkAtAuthentication(R66Session session)
45        throws OpenR66RunnerErrorException;
46  
47    /**
48     * Called once the DbTaskRunner is created/loaded and before pre tasks
49     *
50     * @param session
51     *
52     * @throws OpenR66RunnerErrorException
53     */
54    void checkAtStartup(R66Session session) throws OpenR66RunnerErrorException;
55  
56    /**
57     * Called once the pre tasks are over in success
58     *
59     * @param session
60     *
61     * @throws OpenR66RunnerErrorException
62     */
63    void checkAfterPreCommand(R66Session session)
64        throws OpenR66RunnerErrorException;
65  
66    /**
67     * Called once the transfer is done in success but before the post tasks
68     *
69     * @param session
70     *
71     * @throws OpenR66RunnerErrorException
72     */
73    void checkAfterTransfer(R66Session session)
74        throws OpenR66RunnerErrorException;
75  
76    /**
77     * Called once the post tasks are over in success
78     *
79     * @param session
80     *
81     * @throws OpenR66RunnerErrorException
82     */
83    void checkAfterPost(R66Session session) throws OpenR66RunnerErrorException;
84  
85    /**
86     * Called once any error occurs
87     *
88     * @param session
89     *
90     * @throws OpenR66RunnerErrorException
91     */
92    void checkAtError(R66Session session);
93  
94    /**
95     * Called once after pre tasks, while filename could be changed (or not)
96     *
97     * @param session
98     *
99     * @throws OpenR66RunnerErrorException
100    */
101   void checkAtChangeFilename(R66Session session)
102       throws OpenR66RunnerErrorException;
103 
104   /**
105    * Called when the session is to be closed in order to release resources
106    *
107    * @param session
108    */
109   void releaseResources(R66Session session);
110 
111   /**
112    * Called to get the current extra "Information" from Business side to
113    * transmit, valid in extended protocol (>
114    * 2.4)
115    *
116    * @param session
117    *
118    * @return the current "session" info
119    */
120   String getInfo(R66Session session);
121 
122   /**
123    * Set optional info to be set within extra information of PacketValid as
124    * "Info" or R66Result as "Other",
125    * valid in extended protocol (> 2.4)
126    *
127    * @param session
128    * @param info
129    */
130   void setInfo(R66Session session, String info);
131 
132 }