code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public List<EndpointOverride> getSelectedPaths(int overrideType, Client client, Profile profile, String uri,
Integer requestType, boolean pathTest) throws Exception {
List<EndpointOverride> selectPaths = new ArrayList<EndpointOverride>();
// get the pa... | java |
public boolean isActive(int profileId) {
boolean active = false;
PreparedStatement queryStatement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnection.prepareStatement(
"SELECT " + Constants.CLIENT_IS_ACTIVE + " FROM " ... | java |
public List<Profile> findAllProfiles() throws Exception {
ArrayList<Profile> allProfiles = new ArrayList<>();
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatemen... | java |
public Profile findProfile(int profileId) throws Exception {
Profile profile = null;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"SELEC... | java |
private Profile getProfileFromResultSet(ResultSet result) throws Exception {
Profile profile = new Profile();
profile.setId(result.getInt(Constants.GENERIC_ID));
Clob clobProfileName = result.getClob(Constants.PROFILE_PROFILE_NAME);
String profileName = clobProfileName.getSubString(1, (i... | java |
public Profile add(String profileName) throws Exception {
Profile profile = new Profile();
int id = -1;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
Clob clobProfileName = sqlService.toClo... | java |
public void remove(int profileId) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement("DELETE FROM " + Constants.DB_TABLE_PROFILE +
" WHERE "... | java |
public String getNamefromId(int id) {
return (String) sqlService.getFromTable(
Constants.PROFILE_PROFILE_NAME, Constants.GENERIC_ID,
id, Constants.DB_TABLE_PROFILE);
} | java |
public Integer getIdFromName(String profileName) {
PreparedStatement query = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
query = sqlConnection.prepareStatement("SELECT * FROM " + Constants.DB_TABLE_PROFILE +
... | java |
public static Integer convertPathIdentifier(String identifier, Integer profileId) throws Exception {
Integer pathId = -1;
try {
pathId = Integer.parseInt(identifier);
} catch (NumberFormatException ne) {
// this is OK.. just means it's not a #
if (profileId ==... | java |
public static Integer convertProfileIdentifier(String profileIdentifier) throws Exception {
Integer profileId = -1;
if (profileIdentifier == null) {
throw new Exception("A profileIdentifier must be specified");
} else {
try {
profileId = Integer.parseInt(p... | java |
public static Integer convertOverrideIdentifier(String overrideIdentifier) throws Exception {
Integer overrideId = -1;
try {
// there is an issue with parseInt where it does not parse negative values correctly
boolean isNegative = false;
if (overrideIdentifier.starts... | java |
public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {
Identifiers id = new Identifiers();
Integer profileId = null;
try {
profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
} catch ... | java |
public JSONObject getPathFromEndpoint(String pathValue, String requestType) throws Exception {
int type = getRequestTypeFromString(requestType);
String url = BASE_PATH;
JSONObject response = new JSONObject(doGet(url, null));
JSONArray paths = response.getJSONArray("paths");
for (... | java |
public static boolean setDefaultCustomResponse(String pathValue, String requestType, String customData) {
try {
JSONObject profile = getDefaultProfile();
String profileName = profile.getString("name");
PathValueClient client = new PathValueClient(profileName, false);
... | java |
public static boolean removeDefaultCustomResponse(String pathValue, String requestType) {
try {
JSONObject profile = getDefaultProfile();
String profileName = profile.getString("name");
PathValueClient client = new PathValueClient(profileName, false);
return clien... | java |
public boolean removeCustomResponse(String pathValue, String requestType) {
try {
JSONObject path = getPathFromEndpoint(pathValue, requestType);
if (path == null) {
return false;
}
String pathId = path.getString("pathId");
return resetR... | java |
public boolean setCustomResponse(String pathValue, String requestType, String customData) {
try {
JSONObject path = getPathFromEndpoint(pathValue, requestType);
if (path == null) {
String pathName = pathValue;
createPath(pathName, pathValue, requestType);
... | java |
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients", method = RequestMethod.GET)
public
@ResponseBody
HashMap<String, Object> getClientList(Model model,
@PathVariable("profileIdentifier") String profileIdentifier) throws Exception {
Integer p... | java |
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients/{clientUUID}", method = RequestMethod.GET)
public
@ResponseBody
HashMap<String, Object> getClient(Model model,
@PathVariable("profileIdentifier") String profileIdentifier,
... | java |
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> addClient(Model model,
@PathVariable("profileIdentifier") String profileIdentifier,
@Reque... | java |
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients/{clientUUID}", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> updateClient(Model model,
@PathVariable("profileIdentifier") String profileIdentifier,
... | java |
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients/{clientUUID}", method = RequestMethod.DELETE)
public
@ResponseBody
HashMap<String, Object> deleteClient(Model model,
@PathVariable("profileIdentifier") String profileIdentifier,
... | java |
@RequestMapping(value = "/api/profile/{profileIdentifier}/clients/delete", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> deleteClient(Model model,
@RequestParam("profileIdentifier") String profileIdentifier,
... | java |
@RequestMapping(value = "/api/plugins", method = RequestMethod.GET)
public
@ResponseBody
HashMap<String, Object> getPluginInformation() {
return pluginInformation();
} | java |
@RequestMapping(value = "/api/plugins", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> addPluginPath(Model model, Plugin add) throws Exception {
PluginManager.getInstance().addPluginPath(add.getPath());
return pluginInformation();
} | java |
public static void addOverrideToPath() throws Exception {
Client client = new Client("ProfileName", false);
// Use the fully qualified name for a plugin override.
client.addMethodToResponseOverride("Test Path", "com.groupon.odo.sample.Common.delay");
// The third argument is the ordina... | java |
public static void getHistory() throws Exception{
Client client = new Client("ProfileName", false);
// Obtain the 100 history entries starting from offset 0
History[] history = client.refreshHistory(100, 0);
client.clearHistory();
} | java |
@RequestMapping(value = "/profiles", method = RequestMethod.GET)
public String list(Model model) {
Profile profiles = new Profile();
model.addAttribute("addNewProfile", profiles);
model.addAttribute("version", Constants.VERSION);
logger.info("Loading initial page");
return "... | java |
@RequestMapping(value = "/api/profile", method = RequestMethod.GET)
public
@ResponseBody
HashMap<String, Object> getList(Model model) throws Exception {
logger.info("Using a GET request to list profiles");
return Utils.getJQGridJSON(profileService.findAllProfiles(), "profiles");
} | java |
@RequestMapping(value = "/api/profile", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> addProfile(Model model, String name) throws Exception {
logger.info("Should be adding the profile name when I hit the enter button={}", name);
return Utils.getJQGridJSON(profileS... | java |
@RequestMapping(value = "/api/profile", method = RequestMethod.DELETE)
public
@ResponseBody
HashMap<String, Object> deleteProfile(Model model, int id) throws Exception {
profileService.remove(id);
return Utils.getJQGridJSON(profileService.findAllProfiles(), "profiles");
} | java |
public void cullHistory(final int profileId, final String clientUUID, final int limit) throws Exception {
//Allow only 1 delete thread to run
if (threadActive) {
return;
}
threadActive = true;
//Create a thread so proxy will continue to work during long delete
... | java |
public int getHistoryCount(int profileId, String clientUUID, HashMap<String, String[]> searchFilter) {
int count = 0;
Statement query = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String sqlQuery = "SELECT COUNT(" + Constant... | java |
public History getHistoryForID(int id) {
History history = null;
PreparedStatement query = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
query = sqlConnection.prepareStatement("SELECT * FROM " + Constants.DB_TABLE_HISTORY +
... | java |
public void clearHistory(int profileId, String clientUUID) {
PreparedStatement query = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String sqlQuery = "DELETE FROM " + Constants.DB_TABLE_HISTORY + " ";
// see if profileId is null or not (-1)
if... | java |
public void destroy() throws Exception {
if (_clientId == null) {
return;
}
// delete the clientId here
String uri = BASE_PROFILE + uriEncode(_profileName) + "/" + BASE_CLIENTS + "/" + _clientId;
try {
doDelete(uri, null);
} catch (Exception e) {
... | java |
public void setHostName(String hostName) {
if (hostName == null || hostName.contains(":")) {
return;
}
ODO_HOST = hostName;
BASE_URL = "http://" + ODO_HOST + ":" + API_PORT + "/" + API_BASE + "/";
} | java |
public static void setDefaultHostName(String hostName) {
if (hostName == null || hostName.contains(":")) {
return;
}
DEFAULT_BASE_URL = "http://" + hostName + ":" + DEFAULT_API_PORT + "/" + API_BASE + "/";
} | java |
public History[] filterHistory(String... filters) throws Exception {
BasicNameValuePair[] params;
if (filters.length > 0) {
params = new BasicNameValuePair[filters.length];
for (int i = 0; i < filters.length; i++) {
params[i] = new BasicNameValuePair("source_uri[]... | java |
public History[] refreshHistory(int limit, int offset) throws Exception {
BasicNameValuePair[] params = {
new BasicNameValuePair("limit", String.valueOf(limit)),
new BasicNameValuePair("offset", String.valueOf(offset))
};
return constructHistory(params);
} | java |
public void clearHistory() throws Exception {
String uri;
try {
uri = HISTORY + uriEncode(_profileName);
doDelete(uri, null);
} catch (Exception e) {
throw new Exception("Could not delete proxy history");
}
} | java |
public boolean toggleProfile(Boolean enabled) {
// TODO: make this return values properly
BasicNameValuePair[] params = {
new BasicNameValuePair("active", enabled.toString())
};
try {
String uri = BASE_PROFILE + uriEncode(this._profileName) + "/" + BASE_CLIENTS + ... | java |
public boolean setCustomResponse(String pathName, String customResponse) throws Exception {
// figure out the new ordinal
int nextOrdinal = this.getNextOrdinalForMethodId(-1, pathName);
// add override
this.addMethodToResponseOverride(pathName, "-1");
// set argument
re... | java |
public boolean addMethodToResponseOverride(String pathName, String methodName) {
// need to find out the ID for the method
// TODO: change api for adding methods to take the name instead of ID
try {
Integer overrideId = getOverrideIdForMethodName(methodName);
// now post... | java |
public boolean setOverrideRepeatCount(String pathName, String methodName, Integer ordinal, Integer repeatCount) {
try {
String methodId = getOverrideIdForMethodName(methodName).toString();
BasicNameValuePair[] params = {
new BasicNameValuePair("profileIdentifier", this._p... | java |
public boolean setMethodArguments(String pathName, String methodName, Integer ordinal, Object... arguments) {
try {
BasicNameValuePair[] params = new BasicNameValuePair[arguments.length + 2];
int x = 0;
for (Object argument : arguments) {
params[x] = new Basic... | java |
public void createPath(String pathName, String pathValue, String requestType) {
try {
int type = getRequestTypeFromString(requestType);
String url = BASE_PATH;
BasicNameValuePair[] params = {
new BasicNameValuePair("pathName", pathName),
new Ba... | java |
protected static boolean setCustomForDefaultClient(String profileName, String pathName, Boolean isResponse, String customData) {
try {
Client client = new Client(profileName, false);
client.toggleProfile(true);
client.setCustom(isResponse, pathName, customData);
i... | java |
public static boolean setCustomRequestForDefaultClient(String profileName, String pathName, String customData) {
try {
return setCustomForDefaultClient(profileName, pathName, false, customData);
} catch (Exception e) {
e.printStackTrace();
}
return false;
} | java |
public static boolean setCustomResponseForDefaultClient(String profileName, String pathName, String customData) {
try {
return setCustomForDefaultClient(profileName, pathName, true, customData);
} catch (Exception e) {
e.printStackTrace();
}
return false;
} | java |
public static boolean setCustomRequestForDefaultProfile(String pathName, String customData) {
try {
return setCustomForDefaultProfile(pathName, false, customData);
} catch (Exception e) {
e.printStackTrace();
}
return false;
} | java |
public static boolean setCustomResponseForDefaultProfile(String pathName, String customData) {
try {
return setCustomForDefaultProfile(pathName, true, customData);
} catch (Exception e) {
e.printStackTrace();
}
return false;
} | java |
protected static JSONObject getDefaultProfile() throws Exception {
String uri = DEFAULT_BASE_URL + BASE_PROFILE;
try {
JSONObject response = new JSONObject(doGet(uri, 60000));
JSONArray profiles = response.getJSONArray("profiles");
if (profiles.length() > 0) {
... | java |
private Integer getNextOrdinalForMethodId(int methodId, String pathName) throws Exception {
String pathInfo = doGet(BASE_PATH + uriEncode(pathName), new BasicNameValuePair[0]);
JSONObject pathResponse = new JSONObject(pathInfo);
JSONArray enabledEndpoints = pathResponse.getJSONArray("enabledEnd... | java |
protected int getRequestTypeFromString(String requestType) {
if ("GET".equals(requestType)) {
return REQUEST_TYPE_GET;
}
if ("POST".equals(requestType)) {
return REQUEST_TYPE_POST;
}
if ("PUT".equals(requestType)) {
return REQUEST_TYPE_PUT;
... | java |
public ServerRedirect addServerMapping(String sourceHost, String destinationHost, String hostHeader) {
JSONObject response = null;
ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
params.add(new BasicNameValuePair("srcUrl", sourceHost));
params.add(new BasicNa... | java |
public List<ServerRedirect> deleteServerMapping(int serverMappingId) {
ArrayList<ServerRedirect> servers = new ArrayList<ServerRedirect>();
try {
JSONArray serverArray = new JSONArray(doDelete(BASE_SERVER + "/" + serverMappingId, null));
for (int i = 0; i < serverArray.length(); ... | java |
public List<ServerRedirect> getServerMappings() {
ArrayList<ServerRedirect> servers = new ArrayList<ServerRedirect>();
try {
JSONObject response = new JSONObject(doGet(BASE_SERVER, null));
JSONArray serverArray = response.getJSONArray("servers");
for (int i = 0; i < ... | java |
public ServerRedirect updateServerRedirectHost(int serverMappingId, String hostHeader) {
ServerRedirect redirect = new ServerRedirect();
BasicNameValuePair[] params = {
new BasicNameValuePair("hostHeader", hostHeader),
new BasicNameValuePair("profileIdentifier", this._profileName... | java |
public ServerGroup addServerGroup(String groupName) {
ServerGroup group = new ServerGroup();
BasicNameValuePair[] params = {
new BasicNameValuePair("name", groupName),
new BasicNameValuePair("profileIdentifier", this._profileName)
};
try {
JSONObject ... | java |
public List<ServerGroup> getServerGroups() {
ArrayList<ServerGroup> groups = new ArrayList<ServerGroup>();
try {
JSONObject response = new JSONObject(doGet(BASE_SERVERGROUP, null));
JSONArray serverArray = response.getJSONArray("servergroups");
for (int i = 0; i < se... | java |
public ServerGroup updateServerGroupName(int serverGroupId, String name) {
ServerGroup serverGroup = null;
BasicNameValuePair[] params = {
new BasicNameValuePair("name", name),
new BasicNameValuePair("profileIdentifier", this._profileName)
};
try {
JSO... | java |
public boolean uploadConfigurationAndProfile(String fileName, String odoImport) {
File file = new File(fileName);
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
FileBody fileBody = new FileBody(file, ContentType.MULTIPART_FORM_DATA);
multipartEntityBuild... | java |
public JSONObject exportConfigurationAndProfile(String oldExport) {
try {
BasicNameValuePair[] params = {
new BasicNameValuePair("oldExport", oldExport)
};
String url = BASE_BACKUP_PROFILE + "/" + uriEncode(this._profileName) + "/" + this._clientId;
... | java |
private List<Group> getGroups() throws Exception {
List<Group> groups = new ArrayList<Group>();
List<Group> sourceGroups = PathOverrideService.getInstance().findAllGroups();
// loop through the groups
for (Group sourceGroup : sourceGroups) {
Group group = new Group();
... | java |
public SingleProfileBackup getProfileBackupData(int profileID, String clientUUID) throws Exception {
SingleProfileBackup singleProfileBackup = new SingleProfileBackup();
List<PathOverride> enabledPaths = new ArrayList<>();
List<EndpointOverride> paths = PathOverrideService.getInstance().getPath... | java |
public Backup getBackupData() throws Exception {
Backup backupData = new Backup();
backupData.setGroups(getGroups());
backupData.setProfiles(getProfiles());
ArrayList<Script> scripts = new ArrayList<Script>();
Collections.addAll(scripts, ScriptService.getInstance().getScripts())... | java |
private MBeanServer getServerForName(String name) {
try {
MBeanServer mbeanServer = null;
final ObjectName objectNameQuery = new ObjectName(name + ":type=Service,*");
for (final MBeanServer server : MBeanServerFactory.findMBeanServer(null)) {
if (server.query... | java |
@SuppressWarnings("unchecked")
private void setProxyRequestHeaders(HttpServletRequest httpServletRequest,
HttpMethod httpMethodProxyRequest) throws Exception {
RequestInformation requestInfo = requestInformation.get();
String hostName = HttpUtilities.getHostNa... | java |
private void processRequestHeaderOverrides(HttpMethod httpMethodProxyRequest) throws Exception {
RequestInformation requestInfo = requestInformation.get();
for (EndpointOverride selectedPath : requestInfo.selectedRequestPaths) {
List<EnabledEndpoint> points = selectedPath.getEnabledEndpoints... | java |
private String getHostHeaderForHost(String hostName) {
List<ServerRedirect> servers = serverRedirectService.tableServers(requestInformation.get().client.getId());
for (ServerRedirect server : servers) {
if (server.getSrcUrl().compareTo(hostName) == 0) {
String hostHeader = se... | java |
private void processClientId(HttpServletRequest httpServletRequest, History history) {
// get the client id from the request header if applicable.. otherwise set to default
// also set the client uuid in the history object
if (httpServletRequest.getHeader(Constants.PROFILE_CLIENT_HEADER_NAME) !=... | java |
private JSONArray getApplicablePathNames (String requestUrl, Integer requestType) throws Exception {
RequestInformation requestInfo = requestInformation.get();
List<EndpointOverride> applicablePaths;
JSONArray pathNames = new JSONArray();
// Get all paths that match the request
a... | java |
private String getDestinationHostName(String hostName) {
List<ServerRedirect> servers = serverRedirectService
.tableServers(requestInformation.get().client.getId());
for (ServerRedirect server : servers) {
if (server.getSrcUrl().compareTo(hostName) == 0) {
if (ser... | java |
private void processVirtualHostName(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest) {
String virtualHostName;
if (httpMethodProxyRequest.getRequestHeader(STRING_HOST_HEADER_NAME) != null) {
virtualHostName = HttpUtilities.removePortFromHostHeaderString(httpMethodPro... | java |
private void cullDisabledPaths() throws Exception {
ArrayList<EndpointOverride> removePaths = new ArrayList<EndpointOverride>();
RequestInformation requestInfo = requestInformation.get();
for (EndpointOverride selectedPath : requestInfo.selectedResponsePaths) {
// check repeat coun... | java |
private ArrayList<String> getRemoveHeaders() throws Exception {
ArrayList<String> headersToRemove = new ArrayList<String>();
for (EndpointOverride selectedPath : requestInformation.get().selectedResponsePaths) {
// check to see if there is custom override data or if we have headers to remov... | java |
private void executeProxyRequest(HttpMethod httpMethodProxyRequest,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse, History history) {
try {
RequestInformation requestInfo = requestInformation.g... | java |
private void executeRequest(HttpMethod httpMethodProxyRequest,
HttpServletRequest httpServletRequest,
PluginResponse httpServletResponse,
History history) throws Exception {
int intProxyResponseCode = 999;
//... | java |
private void processRedirect(String stringStatusCode,
HttpMethod httpMethodProxyRequest,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) throws Exception {
// Check if the proxy res... | java |
private void logOriginalRequestHistory(String requestType,
HttpServletRequest request, History history) {
logger.info("Storing original request history");
history.setRequestType(requestType);
history.setOriginalRequestHeaders(HttpUtilities.getHeaders(re... | java |
private void logOriginalResponseHistory(
PluginResponse httpServletResponse, History history) throws URIException {
RequestInformation requestInfo = requestInformation.get();
if (requestInfo.handle && requestInfo.client.getIsActive()) {
logger.info("Storing original response history"... | java |
private void logRequestHistory(HttpMethod httpMethodProxyRequest, PluginResponse httpServletResponse,
History history) {
try {
if (requestInformation.get().handle && requestInformation.get().client.getIsActive()) {
logger.info("Storing history");
... | java |
public void handleConnectOriginal(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException {
URI uri = request.getURI();
try {
LOG.fine("CONNECT: " + uri);
InetAddrPort addrPort;
// When logging, we'll att... | java |
protected X509Certificate wireUpSslWithCyberVilliansCAOdo(String host, SslListener listener) {
host = requestOriginalHostName.get();
// Add cybervillians CA(from browsermob)
try {
// see https://github.com/webmetrics/browsermob-proxy/issues/105
String escapedHost = host.... | java |
private void startRelayWithPortTollerance(HttpServer server, SslListener relay, int tries) throws Exception {
if (tries >= 5) {
throw new BindException("Unable to bind to several ports, most recently " + relay.getPort() + ". Giving up");
}
try {
if (server.isStarted()) {
... | java |
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
@Override
... | java |
public void cleanup() {
synchronized (_sslMap) {
for (SslRelayOdo relay : _sslMap.values()) {
if (relay.getHttpServer() != null && relay.isStarted()) {
relay.getHttpServer().removeListener(relay);
}
}
sslRelays.clear();
... | java |
public void removeOverride(int overrideId, int pathId, Integer ordinal, String clientUUID) {
// TODO: reorder priorities after removal
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
int enabledId = getEnabledEndpoint(pathId, override... | java |
public void increasePriority(int overrideId, int ordinal, int pathId, String clientUUID) {
logger.info("Increase priority");
int origPriority = -1;
int newPriority = -1;
int origId = 0;
int newId = 0;
PreparedStatement statement = null;
ResultSet results = null;... | java |
private static String preparePlaceHolders(int length) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < length; ) {
builder.append("?");
if (++i < length) {
builder.append(",");
}
}
return builder.toString();
} | java |
public void disableAllOverrides(int pathID, String clientUUID) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"DELETE FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
... | java |
public void disableAllOverrides(int pathID, String clientUUID, int overrideType) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
ArrayList<Integer> enabledOverrides = new ArrayList<Integer>();
enabledOverrides.add(Constants.PLU... | java |
public List<EnabledEndpoint> getEnabledEndpoints(int pathId, String clientUUID, String[] filters) throws Exception {
ArrayList<EnabledEndpoint> enabledOverrides = new ArrayList<EnabledEndpoint>();
PreparedStatement query = null;
ResultSet results = null;
try (Connection sqlConnection = ... | java |
public int getCurrentMethodOrdinal(int overrideId, int pathId, String clientUUID, String[] filters) throws Exception {
int currentOrdinal = 0;
List<EnabledEndpoint> enabledEndpoints = getEnabledEndpoints(pathId, clientUUID, filters);
for (EnabledEndpoint enabledEndpoint : enabledEndpoints) {
... | java |
private EnabledEndpoint getPartialEnabledEndpointFromResultset(ResultSet result) throws Exception {
EnabledEndpoint endpoint = new EnabledEndpoint();
endpoint.setId(result.getInt(Constants.GENERIC_ID));
endpoint.setPathId(result.getInt(Constants.ENABLED_OVERRIDES_PATH_ID));
endpoint.setO... | java |
public Integer getOverrideIdForMethod(String className, String methodName) {
Integer overrideId = null;
PreparedStatement query = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
query = sqlConnection.prepareStatement(
... | java |
public List<Client> findAllClients(int profileId) throws Exception {
ArrayList<Client> clients = new ArrayList<Client>();
PreparedStatement query = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
query = sqlConnection.prepareSta... | java |
public Client getClient(int clientId) throws Exception {
Client client = null;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String queryString = "SELECT * FROM " + Constants.DB_TABLE_CLIENT +
... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.