repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java
PathOverrideService.getSelectedPaths
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 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...
[ "public", "List", "<", "EndpointOverride", ">", "getSelectedPaths", "(", "int", "overrideType", ",", "Client", "client", ",", "Profile", "profile", ",", "String", "uri", ",", "Integer", "requestType", ",", "boolean", "pathTest", ")", "throws", "Exception", "{", ...
Obtain matching paths for a request @param overrideType type of override @param client Client @param profile Profile @param uri URI @param requestType type of request @param pathTest If true this will also match disabled paths @return Collection of matching endpoints @throws Exception exception
[ "Obtain", "matching", "paths", "for", "a", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L1526-L1593
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.isActive
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 boolean isActive(int profileId) { boolean active = false; PreparedStatement queryStatement = null; try (Connection sqlConnection = sqlService.getConnection()) { queryStatement = sqlConnection.prepareStatement( "SELECT " + Constants.CLIENT_IS_ACTIVE + " FROM " ...
[ "public", "boolean", "isActive", "(", "int", "profileId", ")", "{", "boolean", "active", "=", "false", ";", "PreparedStatement", "queryStatement", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", "...
Returns true if the default profile for the specified uuid is active @return true if active, otherwise false
[ "Returns", "true", "if", "the", "default", "profile", "for", "the", "specified", "uuid", "is", "active" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L61-L89
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.findAllProfiles
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 List<Profile> findAllProfiles() throws Exception { ArrayList<Profile> allProfiles = new ArrayList<>(); PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatemen...
[ "public", "List", "<", "Profile", ">", "findAllProfiles", "(", ")", "throws", "Exception", "{", "ArrayList", "<", "Profile", ">", "allProfiles", "=", "new", "ArrayList", "<>", "(", ")", ";", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "r...
Returns a collection of all profiles @return Collection of all Profiles @throws Exception exception
[ "Returns", "a", "collection", "of", "all", "profiles" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L97-L125
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.findProfile
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
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...
[ "public", "Profile", "findProfile", "(", "int", "profileId", ")", "throws", "Exception", "{", "Profile", "profile", "=", "null", ";", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "results", "=", "null", ";", "try", "(", "Connection", "sqlCo...
Returns a specific profile @param profileId ID of profile @return Selected profile if found, null if not found @throws Exception exception
[ "Returns", "a", "specific", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L134-L166
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.getProfileFromResultSet
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
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...
[ "private", "Profile", "getProfileFromResultSet", "(", "ResultSet", "result", ")", "throws", "Exception", "{", "Profile", "profile", "=", "new", "Profile", "(", ")", ";", "profile", ".", "setId", "(", "result", ".", "getInt", "(", "Constants", ".", "GENERIC_ID"...
Creates a Profile object from a SQL resultset @param result resultset containing the profile @return Profile @throws Exception exception
[ "Creates", "a", "Profile", "object", "from", "a", "SQL", "resultset" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L175-L182
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.add
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 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...
[ "public", "Profile", "add", "(", "String", "profileName", ")", "throws", "Exception", "{", "Profile", "profile", "=", "new", "Profile", "(", ")", ";", "int", "id", "=", "-", "1", ";", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "result...
Add a new profile with the profileName given. @param profileName name of new profile @return newly created profile @throws Exception exception
[ "Add", "a", "new", "profile", "with", "the", "profileName", "given", "." ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L191-L247
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.remove
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 void remove(int profileId) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement("DELETE FROM " + Constants.DB_TABLE_PROFILE + " WHERE "...
[ "public", "void", "remove", "(", "int", "profileId", ")", "{", "PreparedStatement", "statement", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ")", "{", "statement", "=", "sqlConnection", ".", ...
Deletes data associated with the given profile ID @param profileId ID of profile
[ "Deletes", "data", "associated", "with", "the", "given", "profile", "ID" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L256-L299
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.getNamefromId
public String getNamefromId(int id) { return (String) sqlService.getFromTable( Constants.PROFILE_PROFILE_NAME, Constants.GENERIC_ID, id, Constants.DB_TABLE_PROFILE); }
java
public String getNamefromId(int id) { return (String) sqlService.getFromTable( Constants.PROFILE_PROFILE_NAME, Constants.GENERIC_ID, id, Constants.DB_TABLE_PROFILE); }
[ "public", "String", "getNamefromId", "(", "int", "id", ")", "{", "return", "(", "String", ")", "sqlService", ".", "getFromTable", "(", "Constants", ".", "PROFILE_PROFILE_NAME", ",", "Constants", ".", "GENERIC_ID", ",", "id", ",", "Constants", ".", "DB_TABLE_PR...
Obtain the profile name associated with a profile ID @param id ID of profile @return Name of corresponding profile
[ "Obtain", "the", "profile", "name", "associated", "with", "a", "profile", "ID" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L307-L311
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java
ProfileService.getIdFromName
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 Integer getIdFromName(String profileName) { PreparedStatement query = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { query = sqlConnection.prepareStatement("SELECT * FROM " + Constants.DB_TABLE_PROFILE + ...
[ "public", "Integer", "getIdFromName", "(", "String", "profileName", ")", "{", "PreparedStatement", "query", "=", "null", ";", "ResultSet", "results", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ...
Obtain the ID associated with a profile name @param profileName profile name @return ID of profile
[ "Obtain", "the", "ID", "associated", "with", "a", "profile", "name" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ProfileService.java#L321-L353
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java
ControllerUtils.convertPathIdentifier
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 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 ==...
[ "public", "static", "Integer", "convertPathIdentifier", "(", "String", "identifier", ",", "Integer", "profileId", ")", "throws", "Exception", "{", "Integer", "pathId", "=", "-", "1", ";", "try", "{", "pathId", "=", "Integer", ".", "parseInt", "(", "identifier"...
Obtain the path ID for a profile @param identifier Can be the path ID, or friendly name @param profileId @return @throws Exception
[ "Obtain", "the", "path", "ID", "for", "a", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java#L36-L49
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java
ControllerUtils.convertProfileIdentifier
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 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...
[ "public", "static", "Integer", "convertProfileIdentifier", "(", "String", "profileIdentifier", ")", "throws", "Exception", "{", "Integer", "profileId", "=", "-", "1", ";", "if", "(", "profileIdentifier", "==", "null", ")", "{", "throw", "new", "Exception", "(", ...
Obtain the profile identifier. @param profileIdentifier Can be profile ID, or friendly name @return @throws Exception
[ "Obtain", "the", "profile", "identifier", "." ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java#L58-L74
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java
ControllerUtils.convertOverrideIdentifier
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 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...
[ "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", "...
Obtain override ID @param overrideIdentifier can be the override ID or class name @return @throws Exception
[ "Obtain", "override", "ID" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java#L83-L112
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java
ControllerUtils.convertProfileAndPathIdentifier
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 static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception { Identifiers id = new Identifiers(); Integer profileId = null; try { profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier); } catch ...
[ "public", "static", "Identifiers", "convertProfileAndPathIdentifier", "(", "String", "profileIdentifier", ",", "String", "pathIdentifier", ")", "throws", "Exception", "{", "Identifiers", "id", "=", "new", "Identifiers", "(", ")", ";", "Integer", "profileId", "=", "n...
Obtain the IDs of profile and path as Identifiers @param profileIdentifier actual ID or friendly name of profile @param pathIdentifier actual ID or friendly name of path @return @throws Exception
[ "Obtain", "the", "IDs", "of", "profile", "and", "path", "as", "Identifiers" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java#L122-L137
train
groupon/odo
client/src/main/java/com/groupon/odo/client/PathValueClient.java
PathValueClient.getPathFromEndpoint
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 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 (...
[ "public", "JSONObject", "getPathFromEndpoint", "(", "String", "pathValue", ",", "String", "requestType", ")", "throws", "Exception", "{", "int", "type", "=", "getRequestTypeFromString", "(", "requestType", ")", ";", "String", "url", "=", "BASE_PATH", ";", "JSONObj...
Retrieves the path using the endpoint value @param pathValue - path (endpoint) value @param requestType - "GET", "POST", etc @return Path or null @throws Exception exception
[ "Retrieves", "the", "path", "using", "the", "endpoint", "value" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L43-L55
train
groupon/odo
client/src/main/java/com/groupon/odo/client/PathValueClient.java
PathValueClient.setDefaultCustomResponse
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 setDefaultCustomResponse(String pathValue, String requestType, String customData) { try { JSONObject profile = getDefaultProfile(); String profileName = profile.getString("name"); PathValueClient client = new PathValueClient(profileName, false); ...
[ "public", "static", "boolean", "setDefaultCustomResponse", "(", "String", "pathValue", ",", "String", "requestType", ",", "String", "customData", ")", "{", "try", "{", "JSONObject", "profile", "=", "getDefaultProfile", "(", ")", ";", "String", "profileName", "=", ...
Sets a custom response on an endpoint using default profile and client @param pathValue path (endpoint) value @param requestType path request type. "GET", "POST", etc @param customData custom response data @return true if success, false otherwise
[ "Sets", "a", "custom", "response", "on", "an", "endpoint", "using", "default", "profile", "and", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L65-L75
train
groupon/odo
client/src/main/java/com/groupon/odo/client/PathValueClient.java
PathValueClient.removeDefaultCustomResponse
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 static boolean removeDefaultCustomResponse(String pathValue, String requestType) { try { JSONObject profile = getDefaultProfile(); String profileName = profile.getString("name"); PathValueClient client = new PathValueClient(profileName, false); return clien...
[ "public", "static", "boolean", "removeDefaultCustomResponse", "(", "String", "pathValue", ",", "String", "requestType", ")", "{", "try", "{", "JSONObject", "profile", "=", "getDefaultProfile", "(", ")", ";", "String", "profileName", "=", "profile", ".", "getString...
Remove any overrides for an endpoint on the default profile, client @param pathValue path (endpoint) value @param requestType path request type. "GET", "POST", etc @return true if success, false otherwise
[ "Remove", "any", "overrides", "for", "an", "endpoint", "on", "the", "default", "profile", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L84-L94
train
groupon/odo
client/src/main/java/com/groupon/odo/client/PathValueClient.java
PathValueClient.removeCustomResponse
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 removeCustomResponse(String pathValue, String requestType) { try { JSONObject path = getPathFromEndpoint(pathValue, requestType); if (path == null) { return false; } String pathId = path.getString("pathId"); return resetR...
[ "public", "boolean", "removeCustomResponse", "(", "String", "pathValue", ",", "String", "requestType", ")", "{", "try", "{", "JSONObject", "path", "=", "getPathFromEndpoint", "(", "pathValue", ",", "requestType", ")", ";", "if", "(", "path", "==", "null", ")",...
Remove any overrides for an endpoint @param pathValue path (endpoint) value @param requestType path request type. "GET", "POST", etc @return true if success, false otherwise
[ "Remove", "any", "overrides", "for", "an", "endpoint" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L103-L115
train
groupon/odo
client/src/main/java/com/groupon/odo/client/PathValueClient.java
PathValueClient.setCustomResponse
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
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); ...
[ "public", "boolean", "setCustomResponse", "(", "String", "pathValue", ",", "String", "requestType", ",", "String", "customData", ")", "{", "try", "{", "JSONObject", "path", "=", "getPathFromEndpoint", "(", "pathValue", ",", "requestType", ")", ";", "if", "(", ...
Sets a custom response on an endpoint @param pathValue path (endpoint) value @param requestType path request type. "GET", "POST", etc @param customData custom response data @return true if success, false otherwise
[ "Sets", "a", "custom", "response", "on", "an", "endpoint" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L125-L141
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java
ClientController.getClientList
@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", method = RequestMethod.GET) public @ResponseBody HashMap<String, Object> getClientList(Model model, @PathVariable("profileIdentifier") String profileIdentifier) throws Exception { Integer p...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile/{profileIdentifier}/clients\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "getClientList", "(", "Model", "model", ","...
Returns information about all clients for a profile @param model @param profileIdentifier @return @throws Exception
[ "Returns", "information", "about", "all", "clients", "for", "a", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java#L65-L73
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java
ClientController.getClient
@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/{clientUUID}", method = RequestMethod.GET) public @ResponseBody HashMap<String, Object> getClient(Model model, @PathVariable("profileIdentifier") String profileIdentifier, ...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile/{profileIdentifier}/clients/{clientUUID}\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "getClient", "(", "Model", "mode...
Returns information for a specific client @param model @param profileIdentifier @param clientUUID @return @throws Exception
[ "Returns", "information", "for", "a", "specific", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java#L84-L94
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java
ClientController.addClient
@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", method = RequestMethod.POST) public @ResponseBody HashMap<String, Object> addClient(Model model, @PathVariable("profileIdentifier") String profileIdentifier, @Reque...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile/{profileIdentifier}/clients\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "addClient", "(", "Model", "model", ",", ...
Returns a new client id for the profileIdentifier @param model @param profileIdentifier @return json with a new client_id @throws Exception
[ "Returns", "a", "new", "client", "id", "for", "the", "profileIdentifier" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java#L104-L128
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java
ClientController.updateClient
@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.POST) public @ResponseBody HashMap<String, Object> updateClient(Model model, @PathVariable("profileIdentifier") String profileIdentifier, ...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile/{profileIdentifier}/clients/{clientUUID}\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "updateClient", "(", "Model", "...
Update properties for a specific client id @param model @param profileIdentifier @param clientUUID @param active - true false depending on if the client should be active @param reset - true to reset the state of a client(clears settings for all paths and disables the client) @return @throws Exce...
[ "Update", "properties", "for", "a", "specific", "client", "id" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java#L141-L168
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java
ClientController.deleteClient
@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/{clientUUID}", method = RequestMethod.DELETE) public @ResponseBody HashMap<String, Object> deleteClient(Model model, @PathVariable("profileIdentifier") String profileIdentifier, ...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile/{profileIdentifier}/clients/{clientUUID}\"", ",", "method", "=", "RequestMethod", ".", "DELETE", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "deleteClient", "(", "Model", ...
Deletes a specific client id for a profile @param model @param profileIdentifier @param clientUUID @return returns the table of the remaining clients or an exception if deletion failed for some reason @throws Exception
[ "Deletes", "a", "specific", "client", "id", "for", "a", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java#L195-L211
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java
ClientController.deleteClient
@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/profile/{profileIdentifier}/clients/delete", method = RequestMethod.POST) public @ResponseBody HashMap<String, Object> deleteClient(Model model, @RequestParam("profileIdentifier") String profileIdentifier, ...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile/{profileIdentifier}/clients/delete\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "deleteClient", "(", "Model", "model"...
Bulk delete clients from a profile. @param model @param profileIdentifier @param clientUUID @return returns the table of the remaining clients or an exception if deletion failed for some reason @throws Exception
[ "Bulk", "delete", "clients", "from", "a", "profile", "." ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ClientController.java#L222-L245
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/PluginController.java
PluginController.getPluginInformation
@RequestMapping(value = "/api/plugins", method = RequestMethod.GET) public @ResponseBody HashMap<String, Object> getPluginInformation() { return pluginInformation(); }
java
@RequestMapping(value = "/api/plugins", method = RequestMethod.GET) public @ResponseBody HashMap<String, Object> getPluginInformation() { return pluginInformation(); }
[ "@", "RequestMapping", "(", "value", "=", "\"/api/plugins\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "getPluginInformation", "(", ")", "{", "return", "pluginInformation",...
Obtain plugin information @return
[ "Obtain", "plugin", "information" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/PluginController.java#L41-L46
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/PluginController.java
PluginController.addPluginPath
@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
@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(); }
[ "@", "RequestMapping", "(", "value", "=", "\"/api/plugins\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "addPluginPath", "(", "Model", "model", ",", "Plugin", "add", ")...
Add a plugin path @param model @param add @return @throws Exception
[ "Add", "a", "plugin", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/PluginController.java#L66-L73
train
groupon/odo
examples/api-usage/src/main/java/com/groupon/odo/sample/SampleClient.java
SampleClient.addOverrideToPath
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 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...
[ "public", "static", "void", "addOverrideToPath", "(", ")", "throws", "Exception", "{", "Client", "client", "=", "new", "Client", "(", "\"ProfileName\"", ",", "false", ")", ";", "// Use the fully qualified name for a plugin override.", "client", ".", "addMethodToResponse...
Demonstrates how to add an override to an existing path
[ "Demonstrates", "how", "to", "add", "an", "override", "to", "an", "existing", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/examples/api-usage/src/main/java/com/groupon/odo/sample/SampleClient.java#L42-L52
train
groupon/odo
examples/api-usage/src/main/java/com/groupon/odo/sample/SampleClient.java
SampleClient.getHistory
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
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(); }
[ "public", "static", "void", "getHistory", "(", ")", "throws", "Exception", "{", "Client", "client", "=", "new", "Client", "(", "\"ProfileName\"", ",", "false", ")", ";", "// Obtain the 100 history entries starting from offset 0", "History", "[", "]", "history", "=",...
Demonstrates obtaining the request history data from a test run
[ "Demonstrates", "obtaining", "the", "request", "history", "data", "from", "a", "test", "run" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/examples/api-usage/src/main/java/com/groupon/odo/sample/SampleClient.java#L99-L106
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java
ProfileController.list
@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 = "/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 "...
[ "@", "RequestMapping", "(", "value", "=", "\"/profiles\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "String", "list", "(", "Model", "model", ")", "{", "Profile", "profiles", "=", "new", "Profile", "(", ")", ";", "model", ".", "addA...
This is the profiles page. this is the 'regular' page when the url is typed in
[ "This", "is", "the", "profiles", "page", ".", "this", "is", "the", "regular", "page", "when", "the", "url", "is", "typed", "in" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java#L50-L58
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java
ProfileController.getList
@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.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"); }
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "getList", "(", "Model", "model", ")", "throws", "Exception", "{"...
Obtain collection of profiles @param model @return @throws Exception
[ "Obtain", "collection", "of", "profiles" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java#L67-L73
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java
ProfileController.addProfile
@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.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...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "addProfile", "(", "Model", "model", ",", "String", "name", ")",...
Add profile to database, return collection of profile data. Called when 'enter' is hit in the UI instead of 'submit' button @param model @param name @return @throws Exception
[ "Add", "profile", "to", "database", "return", "collection", "of", "profile", "data", ".", "Called", "when", "enter", "is", "hit", "in", "the", "UI", "instead", "of", "submit", "button" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java#L84-L90
train
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java
ProfileController.deleteProfile
@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
@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"); }
[ "@", "RequestMapping", "(", "value", "=", "\"/api/profile\"", ",", "method", "=", "RequestMethod", ".", "DELETE", ")", "public", "@", "ResponseBody", "HashMap", "<", "String", ",", "Object", ">", "deleteProfile", "(", "Model", "model", ",", "int", "id", ")",...
Delete a profile @param model @param id @return @throws Exception
[ "Delete", "a", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ProfileController.java#L100-L106
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java
HistoryService.cullHistory
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 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 ...
[ "public", "void", "cullHistory", "(", "final", "int", "profileId", ",", "final", "String", "clientUUID", ",", "final", "int", "limit", ")", "throws", "Exception", "{", "//Allow only 1 delete thread to run", "if", "(", "threadActive", ")", "{", "return", ";", "}"...
Removes old entries in the history table for the given profile and client UUID @param profileId ID of profile @param clientUUID UUID of client @param limit Maximum number of history entries to remove @throws Exception exception
[ "Removes", "old", "entries", "in", "the", "history", "table", "for", "the", "given", "profile", "and", "client", "UUID" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java#L81-L151
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java
HistoryService.getHistoryCount
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 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...
[ "public", "int", "getHistoryCount", "(", "int", "profileId", ",", "String", "clientUUID", ",", "HashMap", "<", "String", ",", "String", "[", "]", ">", "searchFilter", ")", "{", "int", "count", "=", "0", ";", "Statement", "query", "=", "null", ";", "Resul...
Returns the number of history entries for a client @param profileId ID of profile @param clientUUID UUID of client @param searchFilter unused @return number of history entries
[ "Returns", "the", "number", "of", "history", "entries", "for", "a", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java#L311-L357
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java
HistoryService.getHistoryForID
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 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 + ...
[ "public", "History", "getHistoryForID", "(", "int", "id", ")", "{", "History", "history", "=", "null", ";", "PreparedStatement", "query", "=", "null", ";", "ResultSet", "results", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ...
Get history for a specific database ID @param id ID of history entry @return History entry
[ "Get", "history", "for", "a", "specific", "database", "ID" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java#L478-L510
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java
HistoryService.clearHistory
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 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...
[ "public", "void", "clearHistory", "(", "int", "profileId", ",", "String", "clientUUID", ")", "{", "PreparedStatement", "query", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ")", "{", "String", ...
Clear history for a client @param profileId ID of profile @param clientUUID UUID of client
[ "Clear", "history", "for", "a", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java#L518-L548
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.destroy
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 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) { ...
[ "public", "void", "destroy", "(", ")", "throws", "Exception", "{", "if", "(", "_clientId", "==", "null", ")", "{", "return", ";", "}", "// delete the clientId here", "String", "uri", "=", "BASE_PROFILE", "+", "uriEncode", "(", "_profileName", ")", "+", "\"/\...
Call when you are done with the client @throws Exception
[ "Call", "when", "you", "are", "done", "with", "the", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L145-L158
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setHostName
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 void setHostName(String hostName) { if (hostName == null || hostName.contains(":")) { return; } ODO_HOST = hostName; BASE_URL = "http://" + ODO_HOST + ":" + API_PORT + "/" + API_BASE + "/"; }
[ "public", "void", "setHostName", "(", "String", "hostName", ")", "{", "if", "(", "hostName", "==", "null", "||", "hostName", ".", "contains", "(", "\":\"", ")", ")", "{", "return", ";", "}", "ODO_HOST", "=", "hostName", ";", "BASE_URL", "=", "\"http://\"...
Set the host running the Odo instance to configure @param hostName name of host
[ "Set", "the", "host", "running", "the", "Odo", "instance", "to", "configure" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L195-L201
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setDefaultHostName
public static void setDefaultHostName(String hostName) { if (hostName == null || hostName.contains(":")) { return; } DEFAULT_BASE_URL = "http://" + hostName + ":" + DEFAULT_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 + "/"; }
[ "public", "static", "void", "setDefaultHostName", "(", "String", "hostName", ")", "{", "if", "(", "hostName", "==", "null", "||", "hostName", ".", "contains", "(", "\":\"", ")", ")", "{", "return", ";", "}", "DEFAULT_BASE_URL", "=", "\"http://\"", "+", "ho...
Set the default host running the Odo instance to configure. Allows default profile methods and PathValueClient to operate on remote hosts @param hostName name of host
[ "Set", "the", "default", "host", "running", "the", "Odo", "instance", "to", "configure", ".", "Allows", "default", "profile", "methods", "and", "PathValueClient", "to", "operate", "on", "remote", "hosts" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L209-L214
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.filterHistory
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[] 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[]...
[ "public", "History", "[", "]", "filterHistory", "(", "String", "...", "filters", ")", "throws", "Exception", "{", "BasicNameValuePair", "[", "]", "params", ";", "if", "(", "filters", ".", "length", ">", "0", ")", "{", "params", "=", "new", "BasicNameValueP...
Retrieve the request History based on the specified filters. If no filter is specified, return the default size history. @param filters filters to be applied @return array of History items @throws Exception exception
[ "Retrieve", "the", "request", "History", "based", "on", "the", "specified", "filters", ".", "If", "no", "filter", "is", "specified", "return", "the", "default", "size", "history", "." ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L224-L236
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.refreshHistory
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 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); }
[ "public", "History", "[", "]", "refreshHistory", "(", "int", "limit", ",", "int", "offset", ")", "throws", "Exception", "{", "BasicNameValuePair", "[", "]", "params", "=", "{", "new", "BasicNameValuePair", "(", "\"limit\"", ",", "String", ".", "valueOf", "("...
refresh the most recent history entries @param limit number of entries to populate @param offset number of most recent entries to skip @return populated history entries @throws Exception exception
[ "refresh", "the", "most", "recent", "history", "entries" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L366-L372
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.clearHistory
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 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"); } }
[ "public", "void", "clearHistory", "(", ")", "throws", "Exception", "{", "String", "uri", ";", "try", "{", "uri", "=", "HISTORY", "+", "uriEncode", "(", "_profileName", ")", ";", "doDelete", "(", "uri", ",", "null", ")", ";", "}", "catch", "(", "Excepti...
Delete the proxy history for the active profile @throws Exception exception
[ "Delete", "the", "proxy", "history", "for", "the", "active", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L379-L387
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.toggleProfile
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 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 + ...
[ "public", "boolean", "toggleProfile", "(", "Boolean", "enabled", ")", "{", "// TODO: make this return values properly", "BasicNameValuePair", "[", "]", "params", "=", "{", "new", "BasicNameValuePair", "(", "\"active\"", ",", "enabled", ".", "toString", "(", ")", ")"...
Turn this profile on or off @param enabled true or false @return true on success, false otherwise
[ "Turn", "this", "profile", "on", "or", "off" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L403-L422
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setCustomResponse
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 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...
[ "public", "boolean", "setCustomResponse", "(", "String", "pathName", ",", "String", "customResponse", ")", "throws", "Exception", "{", "// figure out the new ordinal", "int", "nextOrdinal", "=", "this", ".", "getNextOrdinalForMethodId", "(", "-", "1", ",", "pathName",...
Set a custom response for this path @param pathName name of path @param customResponse value of custom response @return true if success, false otherwise @throws Exception exception
[ "Set", "a", "custom", "response", "for", "this", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L568-L577
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.addMethodToResponseOverride
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 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...
[ "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", "=", "g...
Add a method to the enabled response overrides for a path @param pathName name of path @param methodName name of method @return true if success, false otherwise
[ "Add", "a", "method", "to", "the", "enabled", "response", "overrides", "for", "a", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L617-L641
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setOverrideRepeatCount
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 setOverrideRepeatCount(String pathName, String methodName, Integer ordinal, Integer repeatCount) { try { String methodId = getOverrideIdForMethodName(methodName).toString(); BasicNameValuePair[] params = { new BasicNameValuePair("profileIdentifier", this._p...
[ "public", "boolean", "setOverrideRepeatCount", "(", "String", "pathName", ",", "String", "methodName", ",", "Integer", "ordinal", ",", "Integer", "repeatCount", ")", "{", "try", "{", "String", "methodId", "=", "getOverrideIdForMethodName", "(", "methodName", ")", ...
Set the repeat count of an override at ordinal index @param pathName Path name @param methodName Fully qualified method name @param ordinal 1-based index of the override within the overrides of type methodName @param repeatCount new repeat count to set @return true if success, false otherwise
[ "Set", "the", "repeat", "count", "of", "an", "override", "at", "ordinal", "index" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L652-L667
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setMethodArguments
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 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...
[ "public", "boolean", "setMethodArguments", "(", "String", "pathName", ",", "String", "methodName", ",", "Integer", "ordinal", ",", "Object", "...", "arguments", ")", "{", "try", "{", "BasicNameValuePair", "[", "]", "params", "=", "new", "BasicNameValuePair", "["...
Set the method arguments for an enabled method override @param pathName Path name @param methodName Fully qualified method name @param ordinal 1-based index of the override within the overrides of type methodName @param arguments Array of arguments to set(specify all arguments) @return true if success, false otherwise
[ "Set", "the", "method", "arguments", "for", "an", "enabled", "method", "override" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L704-L723
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.createPath
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
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...
[ "public", "void", "createPath", "(", "String", "pathName", ",", "String", "pathValue", ",", "String", "requestType", ")", "{", "try", "{", "int", "type", "=", "getRequestTypeFromString", "(", "requestType", ")", ";", "String", "url", "=", "BASE_PATH", ";", "...
Create a new path @param pathName friendly name of path @param pathValue path value or regex @param requestType path request type. "GET", "POST", etc
[ "Create", "a", "new", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L767-L782
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setCustomForDefaultClient
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
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...
[ "protected", "static", "boolean", "setCustomForDefaultClient", "(", "String", "profileName", ",", "String", "pathName", ",", "Boolean", "isResponse", ",", "String", "customData", ")", "{", "try", "{", "Client", "client", "=", "new", "Client", "(", "profileName", ...
set custom response or request for a profile's default client, ensures profile and path are enabled @param profileName profileName to modift, default client is used @param pathName friendly name of path @param isResponse true if response, false for request @param customData custom response/request data @return true if...
[ "set", "custom", "response", "or", "request", "for", "a", "profile", "s", "default", "client", "ensures", "profile", "and", "path", "are", "enabled" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L793-L808
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setCustomRequestForDefaultClient
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 setCustomRequestForDefaultClient(String profileName, String pathName, String customData) { try { return setCustomForDefaultClient(profileName, pathName, false, customData); } catch (Exception e) { e.printStackTrace(); } return false; }
[ "public", "static", "boolean", "setCustomRequestForDefaultClient", "(", "String", "profileName", ",", "String", "pathName", ",", "String", "customData", ")", "{", "try", "{", "return", "setCustomForDefaultClient", "(", "profileName", ",", "pathName", ",", "false", "...
set custom request for profile's default client @param profileName profileName to modify @param pathName friendly name of path @param customData custom request data @return true if success, false otherwise
[ "set", "custom", "request", "for", "profile", "s", "default", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L818-L825
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setCustomResponseForDefaultClient
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 setCustomResponseForDefaultClient(String profileName, String pathName, String customData) { try { return setCustomForDefaultClient(profileName, pathName, true, customData); } catch (Exception e) { e.printStackTrace(); } return false; }
[ "public", "static", "boolean", "setCustomResponseForDefaultClient", "(", "String", "profileName", ",", "String", "pathName", ",", "String", "customData", ")", "{", "try", "{", "return", "setCustomForDefaultClient", "(", "profileName", ",", "pathName", ",", "true", "...
set custom response for profile's default client @param profileName profileName to modify @param pathName friendly name of path @param customData custom request data @return true if success, false otherwise
[ "set", "custom", "response", "for", "profile", "s", "default", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L835-L842
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setCustomRequestForDefaultProfile
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 setCustomRequestForDefaultProfile(String pathName, String customData) { try { return setCustomForDefaultProfile(pathName, false, customData); } catch (Exception e) { e.printStackTrace(); } return false; }
[ "public", "static", "boolean", "setCustomRequestForDefaultProfile", "(", "String", "pathName", ",", "String", "customData", ")", "{", "try", "{", "return", "setCustomForDefaultProfile", "(", "pathName", ",", "false", ",", "customData", ")", ";", "}", "catch", "(",...
set custom request for the default profile's default client @param pathName friendly name of path @param customData custom response/request data @return true if success, false otherwise
[ "set", "custom", "request", "for", "the", "default", "profile", "s", "default", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L871-L878
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setCustomResponseForDefaultProfile
public static boolean setCustomResponseForDefaultProfile(String pathName, String customData) { try { return setCustomForDefaultProfile(pathName, true, 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; }
[ "public", "static", "boolean", "setCustomResponseForDefaultProfile", "(", "String", "pathName", ",", "String", "customData", ")", "{", "try", "{", "return", "setCustomForDefaultProfile", "(", "pathName", ",", "true", ",", "customData", ")", ";", "}", "catch", "(",...
set custom response for the default profile's default client @param pathName friendly name of path @param customData custom response/request data @return true if success, false otherwise
[ "set", "custom", "response", "for", "the", "default", "profile", "s", "default", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L887-L894
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.getDefaultProfile
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
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) { ...
[ "protected", "static", "JSONObject", "getDefaultProfile", "(", ")", "throws", "Exception", "{", "String", "uri", "=", "DEFAULT_BASE_URL", "+", "BASE_PROFILE", ";", "try", "{", "JSONObject", "response", "=", "new", "JSONObject", "(", "doGet", "(", "uri", ",", "...
get the default profile @return representation of default profile @throws Exception exception
[ "get", "the", "default", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L902-L917
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.getNextOrdinalForMethodId
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
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...
[ "private", "Integer", "getNextOrdinalForMethodId", "(", "int", "methodId", ",", "String", "pathName", ")", "throws", "Exception", "{", "String", "pathInfo", "=", "doGet", "(", "BASE_PATH", "+", "uriEncode", "(", "pathName", ")", ",", "new", "BasicNameValuePair", ...
Get the next available ordinal for a method ID @param methodId ID of method @return value of next ordinal @throws Exception exception
[ "Get", "the", "next", "available", "ordinal", "for", "a", "method", "ID" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L932-L944
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.getRequestTypeFromString
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
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; ...
[ "protected", "int", "getRequestTypeFromString", "(", "String", "requestType", ")", "{", "if", "(", "\"GET\"", ".", "equals", "(", "requestType", ")", ")", "{", "return", "REQUEST_TYPE_GET", ";", "}", "if", "(", "\"POST\"", ".", "equals", "(", "requestType", ...
Convert a request type string to value @param requestType String value of request type GET/POST/PUT/DELETE @return Matching REQUEST_TYPE. Defaults to ALL
[ "Convert", "a", "request", "type", "string", "to", "value" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L957-L971
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.addServerMapping
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 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...
[ "public", "ServerRedirect", "addServerMapping", "(", "String", "sourceHost", ",", "String", "destinationHost", ",", "String", "hostHeader", ")", "{", "JSONObject", "response", "=", "null", ";", "ArrayList", "<", "BasicNameValuePair", ">", "params", "=", "new", "Ar...
Add a new server mapping to current profile @param sourceHost source hostname @param destinationHost destination hostname @param hostHeader host header @return ServerRedirect
[ "Add", "a", "new", "server", "mapping", "to", "current", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1011-L1031
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.deleteServerMapping
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> 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(); ...
[ "public", "List", "<", "ServerRedirect", ">", "deleteServerMapping", "(", "int", "serverMappingId", ")", "{", "ArrayList", "<", "ServerRedirect", ">", "servers", "=", "new", "ArrayList", "<", "ServerRedirect", ">", "(", ")", ";", "try", "{", "JSONArray", "serv...
Remove a server mapping from current profile by ID @param serverMappingId server mapping ID @return Collection of updated ServerRedirects
[ "Remove", "a", "server", "mapping", "from", "current", "profile", "by", "ID" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1039-L1056
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.getServerMappings
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 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 < ...
[ "public", "List", "<", "ServerRedirect", ">", "getServerMappings", "(", ")", "{", "ArrayList", "<", "ServerRedirect", ">", "servers", "=", "new", "ArrayList", "<", "ServerRedirect", ">", "(", ")", ";", "try", "{", "JSONObject", "response", "=", "new", "JSONO...
Get a list of all active server mappings defined for current profile @return Collection of ServerRedirects
[ "Get", "a", "list", "of", "all", "active", "server", "mappings", "defined", "for", "current", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1063-L1081
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.updateServerRedirectHost
public ServerRedirect updateServerRedirectHost(int serverMappingId, String hostHeader) { ServerRedirect redirect = new ServerRedirect(); BasicNameValuePair[] params = { new BasicNameValuePair("hostHeader", hostHeader), new BasicNameValuePair("profileIdentifier", this._profileName...
java
public ServerRedirect updateServerRedirectHost(int serverMappingId, String hostHeader) { ServerRedirect redirect = new ServerRedirect(); BasicNameValuePair[] params = { new BasicNameValuePair("hostHeader", hostHeader), new BasicNameValuePair("profileIdentifier", this._profileName...
[ "public", "ServerRedirect", "updateServerRedirectHost", "(", "int", "serverMappingId", ",", "String", "hostHeader", ")", "{", "ServerRedirect", "redirect", "=", "new", "ServerRedirect", "(", ")", ";", "BasicNameValuePair", "[", "]", "params", "=", "{", "new", "Bas...
Update server mapping's host header @param serverMappingId ID of server mapping @param hostHeader value of host header @return updated ServerRedirect
[ "Update", "server", "mapping", "s", "host", "header" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1159-L1173
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.addServerGroup
public ServerGroup addServerGroup(String groupName) { ServerGroup group = new ServerGroup(); BasicNameValuePair[] params = { new BasicNameValuePair("name", groupName), new BasicNameValuePair("profileIdentifier", this._profileName) }; try { JSONObject ...
java
public ServerGroup addServerGroup(String groupName) { ServerGroup group = new ServerGroup(); BasicNameValuePair[] params = { new BasicNameValuePair("name", groupName), new BasicNameValuePair("profileIdentifier", this._profileName) }; try { JSONObject ...
[ "public", "ServerGroup", "addServerGroup", "(", "String", "groupName", ")", "{", "ServerGroup", "group", "=", "new", "ServerGroup", "(", ")", ";", "BasicNameValuePair", "[", "]", "params", "=", "{", "new", "BasicNameValuePair", "(", "\"name\"", ",", "groupName",...
Create a new server group @param groupName name of server group @return Created ServerGroup
[ "Create", "a", "new", "server", "group" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1205-L1220
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.getServerGroups
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 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...
[ "public", "List", "<", "ServerGroup", ">", "getServerGroups", "(", ")", "{", "ArrayList", "<", "ServerGroup", ">", "groups", "=", "new", "ArrayList", "<", "ServerGroup", ">", "(", ")", ";", "try", "{", "JSONObject", "response", "=", "new", "JSONObject", "(...
Get the collection of the server groups @return Collection of active server groups
[ "Get", "the", "collection", "of", "the", "server", "groups" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1249-L1265
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.updateServerGroupName
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 ServerGroup updateServerGroupName(int serverGroupId, String name) { ServerGroup serverGroup = null; BasicNameValuePair[] params = { new BasicNameValuePair("name", name), new BasicNameValuePair("profileIdentifier", this._profileName) }; try { JSO...
[ "public", "ServerGroup", "updateServerGroupName", "(", "int", "serverGroupId", ",", "String", "name", ")", "{", "ServerGroup", "serverGroup", "=", "null", ";", "BasicNameValuePair", "[", "]", "params", "=", "{", "new", "BasicNameValuePair", "(", "\"name\"", ",", ...
Update the server group's name @param serverGroupId ID of server group @param name new name of server group @return updated ServerGroup
[ "Update", "the", "server", "group", "s", "name" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1274-L1288
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.uploadConfigurationAndProfile
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 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...
[ "public", "boolean", "uploadConfigurationAndProfile", "(", "String", "fileName", ",", "String", "odoImport", ")", "{", "File", "file", "=", "new", "File", "(", "fileName", ")", ";", "MultipartEntityBuilder", "multipartEntityBuilder", "=", "MultipartEntityBuilder", "."...
Upload file and set odo overrides and configuration of odo @param fileName File containing configuration @param odoImport Import odo configuration in addition to overrides @return If upload was successful
[ "Upload", "file", "and", "set", "odo", "overrides", "and", "configuration", "of", "odo" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1347-L1364
train
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.exportConfigurationAndProfile
public JSONObject exportConfigurationAndProfile(String oldExport) { try { BasicNameValuePair[] params = { new BasicNameValuePair("oldExport", oldExport) }; String url = BASE_BACKUP_PROFILE + "/" + uriEncode(this._profileName) + "/" + this._clientId; ...
java
public JSONObject exportConfigurationAndProfile(String oldExport) { try { BasicNameValuePair[] params = { new BasicNameValuePair("oldExport", oldExport) }; String url = BASE_BACKUP_PROFILE + "/" + uriEncode(this._profileName) + "/" + this._clientId; ...
[ "public", "JSONObject", "exportConfigurationAndProfile", "(", "String", "oldExport", ")", "{", "try", "{", "BasicNameValuePair", "[", "]", "params", "=", "{", "new", "BasicNameValuePair", "(", "\"oldExport\"", ",", "oldExport", ")", "}", ";", "String", "url", "=...
Export the odo overrides setup and odo configuration @param oldExport Whether this is a backup from scratch or backing up because user will upload after (matches API) @return The odo configuration and overrides in JSON format, can be written to a file after
[ "Export", "the", "odo", "overrides", "setup", "and", "odo", "configuration" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1372-L1382
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java
BackupService.getGroups
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
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(); ...
[ "private", "List", "<", "Group", ">", "getGroups", "(", ")", "throws", "Exception", "{", "List", "<", "Group", ">", "groups", "=", "new", "ArrayList", "<", "Group", ">", "(", ")", ";", "List", "<", "Group", ">", "sourceGroups", "=", "PathOverrideService"...
Get all Groups @return @throws Exception
[ "Get", "all", "Groups" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java#L77-L100
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java
BackupService.getProfileBackupData
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 SingleProfileBackup getProfileBackupData(int profileID, String clientUUID) throws Exception { SingleProfileBackup singleProfileBackup = new SingleProfileBackup(); List<PathOverride> enabledPaths = new ArrayList<>(); List<EndpointOverride> paths = PathOverrideService.getInstance().getPath...
[ "public", "SingleProfileBackup", "getProfileBackupData", "(", "int", "profileID", ",", "String", "clientUUID", ")", "throws", "Exception", "{", "SingleProfileBackup", "singleProfileBackup", "=", "new", "SingleProfileBackup", "(", ")", ";", "List", "<", "PathOverride", ...
Get the active overrides with parameters and the active server group for a client @param profileID Id of profile to get configuration for @param clientUUID Client Id to export configuration @return SingleProfileBackup containing active overrides and active server group @throws Exception exception
[ "Get", "the", "active", "overrides", "with", "parameters", "and", "the", "active", "server", "group", "for", "a", "client" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java#L133-L160
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java
BackupService.getBackupData
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
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())...
[ "public", "Backup", "getBackupData", "(", ")", "throws", "Exception", "{", "Backup", "backupData", "=", "new", "Backup", "(", ")", ";", "backupData", ".", "setGroups", "(", "getGroups", "(", ")", ")", ";", "backupData", ".", "setProfiles", "(", "getProfiles"...
Return the structured backup data @return Backup of current configuration @throws Exception exception
[ "Return", "the", "structured", "backup", "data" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java#L188-L198
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java
BackupService.getServerForName
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
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...
[ "private", "MBeanServer", "getServerForName", "(", "String", "name", ")", "{", "try", "{", "MBeanServer", "mbeanServer", "=", "null", ";", "final", "ObjectName", "objectNameQuery", "=", "new", "ObjectName", "(", "name", "+", "\":type=Service,*\"", ")", ";", "for...
Returns an MBeanServer with the specified name @param name @return
[ "Returns", "an", "MBeanServer", "with", "the", "specified", "name" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java#L396-L414
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.setProxyRequestHeaders
@SuppressWarnings("unchecked") private void setProxyRequestHeaders(HttpServletRequest httpServletRequest, HttpMethod httpMethodProxyRequest) throws Exception { RequestInformation requestInfo = requestInformation.get(); String hostName = HttpUtilities.getHostNa...
java
@SuppressWarnings("unchecked") private void setProxyRequestHeaders(HttpServletRequest httpServletRequest, HttpMethod httpMethodProxyRequest) throws Exception { RequestInformation requestInfo = requestInformation.get(); String hostName = HttpUtilities.getHostNa...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "setProxyRequestHeaders", "(", "HttpServletRequest", "httpServletRequest", ",", "HttpMethod", "httpMethodProxyRequest", ")", "throws", "Exception", "{", "RequestInformation", "requestInfo", "=", "request...
Retrieves all of the headers from the servlet request and sets them on the proxy request @param httpServletRequest The request object representing the client's request to the servlet engine @param httpMethodProxyRequest The request that we are about to send to the proxy host
[ "Retrieves", "all", "of", "the", "headers", "from", "the", "servlet", "request", "and", "sets", "them", "on", "the", "proxy", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L410-L480
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.processRequestHeaderOverrides
private void processRequestHeaderOverrides(HttpMethod httpMethodProxyRequest) throws Exception { RequestInformation requestInfo = requestInformation.get(); for (EndpointOverride selectedPath : requestInfo.selectedRequestPaths) { List<EnabledEndpoint> points = selectedPath.getEnabledEndpoints...
java
private void processRequestHeaderOverrides(HttpMethod httpMethodProxyRequest) throws Exception { RequestInformation requestInfo = requestInformation.get(); for (EndpointOverride selectedPath : requestInfo.selectedRequestPaths) { List<EnabledEndpoint> points = selectedPath.getEnabledEndpoints...
[ "private", "void", "processRequestHeaderOverrides", "(", "HttpMethod", "httpMethodProxyRequest", ")", "throws", "Exception", "{", "RequestInformation", "requestInfo", "=", "requestInformation", ".", "get", "(", ")", ";", "for", "(", "EndpointOverride", "selectedPath", "...
Apply any applicable header overrides to request @param httpMethodProxyRequest @throws Exception
[ "Apply", "any", "applicable", "header", "overrides", "to", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L488-L503
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.getHostHeaderForHost
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 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...
[ "private", "String", "getHostHeaderForHost", "(", "String", "hostName", ")", "{", "List", "<", "ServerRedirect", ">", "servers", "=", "serverRedirectService", ".", "tableServers", "(", "requestInformation", ".", "get", "(", ")", ".", "client", ".", "getId", "(",...
Obtain host header value for a hostname @param hostName @return
[ "Obtain", "host", "header", "value", "for", "a", "hostname" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L511-L523
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.processClientId
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 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) !=...
[ "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", "(", "httpServ...
Apply the matching client UUID for the request @param httpServletRequest @param history
[ "Apply", "the", "matching", "client", "UUID", "for", "the", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L531-L541
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.getApplicablePathNames
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 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...
[ "private", "JSONArray", "getApplicablePathNames", "(", "String", "requestUrl", ",", "Integer", "requestType", ")", "throws", "Exception", "{", "RequestInformation", "requestInfo", "=", "requestInformation", ".", "get", "(", ")", ";", "List", "<", "EndpointOverride", ...
Get the names of the paths that would apply to the request @param requestUrl URL of the request @param requestType Type of the request: GET, POST, PUT, or DELETE as integer @return JSONArray of path names @throws Exception
[ "Get", "the", "names", "of", "the", "paths", "that", "would", "apply", "to", "the", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L551-L568
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.getDestinationHostName
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 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...
[ "private", "String", "getDestinationHostName", "(", "String", "hostName", ")", "{", "List", "<", "ServerRedirect", ">", "servers", "=", "serverRedirectService", ".", "tableServers", "(", "requestInformation", ".", "get", "(", ")", ".", "client", ".", "getId", "(...
Obtain the destination hostname for a source host @param hostName @return
[ "Obtain", "the", "destination", "hostname", "for", "a", "source", "host" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L676-L694
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.processVirtualHostName
private void processVirtualHostName(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest) { String virtualHostName; if (httpMethodProxyRequest.getRequestHeader(STRING_HOST_HEADER_NAME) != null) { virtualHostName = HttpUtilities.removePortFromHostHeaderString(httpMethodPro...
java
private void processVirtualHostName(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest) { String virtualHostName; if (httpMethodProxyRequest.getRequestHeader(STRING_HOST_HEADER_NAME) != null) { virtualHostName = HttpUtilities.removePortFromHostHeaderString(httpMethodPro...
[ "private", "void", "processVirtualHostName", "(", "HttpMethod", "httpMethodProxyRequest", ",", "HttpServletRequest", "httpServletRequest", ")", "{", "String", "virtualHostName", ";", "if", "(", "httpMethodProxyRequest", ".", "getRequestHeader", "(", "STRING_HOST_HEADER_NAME",...
Set virtual host so the server can direct the request. Value is the host header if it is set, otherwise use the hostname from the original request. @param httpMethodProxyRequest @param httpServletRequest
[ "Set", "virtual", "host", "so", "the", "server", "can", "direct", "the", "request", ".", "Value", "is", "the", "host", "header", "if", "it", "is", "set", "otherwise", "use", "the", "hostname", "from", "the", "original", "request", "." ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L791-L799
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.cullDisabledPaths
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 void cullDisabledPaths() throws Exception { ArrayList<EndpointOverride> removePaths = new ArrayList<EndpointOverride>(); RequestInformation requestInfo = requestInformation.get(); for (EndpointOverride selectedPath : requestInfo.selectedResponsePaths) { // check repeat coun...
[ "private", "void", "cullDisabledPaths", "(", ")", "throws", "Exception", "{", "ArrayList", "<", "EndpointOverride", ">", "removePaths", "=", "new", "ArrayList", "<", "EndpointOverride", ">", "(", ")", ";", "RequestInformation", "requestInfo", "=", "requestInformatio...
Remove paths with no active overrides @throws Exception
[ "Remove", "paths", "with", "no", "active", "overrides" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L806-L827
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.getRemoveHeaders
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 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...
[ "private", "ArrayList", "<", "String", ">", "getRemoveHeaders", "(", ")", "throws", "Exception", "{", "ArrayList", "<", "String", ">", "headersToRemove", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "EndpointOverride", "selectedPath"...
Obtain collection of headers to remove @return @throws Exception
[ "Obtain", "collection", "of", "headers", "to", "remove" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L864-L885
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.executeProxyRequest
private void executeProxyRequest(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, History history) { try { RequestInformation requestInfo = requestInformation.g...
java
private void executeProxyRequest(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, History history) { try { RequestInformation requestInfo = requestInformation.g...
[ "private", "void", "executeProxyRequest", "(", "HttpMethod", "httpMethodProxyRequest", ",", "HttpServletRequest", "httpServletRequest", ",", "HttpServletResponse", "httpServletResponse", ",", "History", "history", ")", "{", "try", "{", "RequestInformation", "requestInfo", "...
Execute a request through Odo processing @param httpMethodProxyRequest @param httpServletRequest @param httpServletResponse @param history
[ "Execute", "a", "request", "through", "Odo", "processing" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L895-L947
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.executeRequest
private void executeRequest(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest, PluginResponse httpServletResponse, History history) throws Exception { int intProxyResponseCode = 999; //...
java
private void executeRequest(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest, PluginResponse httpServletResponse, History history) throws Exception { int intProxyResponseCode = 999; //...
[ "private", "void", "executeRequest", "(", "HttpMethod", "httpMethodProxyRequest", ",", "HttpServletRequest", "httpServletRequest", ",", "PluginResponse", "httpServletResponse", ",", "History", "history", ")", "throws", "Exception", "{", "int", "intProxyResponseCode", "=", ...
Execute a request @param httpMethodProxyRequest @param httpServletRequest @param httpServletResponse @param history @throws Exception
[ "Execute", "a", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L958-L1047
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.processRedirect
private void processRedirect(String stringStatusCode, HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { // Check if the proxy res...
java
private void processRedirect(String stringStatusCode, HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { // Check if the proxy res...
[ "private", "void", "processRedirect", "(", "String", "stringStatusCode", ",", "HttpMethod", "httpMethodProxyRequest", ",", "HttpServletRequest", "httpServletRequest", ",", "HttpServletResponse", "httpServletResponse", ")", "throws", "Exception", "{", "// Check if the proxy resp...
Execute a redirected request @param stringStatusCode @param httpMethodProxyRequest @param httpServletRequest @param httpServletResponse @throws Exception
[ "Execute", "a", "redirected", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L1058-L1083
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.logOriginalRequestHistory
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 logOriginalRequestHistory(String requestType, HttpServletRequest request, History history) { logger.info("Storing original request history"); history.setRequestType(requestType); history.setOriginalRequestHeaders(HttpUtilities.getHeaders(re...
[ "private", "void", "logOriginalRequestHistory", "(", "String", "requestType", ",", "HttpServletRequest", "request", ",", "History", "history", ")", "{", "logger", ".", "info", "(", "\"Storing original request history\"", ")", ";", "history", ".", "setRequestType", "("...
Log original incoming request @param requestType @param request @param history
[ "Log", "original", "incoming", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L1092-L1100
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.logOriginalResponseHistory
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 logOriginalResponseHistory( PluginResponse httpServletResponse, History history) throws URIException { RequestInformation requestInfo = requestInformation.get(); if (requestInfo.handle && requestInfo.client.getIsActive()) { logger.info("Storing original response history"...
[ "private", "void", "logOriginalResponseHistory", "(", "PluginResponse", "httpServletResponse", ",", "History", "history", ")", "throws", "URIException", "{", "RequestInformation", "requestInfo", "=", "requestInformation", ".", "get", "(", ")", ";", "if", "(", "request...
Log original response @param httpServletResponse @param history @throws URIException
[ "Log", "original", "response" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L1109-L1120
train
groupon/odo
proxyserver/src/main/java/com/groupon/odo/Proxy.java
Proxy.logRequestHistory
private void logRequestHistory(HttpMethod httpMethodProxyRequest, PluginResponse httpServletResponse, History history) { try { if (requestInformation.get().handle && requestInformation.get().client.getIsActive()) { logger.info("Storing history"); ...
java
private void logRequestHistory(HttpMethod httpMethodProxyRequest, PluginResponse httpServletResponse, History history) { try { if (requestInformation.get().handle && requestInformation.get().client.getIsActive()) { logger.info("Storing history"); ...
[ "private", "void", "logRequestHistory", "(", "HttpMethod", "httpMethodProxyRequest", ",", "PluginResponse", "httpServletResponse", ",", "History", "history", ")", "{", "try", "{", "if", "(", "requestInformation", ".", "get", "(", ")", ".", "handle", "&&", "request...
Log modified request @param httpMethodProxyRequest @param httpServletResponse @param history
[ "Log", "modified", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L1129-L1156
train
groupon/odo
browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java
BrowserMobProxyHandler.handleConnectOriginal
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
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...
[ "public", "void", "handleConnectOriginal", "(", "String", "pathInContext", ",", "String", "pathParams", ",", "HttpRequest", "request", ",", "HttpResponse", "response", ")", "throws", "HttpException", ",", "IOException", "{", "URI", "uri", "=", "request", ".", "get...
Copied from original SeleniumProxyHandler Changed SslRelay to SslListener and getSslRelayOrCreateNew to getSslRelayOrCreateNewOdo No other changes to the function @param pathInContext @param pathParams @param request @param response @throws HttpException @throws IOException
[ "Copied", "from", "original", "SeleniumProxyHandler", "Changed", "SslRelay", "to", "SslListener", "and", "getSslRelayOrCreateNew", "to", "getSslRelayOrCreateNewOdo", "No", "other", "changes", "to", "the", "function" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java#L380-L439
train
groupon/odo
browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java
BrowserMobProxyHandler.wireUpSslWithCyberVilliansCAOdo
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
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....
[ "protected", "X509Certificate", "wireUpSslWithCyberVilliansCAOdo", "(", "String", "host", ",", "SslListener", "listener", ")", "{", "host", "=", "requestOriginalHostName", ".", "get", "(", ")", ";", "// Add cybervillians CA(from browsermob)", "try", "{", "// see https://g...
This function wires up a SSL Listener with the cyber villians root CA and cert with the correct CNAME for the request @param host @param listener
[ "This", "function", "wires", "up", "a", "SSL", "Listener", "with", "the", "cyber", "villians", "root", "CA", "and", "cert", "with", "the", "correct", "CNAME", "for", "the", "request" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java#L450-L467
train
groupon/odo
browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java
BrowserMobProxyHandler.startRelayWithPortTollerance
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 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()) { ...
[ "private", "void", "startRelayWithPortTollerance", "(", "HttpServer", "server", ",", "SslListener", "relay", ",", "int", "tries", ")", "throws", "Exception", "{", "if", "(", "tries", ">=", "5", ")", "{", "throw", "new", "BindException", "(", "\"Unable to bind to...
END ODO CHANGES
[ "END", "ODO", "CHANGES" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java#L520-L536
train
groupon/odo
browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java
BrowserMobProxyHandler.getUnsafeOkHttpClient
private static OkHttpClient getUnsafeOkHttpClient() { try { // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { @Override ...
java
private static OkHttpClient getUnsafeOkHttpClient() { try { // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { @Override ...
[ "private", "static", "OkHttpClient", "getUnsafeOkHttpClient", "(", ")", "{", "try", "{", "// Create a trust manager that does not validate certificate chains", "final", "TrustManager", "[", "]", "trustAllCerts", "=", "new", "TrustManager", "[", "]", "{", "new", "X509Trust...
Returns a OkHttpClient that ignores SSL cert errors @return
[ "Returns", "a", "OkHttpClient", "that", "ignores", "SSL", "cert", "errors" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java#L550-L589
train
groupon/odo
browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java
BrowserMobProxyHandler.cleanup
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 cleanup() { synchronized (_sslMap) { for (SslRelayOdo relay : _sslMap.values()) { if (relay.getHttpServer() != null && relay.isStarted()) { relay.getHttpServer().removeListener(relay); } } sslRelays.clear(); ...
[ "public", "void", "cleanup", "(", ")", "{", "synchronized", "(", "_sslMap", ")", "{", "for", "(", "SslRelayOdo", "relay", ":", "_sslMap", ".", "values", "(", ")", ")", "{", "if", "(", "relay", ".", "getHttpServer", "(", ")", "!=", "null", "&&", "rela...
Cleanup function to remove all allocated listeners
[ "Cleanup", "function", "to", "remove", "all", "allocated", "listeners" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/BrowserMobProxyHandler.java#L798-L808
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.removeOverride
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 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...
[ "public", "void", "removeOverride", "(", "int", "overrideId", ",", "int", "pathId", ",", "Integer", "ordinal", ",", "String", "clientUUID", ")", "{", "// TODO: reorder priorities after removal", "PreparedStatement", "statement", "=", "null", ";", "try", "(", "Connec...
Remove specified override id from enabled overrides for path @param overrideId ID of override to remove @param pathId ID of path containing override @param ordinal index to the instance of the enabled override @param clientUUID UUID of client
[ "Remove", "specified", "override", "id", "from", "enabled", "overrides", "for", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L291-L312
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.increasePriority
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
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;...
[ "public", "void", "increasePriority", "(", "int", "overrideId", ",", "int", "ordinal", ",", "int", "pathId", ",", "String", "clientUUID", ")", "{", "logger", ".", "info", "(", "\"Increase priority\"", ")", ";", "int", "origPriority", "=", "-", "1", ";", "i...
Increase the priority of an overrideId @param overrideId ID of override @param pathId ID of path containing override @param clientUUID UUID of client
[ "Increase", "the", "priority", "of", "an", "overrideId" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L321-L404
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.preparePlaceHolders
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
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(); }
[ "private", "static", "String", "preparePlaceHolders", "(", "int", "length", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", ")", "{", "builder", ".", "app...
Creates a list of placeholders for use in a PreparedStatement @param length number of placeholders @return String of placeholders, seperated by comma
[ "Creates", "a", "list", "of", "placeholders", "for", "use", "in", "a", "PreparedStatement" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L511-L520
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.disableAllOverrides
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) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement( "DELETE FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE + ...
[ "public", "void", "disableAllOverrides", "(", "int", "pathID", ",", "String", "clientUUID", ")", "{", "PreparedStatement", "statement", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ")", "{", "s...
Disable all overrides for a specified path @param pathID ID of path containing overrides @param clientUUID UUID of client
[ "Disable", "all", "overrides", "for", "a", "specified", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L528-L550
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.disableAllOverrides
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 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...
[ "public", "void", "disableAllOverrides", "(", "int", "pathID", ",", "String", "clientUUID", ",", "int", "overrideType", ")", "{", "PreparedStatement", "statement", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection"...
Disable all overrides for a specified path with overrideType @param pathID ID of path containing overrides @param clientUUID UUID of client @param overrideType Override type identifier
[ "Disable", "all", "overrides", "for", "a", "specified", "path", "with", "overrideType" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L559-L595
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.getEnabledEndpoints
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 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 = ...
[ "public", "List", "<", "EnabledEndpoint", ">", "getEnabledEndpoints", "(", "int", "pathId", ",", "String", "clientUUID", ",", "String", "[", "]", "filters", ")", "throws", "Exception", "{", "ArrayList", "<", "EnabledEndpoint", ">", "enabledOverrides", "=", "new"...
Returns an array of the enabled endpoints as Integer IDs @param pathId ID of path @param clientUUID UUID of client @param filters If supplied, only endpoints ending with values in filters are returned @return Collection of endpoints @throws Exception exception
[ "Returns", "an", "array", "of", "the", "enabled", "endpoints", "as", "Integer", "IDs" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L606-L680
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.getCurrentMethodOrdinal
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
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) { ...
[ "public", "int", "getCurrentMethodOrdinal", "(", "int", "overrideId", ",", "int", "pathId", ",", "String", "clientUUID", ",", "String", "[", "]", "filters", ")", "throws", "Exception", "{", "int", "currentOrdinal", "=", "0", ";", "List", "<", "EnabledEndpoint"...
Get the ordinal value for the last of a particular override on a path @param overrideId Id of the override to check @param pathId Path the override is on @param clientUUID UUID of the client @param filters If supplied, only endpoints ending with values in filters are returned @return The integer ordinal @throws Except...
[ "Get", "the", "ordinal", "value", "for", "the", "last", "of", "a", "particular", "override", "on", "a", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L692-L701
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.getPartialEnabledEndpointFromResultset
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
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...
[ "private", "EnabledEndpoint", "getPartialEnabledEndpointFromResultset", "(", "ResultSet", "result", ")", "throws", "Exception", "{", "EnabledEndpoint", "endpoint", "=", "new", "EnabledEndpoint", "(", ")", ";", "endpoint", ".", "setId", "(", "result", ".", "getInt", ...
This only gets half of the EnabledEndpoint from a JDBC ResultSet Getting the method for the override id requires an additional SQL query and needs to be called after the SQL connection is released @param result result to scan for endpoint @return EnabledEndpoint @throws Exception exception
[ "This", "only", "gets", "half", "of", "the", "EnabledEndpoint", "from", "a", "JDBC", "ResultSet", "Getting", "the", "method", "for", "the", "override", "id", "requires", "an", "additional", "SQL", "query", "and", "needs", "to", "be", "called", "after", "the"...
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L830-L852
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.getOverrideIdForMethod
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 Integer getOverrideIdForMethod(String className, String methodName) { Integer overrideId = null; PreparedStatement query = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { query = sqlConnection.prepareStatement( ...
[ "public", "Integer", "getOverrideIdForMethod", "(", "String", "className", ",", "String", "methodName", ")", "{", "Integer", "overrideId", "=", "null", ";", "PreparedStatement", "query", "=", "null", ";", "ResultSet", "results", "=", "null", ";", "try", "(", "...
Gets an overrideID for a class name, method name @param className name of class @param methodName name of method @return override ID of method
[ "Gets", "an", "overrideID", "for", "a", "class", "name", "method", "name" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L861-L898
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java
ClientService.findAllClients
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 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...
[ "public", "List", "<", "Client", ">", "findAllClients", "(", "int", "profileId", ")", "throws", "Exception", "{", "ArrayList", "<", "Client", ">", "clients", "=", "new", "ArrayList", "<", "Client", ">", "(", ")", ";", "PreparedStatement", "query", "=", "nu...
Return all Clients for a profile @param profileId ID of profile clients belong to @return collection of the Clients found @throws Exception exception
[ "Return", "all", "Clients", "for", "a", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L60-L93
train
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java
ClientService.getClient
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
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 + ...
[ "public", "Client", "getClient", "(", "int", "clientId", ")", "throws", "Exception", "{", "Client", "client", "=", "null", ";", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "results", "=", "null", ";", "try", "(", "Connection", "sqlConnecti...
Returns a client object for a clientId @param clientId ID of client to return @return Client or null @throws Exception exception
[ "Returns", "a", "client", "object", "for", "a", "clientId" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L102-L136
train