Sleuth Kit Java Bindings (JNI)  4.12.1
Java bindings for using The Sleuth Kit
CaseDbConnectionInfo.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2011-2023 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.datamodel;
20 
22 
30 public class CaseDbConnectionInfo {
31 
32  private String hostNameOrIP;
33  private String portNumber;
34  private String userName;
35  private String password;
36  private DbType dbType;
37  private boolean sslEnabled = false;
38  private boolean sslVerify = false;
39  private String customSslValidationClassName;
40 
55  public CaseDbConnectionInfo(String hostNameOrIP, String portNumber, String userName, String password, DbType dbType) {
56  this.hostNameOrIP = hostNameOrIP;
57  this.portNumber = portNumber;
58  this.userName = userName;
59  this.password = password;
60  this.sslEnabled = false;
61  this.sslVerify = false;
62  if (dbType == DbType.SQLITE) {
63  throw new IllegalArgumentException("SQLite database type invalid for CaseDbConnectionInfo. CaseDbConnectionInfo should be used only for remote database types.");
64  }
65  this.dbType = dbType;
66  this.customSslValidationClassName = "";
67  }
68 
97  public CaseDbConnectionInfo(String hostNameOrIP, String portNumber, String userName, String password, DbType dbType,
98  boolean sslEnabled, boolean sslVerify, String customSslValidationClassName) {
99  this.hostNameOrIP = hostNameOrIP;
100  this.portNumber = portNumber;
101  this.userName = userName;
102  this.password = password;
103  this.sslEnabled = sslEnabled;
104  this.sslVerify = sslVerify;
105  if (dbType == DbType.SQLITE) {
106  throw new IllegalArgumentException("SQLite database type invalid for CaseDbConnectionInfo. CaseDbConnectionInfo should be used only for remote database types.");
107  }
108  this.dbType = dbType;
109  this.customSslValidationClassName = customSslValidationClassName;
110  }
111 
112  public DbType getDbType() {
113  return this.dbType;
114  }
115 
116  public String getHost() {
117  return this.hostNameOrIP;
118  }
119 
120  public String getPort() {
121  return this.portNumber;
122  }
123 
124  public String getUserName() {
125  return this.userName;
126  }
127 
128  public String getPassword() {
129  return this.password;
130  }
131 
132  public void setDbType(DbType db) {
133  this.dbType = db;
134  }
135 
136  public void setHost(String host) {
137  this.hostNameOrIP = host;
138  }
139 
140  public void setPort(String port) {
141  this.portNumber = port;
142  }
143 
144  public void setUserName(String user) {
145  this.userName = user;
146  }
147 
148  public void setPassword(String pass) {
149  this.password = pass;
150  }
151 
152  public boolean isSslEnabled() {
153  return sslEnabled;
154  }
155 
156  public void setSslEnabled(boolean sslEnabled) {
157  this.sslEnabled = sslEnabled;
158  }
159 
160  public boolean isSslVerify() {
161  return sslVerify;
162  }
163 
164  public void setSslVerify(boolean sslVerify) {
165  this.sslVerify = sslVerify;
166  }
167 
169  return customSslValidationClassName;
170  }
171 
172  public void setCustomSslValidationClassName(String customSslValidationClassName) {
173  this.customSslValidationClassName = customSslValidationClassName;
174  }
175 }
CaseDbConnectionInfo(String hostNameOrIP, String portNumber, String userName, String password, DbType dbType)
CaseDbConnectionInfo(String hostNameOrIP, String portNumber, String userName, String password, DbType dbType, boolean sslEnabled, boolean sslVerify, String customSslValidationClassName)
void setCustomSslValidationClassName(String customSslValidationClassName)

Copyright © 2011-2021 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.