MCPcopy Create free account
hub / github.com/zaproxy/zaproxy / Model

Class Model

zap/src/main/java/org/parosproxy/paros/model/Model.java:82–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80import org.zaproxy.zap.model.ContextDataFactory;
81
82public class Model {
83
84 private static Model model = null;
85
86 private static final String DBNAME_TEMPLATE = Constant.DBNAME_TEMPLATE;
87 // private static final String DBNAME_UNTITLED = Constant.DBNAME_UNTITLED;
88 private String DBNAME_UNTITLED = Constant.getInstance().DBNAME_UNTITLED;
89 private static int DBNAME_COPY = 1;
90
91 private Session session = null;
92 private OptionsParam optionsParam = null;
93 private Database db = null;
94 private String currentDBNameUntitled = "";
95 // ZAP: Added logger
96 private static final Logger LOGGER = LogManager.getLogger(Model.class);
97 private List<ContextDataFactory> contextDataFactories = new ArrayList<>();
98 private VariantFactory variantFactory = new VariantFactory();
99
100 private boolean postInitialisation;
101
102 public Model() {
103 // make sure the variable here will not refer back to model itself.
104 // DO it in init or respective getter.
105
106 session = new Session(this);
107 optionsParam = new OptionsParam();
108 }
109
110 /**
111 * @return Returns the optionsParam.
112 */
113 public OptionsParam getOptionsParam() {
114 if (optionsParam == null) {
115 optionsParam = new OptionsParam();
116 }
117 return optionsParam;
118 }
119
120 /**
121 * @param param The optionsParam to set.
122 */
123 public void setOptionsParam(OptionsParam param) {
124 optionsParam = param;
125 }
126
127 /**
128 * @return Returns the session.
129 */
130 public Session getSession() {
131 if (session == null) {
132 session = new Session(this);
133 }
134 return session;
135 }
136
137 /**
138 * This method should typically only be called from the Control class
139 *

Callers

nothing calls this directly

Calls 2

getInstanceMethod · 0.95
getLoggerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…