1   package com.jsql.model.suspendable.callable;
2   
3   import com.jsql.model.InjectionModel;
4   import org.apache.commons.lang3.StringUtils;
5   
6   import java.util.concurrent.Callable;
7   
8   
9   
10  
11  
12  
13  
14  public class CallablePageSource implements Callable<CallablePageSource> {
15      
16      
17  
18  
19      private final String query;
20      private final int nbIndex;
21      private final String metadataInjectionProcess;
22  
23      
24  
25  
26      private String content = StringUtils.EMPTY;
27  
28      
29  
30  
31      private String characterInsertion;
32      
33      private final InjectionModel injectionModel;
34      
35      
36  
37  
38      public CallablePageSource(String query, InjectionModel injectionModel, String metadataInjectionProcess, int nbIndex) {
39          this.query = query;
40          this.nbIndex = nbIndex;
41          this.injectionModel = injectionModel;
42          this.metadataInjectionProcess = metadataInjectionProcess;
43      }
44  
45      
46  
47  
48      public CallablePageSource(
49          String query,
50          String characterInsertion,
51          InjectionModel injectionModel,
52          String metadataInjectionProcess
53      ) {
54          this(query, injectionModel, metadataInjectionProcess, 0);
55          this.characterInsertion = characterInsertion;
56      }
57      
58      @Override
59      public CallablePageSource call() {
60          this.content = this.injectionModel.injectWithoutIndex(this.query, this.metadataInjectionProcess);
61          return this;
62      }
63  
64      
65      
66  
67      public String getQuery() {
68          return this.query;
69      }
70      
71      public String getContent() {
72          return this.content;
73      }
74      
75      public String getCharacterInsertion() {
76          return this.characterInsertion;
77      }
78  
79      public int getNbIndex() {
80          return this.nbIndex;
81      }
82  }