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/ClientService.java | ClientService.findClient | public Client findClient(String clientUUID, Integer profileId) throws Exception {
Client client = null;
/* ERROR CODE: 500 WHEN TRYING TO DELETE A SERVER GROUP.
THIS APPEARS TO BE BECAUSE CLIENT UUID IS NULL.
*/
/* CODE ADDED TO PREVENT NULL POINTERS. */
if (clientUU... | java | public Client findClient(String clientUUID, Integer profileId) throws Exception {
Client client = null;
/* ERROR CODE: 500 WHEN TRYING TO DELETE A SERVER GROUP.
THIS APPEARS TO BE BECAUSE CLIENT UUID IS NULL.
*/
/* CODE ADDED TO PREVENT NULL POINTERS. */
if (clientUU... | [
"public",
"Client",
"findClient",
"(",
"String",
"clientUUID",
",",
"Integer",
"profileId",
")",
"throws",
"Exception",
"{",
"Client",
"client",
"=",
"null",
";",
"/* ERROR CODE: 500 WHEN TRYING TO DELETE A SERVER GROUP.\n THIS APPEARS TO BE BECAUSE CLIENT UUID IS NULL... | Returns a Client object for a clientUUID and profileId
@param clientUUID UUID or friendlyName of client
@param profileId - can be null, safer if it is not null
@return Client object or null
@throws Exception exception | [
"Returns",
"a",
"Client",
"object",
"for",
"a",
"clientUUID",
"and",
"profileId"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L146-L209 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java | ClientService.getClientFromResultSet | private Client getClientFromResultSet(ResultSet result) throws Exception {
Client client = new Client();
client.setId(result.getInt(Constants.GENERIC_ID));
client.setUUID(result.getString(Constants.CLIENT_CLIENT_UUID));
client.setFriendlyName(result.getString(Constants.CLIENT_FRIENDLY_NA... | java | private Client getClientFromResultSet(ResultSet result) throws Exception {
Client client = new Client();
client.setId(result.getInt(Constants.GENERIC_ID));
client.setUUID(result.getString(Constants.CLIENT_CLIENT_UUID));
client.setFriendlyName(result.getString(Constants.CLIENT_FRIENDLY_NA... | [
"private",
"Client",
"getClientFromResultSet",
"(",
"ResultSet",
"result",
")",
"throws",
"Exception",
"{",
"Client",
"client",
"=",
"new",
"Client",
"(",
")",
";",
"client",
".",
"setId",
"(",
"result",
".",
"getInt",
"(",
"Constants",
".",
"GENERIC_ID",
")... | Returns a client model from a ResultSet
@param result resultset containing client information
@return Client or null
@throws Exception exception | [
"Returns",
"a",
"client",
"model",
"from",
"a",
"ResultSet"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L218-L227 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java | ClientService.setFriendlyName | public Client setFriendlyName(int profileId, String clientUUID, String friendlyName) throws Exception {
// first see if this friendlyName is already in use
Client client = this.findClientFromFriendlyName(profileId, friendlyName);
if (client != null && !client.getUUID().equals(clientUUID)) {
... | java | public Client setFriendlyName(int profileId, String clientUUID, String friendlyName) throws Exception {
// first see if this friendlyName is already in use
Client client = this.findClientFromFriendlyName(profileId, friendlyName);
if (client != null && !client.getUUID().equals(clientUUID)) {
... | [
"public",
"Client",
"setFriendlyName",
"(",
"int",
"profileId",
",",
"String",
"clientUUID",
",",
"String",
"friendlyName",
")",
"throws",
"Exception",
"{",
"// first see if this friendlyName is already in use",
"Client",
"client",
"=",
"this",
".",
"findClientFromFriendl... | Set a friendly name for a client
@param profileId profileId of the client
@param clientUUID UUID of the client
@param friendlyName friendly name of the client
@return return Client object or null
@throws Exception exception | [
"Set",
"a",
"friendly",
"name",
"for",
"a",
"client"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L382-L419 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java | ClientService.updateActive | public void updateActive(int profileId, String clientUUID, Boolean active) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_CLIENT +
... | java | public void updateActive(int profileId, String clientUUID, Boolean active) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_CLIENT +
... | [
"public",
"void",
"updateActive",
"(",
"int",
"profileId",
",",
"String",
"clientUUID",
",",
"Boolean",
"active",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
"... | disables the current active id, enables the new one selected
@param profileId profile ID of the client
@param clientUUID UUID of the client
@param active true to make client active, false to make client inactive
@throws Exception exception | [
"disables",
"the",
"current",
"active",
"id",
"enables",
"the",
"new",
"one",
"selected"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L580-L603 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java | ClientService.reset | public void reset(int profileId, String clientUUID) throws Exception {
PreparedStatement statement = null;
// TODO: need a better way to do this than brute force.. but the iterative approach is too slow
try (Connection sqlConnection = sqlService.getConnection()) {
// first remove a... | java | public void reset(int profileId, String clientUUID) throws Exception {
PreparedStatement statement = null;
// TODO: need a better way to do this than brute force.. but the iterative approach is too slow
try (Connection sqlConnection = sqlService.getConnection()) {
// first remove a... | [
"public",
"void",
"reset",
"(",
"int",
"profileId",
",",
"String",
"clientUUID",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"// TODO: need a better way to do this than brute force.. but the iterative approach is too slow",
"try",
"(",... | Resets all override settings for the clientUUID and disables it
@param profileId profile ID of the client
@param clientUUID UUID of the client
@throws Exception exception | [
"Resets",
"all",
"override",
"settings",
"for",
"the",
"clientUUID",
"and",
"disables",
"it"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L612-L655 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java | ClientService.getProfileIdFromClientId | public String getProfileIdFromClientId(int id) {
return (String) sqlService.getFromTable(Constants.CLIENT_PROFILE_ID, Constants.GENERIC_ID, id, Constants.DB_TABLE_CLIENT);
} | java | public String getProfileIdFromClientId(int id) {
return (String) sqlService.getFromTable(Constants.CLIENT_PROFILE_ID, Constants.GENERIC_ID, id, Constants.DB_TABLE_CLIENT);
} | [
"public",
"String",
"getProfileIdFromClientId",
"(",
"int",
"id",
")",
"{",
"return",
"(",
"String",
")",
"sqlService",
".",
"getFromTable",
"(",
"Constants",
".",
"CLIENT_PROFILE_ID",
",",
"Constants",
".",
"GENERIC_ID",
",",
"id",
",",
"Constants",
".",
"DB_... | gets the profile_name associated with a specific id | [
"gets",
"the",
"profile_name",
"associated",
"with",
"a",
"specific",
"id"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L666-L668 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/ScriptController.java | ScriptController.scriptView | @RequestMapping(value = "/scripts", method = RequestMethod.GET)
public String scriptView(Model model) throws Exception {
return "script";
} | java | @RequestMapping(value = "/scripts", method = RequestMethod.GET)
public String scriptView(Model model) throws Exception {
return "script";
} | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/scripts\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"String",
"scriptView",
"(",
"Model",
"model",
")",
"throws",
"Exception",
"{",
"return",
"\"script\"",
";",
"}"
] | Returns script view
@param model
@return
@throws Exception | [
"Returns",
"script",
"view"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ScriptController.java#L36-L39 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/ScriptController.java | ScriptController.getScripts | @RequestMapping(value = "/api/scripts", method = RequestMethod.GET)
public
@ResponseBody
HashMap<String, Object> getScripts(Model model,
@RequestParam(required = false) Integer type) throws Exception {
Script[] scripts = ScriptService.getInstance().getScripts(t... | java | @RequestMapping(value = "/api/scripts", method = RequestMethod.GET)
public
@ResponseBody
HashMap<String, Object> getScripts(Model model,
@RequestParam(required = false) Integer type) throws Exception {
Script[] scripts = ScriptService.getInstance().getScripts(t... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/api/scripts\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"@",
"ResponseBody",
"HashMap",
"<",
"String",
",",
"Object",
">",
"getScripts",
"(",
"Model",
"model",
",",
"@",
"RequestParam",
"(... | Returns all scripts
@param model
@param type - optional to specify type of script to return
@return
@throws Exception | [
"Returns",
"all",
"scripts"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ScriptController.java#L49-L56 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/ScriptController.java | ScriptController.addScript | @RequestMapping(value = "/api/scripts", method = RequestMethod.POST)
public
@ResponseBody
Script addScript(Model model,
@RequestParam(required = true) String name,
@RequestParam(required = true) String script) throws Exception {
return ScriptService.getInst... | java | @RequestMapping(value = "/api/scripts", method = RequestMethod.POST)
public
@ResponseBody
Script addScript(Model model,
@RequestParam(required = true) String name,
@RequestParam(required = true) String script) throws Exception {
return ScriptService.getInst... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/api/scripts\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"Script",
"addScript",
"(",
"Model",
"model",
",",
"@",
"RequestParam",
"(",
"required",
"=",
"true",
")",
"St... | Add a new script
@param model
@param name
@param script
@return
@throws Exception | [
"Add",
"a",
"new",
"script"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ScriptController.java#L129-L137 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/GroupController.java | GroupController.newGroupGet | @RequestMapping(value = "group", method = RequestMethod.GET)
public String newGroupGet(Model model) {
model.addAttribute("groups",
pathOverrideService.findAllGroups());
return "groups";
} | java | @RequestMapping(value = "group", method = RequestMethod.GET)
public String newGroupGet(Model model) {
model.addAttribute("groups",
pathOverrideService.findAllGroups());
return "groups";
} | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"group\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"String",
"newGroupGet",
"(",
"Model",
"model",
")",
"{",
"model",
".",
"addAttribute",
"(",
"\"groups\"",
",",
"pathOverrideService",
".",
... | Redirect to page
@param model
@return | [
"Redirect",
"to",
"page"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/GroupController.java#L48-L53 | train |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.createKeystore | protected void createKeystore() {
java.security.cert.Certificate signingCert = null;
PrivateKey caPrivKey = null;
if(_caCert == null || _caPrivKey == null)
{
try
{
log.debug("Keystore or signing cert & keypair not found. Generating...");
KeyPair caKeypair = getRSAKeyPair();
caPrivKey = c... | java | protected void createKeystore() {
java.security.cert.Certificate signingCert = null;
PrivateKey caPrivKey = null;
if(_caCert == null || _caPrivKey == null)
{
try
{
log.debug("Keystore or signing cert & keypair not found. Generating...");
KeyPair caKeypair = getRSAKeyPair();
caPrivKey = c... | [
"protected",
"void",
"createKeystore",
"(",
")",
"{",
"java",
".",
"security",
".",
"cert",
".",
"Certificate",
"signingCert",
"=",
"null",
";",
"PrivateKey",
"caPrivKey",
"=",
"null",
";",
"if",
"(",
"_caCert",
"==",
"null",
"||",
"_caPrivKey",
"==",
"nul... | Creates, writes and loads a new keystore and CA root certificate. | [
"Creates",
"writes",
"and",
"loads",
"a",
"new",
"keystore",
"and",
"CA",
"root",
"certificate",
"."
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L475-L537 | train |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.addCertAndPrivateKey | public synchronized void addCertAndPrivateKey(String hostname, final X509Certificate cert, final PrivateKey privKey)
throws KeyStoreException, CertificateException, NoSuchAlgorithmException
{
// String alias = ThumbprintUtil.getThumbprint(cert);
_ks.deleteEntry(hostname);
_ks.setCertificateEntry(hostname... | java | public synchronized void addCertAndPrivateKey(String hostname, final X509Certificate cert, final PrivateKey privKey)
throws KeyStoreException, CertificateException, NoSuchAlgorithmException
{
// String alias = ThumbprintUtil.getThumbprint(cert);
_ks.deleteEntry(hostname);
_ks.setCertificateEntry(hostname... | [
"public",
"synchronized",
"void",
"addCertAndPrivateKey",
"(",
"String",
"hostname",
",",
"final",
"X509Certificate",
"cert",
",",
"final",
"PrivateKey",
"privKey",
")",
"throws",
"KeyStoreException",
",",
"CertificateException",
",",
"NoSuchAlgorithmException",
"{",
"/... | Stores a new certificate and its associated private key in the keystore.
@param hostname
@param cert
@param privKey @throws KeyStoreException
@throws CertificateException
@throws NoSuchAlgorithmException | [
"Stores",
"a",
"new",
"certificate",
"and",
"its",
"associated",
"private",
"key",
"in",
"the",
"keystore",
"."
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L547-L562 | train |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.getCertificateByHostname | public synchronized X509Certificate getCertificateByHostname(final String hostname) throws KeyStoreException, CertificateParsingException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, Unrec... | java | public synchronized X509Certificate getCertificateByHostname(final String hostname) throws KeyStoreException, CertificateParsingException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, Unrec... | [
"public",
"synchronized",
"X509Certificate",
"getCertificateByHostname",
"(",
"final",
"String",
"hostname",
")",
"throws",
"KeyStoreException",
",",
"CertificateParsingException",
",",
"InvalidKeyException",
",",
"CertificateExpiredException",
",",
"CertificateNotYetValidExcepti... | Returns the aliased certificate. Certificates are aliased by their hostname.
@see ThumbprintUtil
@param alias
@return
@throws KeyStoreException
@throws UnrecoverableKeyException
@throws NoSuchProviderException
@throws NoSuchAlgorithmException
@throws CertificateException
@throws SignatureException
@throws CertificateN... | [
"Returns",
"the",
"aliased",
"certificate",
".",
"Certificates",
"are",
"aliased",
"by",
"their",
"hostname",
"."
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L615-L623 | train |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.getMappedCertificate | public synchronized X509Certificate getMappedCertificate(final X509Certificate cert)
throws CertificateEncodingException,
InvalidKeyException,
CertificateException,
CertificateNotYetValidException,
NoSuchAlgorithmException,
NoSuchProviderException,
SignatureException,
KeyStoreException,
UnrecoverableKeyExcepti... | java | public synchronized X509Certificate getMappedCertificate(final X509Certificate cert)
throws CertificateEncodingException,
InvalidKeyException,
CertificateException,
CertificateNotYetValidException,
NoSuchAlgorithmException,
NoSuchProviderException,
SignatureException,
KeyStoreException,
UnrecoverableKeyExcepti... | [
"public",
"synchronized",
"X509Certificate",
"getMappedCertificate",
"(",
"final",
"X509Certificate",
"cert",
")",
"throws",
"CertificateEncodingException",
",",
"InvalidKeyException",
",",
"CertificateException",
",",
"CertificateNotYetValidException",
",",
"NoSuchAlgorithmExcep... | This method returns the duplicated certificate mapped to the passed in cert, or
creates and returns one if no mapping has yet been performed. If a naked public
key has already been mapped that matches the key in the cert, the already mapped
keypair will be reused for the mapped cert.
@param cert
@return
@throws Certif... | [
"This",
"method",
"returns",
"the",
"duplicated",
"certificate",
"mapped",
"to",
"the",
"passed",
"in",
"cert",
"or",
"creates",
"and",
"returns",
"one",
"if",
"no",
"mapping",
"has",
"yet",
"been",
"performed",
".",
"If",
"a",
"naked",
"public",
"key",
"h... | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L680-L754 | train |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.getMappedCertificateForHostname | public X509Certificate getMappedCertificateForHostname(String hostname) throws CertificateParsingException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, KeyStoreException, UnrecoverableKeyE... | java | public X509Certificate getMappedCertificateForHostname(String hostname) throws CertificateParsingException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, KeyStoreException, UnrecoverableKeyE... | [
"public",
"X509Certificate",
"getMappedCertificateForHostname",
"(",
"String",
"hostname",
")",
"throws",
"CertificateParsingException",
",",
"InvalidKeyException",
",",
"CertificateExpiredException",
",",
"CertificateNotYetValidException",
",",
"SignatureException",
",",
"Certif... | This method returns the mapped certificate for a hostname, or generates a "standard"
SSL server certificate issued by the CA to the supplied subject if no mapping has been
created. This is not a true duplication, just a shortcut method
that is adequate for web browsers.
@param hostname
@return
@throws CertificatePars... | [
"This",
"method",
"returns",
"the",
"mapped",
"certificate",
"for",
"a",
"hostname",
"or",
"generates",
"a",
"standard",
"SSL",
"server",
"certificate",
"issued",
"by",
"the",
"CA",
"to",
"the",
"supplied",
"subject",
"if",
"no",
"mapping",
"has",
"been",
"c... | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L775-L806 | train |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.getPrivateKeyForLocalCert | public synchronized PrivateKey getPrivateKeyForLocalCert(final X509Certificate cert)
throws CertificateEncodingException, KeyStoreException, UnrecoverableKeyException,
NoSuchAlgorithmException
{
String thumbprint = ThumbprintUtil.getThumbprint(cert);
return (PrivateKey)_ks.getKey(thumbprint, _keypassword);
} | java | public synchronized PrivateKey getPrivateKeyForLocalCert(final X509Certificate cert)
throws CertificateEncodingException, KeyStoreException, UnrecoverableKeyException,
NoSuchAlgorithmException
{
String thumbprint = ThumbprintUtil.getThumbprint(cert);
return (PrivateKey)_ks.getKey(thumbprint, _keypassword);
} | [
"public",
"synchronized",
"PrivateKey",
"getPrivateKeyForLocalCert",
"(",
"final",
"X509Certificate",
"cert",
")",
"throws",
"CertificateEncodingException",
",",
"KeyStoreException",
",",
"UnrecoverableKeyException",
",",
"NoSuchAlgorithmException",
"{",
"String",
"thumbprint",... | For a cert we have generated, return the private key.
@param cert
@return
@throws CertificateEncodingException
@throws KeyStoreException
@throws UnrecoverableKeyException
@throws NoSuchAlgorithmException | [
"For",
"a",
"cert",
"we",
"have",
"generated",
"return",
"the",
"private",
"key",
"."
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L858-L865 | train |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.mapPublicKeys | public synchronized void mapPublicKeys(final PublicKey original, final PublicKey substitute)
{
_mappedPublicKeys.put(original, substitute);
if(persistImmediately) { persistPublicKeyMap(); }
} | java | public synchronized void mapPublicKeys(final PublicKey original, final PublicKey substitute)
{
_mappedPublicKeys.put(original, substitute);
if(persistImmediately) { persistPublicKeyMap(); }
} | [
"public",
"synchronized",
"void",
"mapPublicKeys",
"(",
"final",
"PublicKey",
"original",
",",
"final",
"PublicKey",
"substitute",
")",
"{",
"_mappedPublicKeys",
".",
"put",
"(",
"original",
",",
"substitute",
")",
";",
"if",
"(",
"persistImmediately",
")",
"{",... | Stores a public key mapping.
@param original
@param substitute | [
"Stores",
"a",
"public",
"key",
"mapping",
"."
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L935-L939 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java | ScriptService.getScript | public Script getScript(int id) {
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants.DB_TABLE_SCRIPT +
... | java | public Script getScript(int id) {
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants.DB_TABLE_SCRIPT +
... | [
"public",
"Script",
"getScript",
"(",
"int",
"id",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"ResultSet",
"results",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"SQLService",
".",
"getInstance",
"(",
")",
".",
"getCo... | Get the script for a given ID
@param id ID of script
@return Script if found, otherwise null | [
"Get",
"the",
"script",
"for",
"a",
"given",
"ID"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java#L65-L97 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java | ScriptService.getScripts | public Script[] getScripts(Integer type) {
ArrayList<Script> returnData = new ArrayList<>();
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(... | java | public Script[] getScripts(Integer type) {
ArrayList<Script> returnData = new ArrayList<>();
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(... | [
"public",
"Script",
"[",
"]",
"getScripts",
"(",
"Integer",
"type",
")",
"{",
"ArrayList",
"<",
"Script",
">",
"returnData",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"PreparedStatement",
"statement",
"=",
"null",
";",
"ResultSet",
"results",
"=",
"nul... | Return all scripts of a given type
@param type integer value of type
@return Array of scripts of the given type | [
"Return",
"all",
"scripts",
"of",
"a",
"given",
"type"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java#L114-L154 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java | ScriptService.updateName | public Script updateName(int id, String name) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SCRIPT +
... | java | public Script updateName(int id, String name) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SCRIPT +
... | [
"public",
"Script",
"updateName",
"(",
"int",
"id",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"SQLService",
".",
"getInstance",
"(",
")",
".",
"... | Update the name of a script
@param id ID of script
@param name new name
@return updated script
@throws Exception exception | [
"Update",
"the",
"name",
"of",
"a",
"script"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java#L218-L242 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java | ScriptService.removeScript | public void removeScript(int id) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"DELETE FROM " + Constants.DB_TABLE_SCRIPT +
" ... | java | public void removeScript(int id) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"DELETE FROM " + Constants.DB_TABLE_SCRIPT +
" ... | [
"public",
"void",
"removeScript",
"(",
"int",
"id",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"SQLService",
".",
"getInstance",
"(",
")",
".",
"getConnection",
"(",
")",... | Remove script for a given ID
@param id ID of script
@throws Exception exception | [
"Remove",
"script",
"for",
"a",
"given",
"ID"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ScriptService.java#L284-L304 | train |
groupon/odo | proxyserver/src/main/java/com/groupon/odo/RemoveHeaderFilter.java | RemoveHeaderFilter.doFilter | @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
final ServletRequest r1 = request;
chain.doFilter(request, new HttpServletResponseWrapper((HttpServletResponse) response) {
@SuppressWarnings("unchec... | java | @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
final ServletRequest r1 = request;
chain.doFilter(request, new HttpServletResponseWrapper((HttpServletResponse) response) {
@SuppressWarnings("unchec... | [
"@",
"Override",
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
",",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"final",
"ServletRequest",
"r1",
"=",
"request",
";",
"cha... | This looks at the servlet attributes to get the list of response headers to remove while the response object gets created by the servlet | [
"This",
"looks",
"at",
"the",
"servlet",
"attributes",
"to",
"get",
"the",
"list",
"of",
"response",
"headers",
"to",
"remove",
"while",
"the",
"response",
"object",
"gets",
"created",
"by",
"the",
"servlet"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/RemoveHeaderFilter.java#L28-L53 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java | Utils.arrayFromStringOfIntegers | public static int[] arrayFromStringOfIntegers(String str) throws IllegalArgumentException {
StringTokenizer tokenizer = new StringTokenizer(str, ",");
int n = tokenizer.countTokens();
int[] list = new int[n];
for (int i = 0; i < n; i++) {
String token = tokenizer.nextToken();... | java | public static int[] arrayFromStringOfIntegers(String str) throws IllegalArgumentException {
StringTokenizer tokenizer = new StringTokenizer(str, ",");
int n = tokenizer.countTokens();
int[] list = new int[n];
for (int i = 0; i < n; i++) {
String token = tokenizer.nextToken();... | [
"public",
"static",
"int",
"[",
"]",
"arrayFromStringOfIntegers",
"(",
"String",
"str",
")",
"throws",
"IllegalArgumentException",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"str",
",",
"\",\"",
")",
";",
"int",
"n",
"=",
"tokenizer... | Split string of comma-delimited ints into an a int array
@param str
@return
@throws IllegalArgumentException | [
"Split",
"string",
"of",
"comma",
"-",
"delimited",
"ints",
"into",
"an",
"a",
"int",
"array"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java#L44-L53 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java | Utils.copyResourceToLocalFile | public static File copyResourceToLocalFile(String sourceResource, String destFileName) throws Exception {
try {
Resource keystoreFile = new ClassPathResource(sourceResource);
InputStream in = keystoreFile.getInputStream();
File outKeyStoreFile = new File(destFileName);
... | java | public static File copyResourceToLocalFile(String sourceResource, String destFileName) throws Exception {
try {
Resource keystoreFile = new ClassPathResource(sourceResource);
InputStream in = keystoreFile.getInputStream();
File outKeyStoreFile = new File(destFileName);
... | [
"public",
"static",
"File",
"copyResourceToLocalFile",
"(",
"String",
"sourceResource",
",",
"String",
"destFileName",
")",
"throws",
"Exception",
"{",
"try",
"{",
"Resource",
"keystoreFile",
"=",
"new",
"ClassPathResource",
"(",
"sourceResource",
")",
";",
"InputSt... | Copies file from a resource to a local temp file
@param sourceResource
@return Absolute filename of the temp file
@throws Exception | [
"Copies",
"file",
"from",
"a",
"resource",
"to",
"a",
"local",
"temp",
"file"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java#L100-L119 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java | Utils.getSystemPort | public static int getSystemPort(String portIdentifier) {
int defaultPort = 0;
if (portIdentifier.compareTo(Constants.SYS_API_PORT) == 0) {
defaultPort = Constants.DEFAULT_API_PORT;
} else if (portIdentifier.compareTo(Constants.SYS_DB_PORT) == 0) {
defaultPort = Constants... | java | public static int getSystemPort(String portIdentifier) {
int defaultPort = 0;
if (portIdentifier.compareTo(Constants.SYS_API_PORT) == 0) {
defaultPort = Constants.DEFAULT_API_PORT;
} else if (portIdentifier.compareTo(Constants.SYS_DB_PORT) == 0) {
defaultPort = Constants... | [
"public",
"static",
"int",
"getSystemPort",
"(",
"String",
"portIdentifier",
")",
"{",
"int",
"defaultPort",
"=",
"0",
";",
"if",
"(",
"portIdentifier",
".",
"compareTo",
"(",
"Constants",
".",
"SYS_API_PORT",
")",
"==",
"0",
")",
"{",
"defaultPort",
"=",
... | Returns the port as configured by the system variables, fallback is the default port value
@param portIdentifier - SYS_*_PORT defined in Constants
@return | [
"Returns",
"the",
"port",
"as",
"configured",
"by",
"the",
"system",
"variables",
"fallback",
"is",
"the",
"default",
"port",
"value"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java#L127-L146 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java | Utils.getPublicIPAddress | public static String getPublicIPAddress() throws Exception {
final String IPV4_REGEX = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
String ipAddr = null;
Enumeration e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements()) {
... | java | public static String getPublicIPAddress() throws Exception {
final String IPV4_REGEX = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
String ipAddr = null;
Enumeration e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements()) {
... | [
"public",
"static",
"String",
"getPublicIPAddress",
"(",
")",
"throws",
"Exception",
"{",
"final",
"String",
"IPV4_REGEX",
"=",
"\"\\\\A(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)){3}\\\\z\"",
";",
"String",
"ipAddr",
"=",
"null",
";",
... | This function returns the first external IP address encountered
@return IP address or null
@throws Exception | [
"This",
"function",
"returns",
"the",
"first",
"external",
"IP",
"address",
"encountered"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/Utils.java#L163-L187 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ConfigurationService.java | ConfigurationService.getConfiguration | public Configuration getConfiguration(String name) {
Configuration[] values = getConfigurations(name);
if (values == null) {
return null;
}
return values[0];
} | java | public Configuration getConfiguration(String name) {
Configuration[] values = getConfigurations(name);
if (values == null) {
return null;
}
return values[0];
} | [
"public",
"Configuration",
"getConfiguration",
"(",
"String",
"name",
")",
"{",
"Configuration",
"[",
"]",
"values",
"=",
"getConfigurations",
"(",
"name",
")",
";",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"values... | Get the value for a particular configuration property
@param name - name of the property
@return The first value encountered or null | [
"Get",
"the",
"value",
"for",
"a",
"particular",
"configuration",
"property"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ConfigurationService.java#L70-L78 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ConfigurationService.java | ConfigurationService.getConfigurations | public Configuration[] getConfigurations(String name) {
ArrayList<Configuration> valuesList = new ArrayList<Configuration>();
logger.info("Getting data for {}", name);
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getC... | java | public Configuration[] getConfigurations(String name) {
ArrayList<Configuration> valuesList = new ArrayList<Configuration>();
logger.info("Getting data for {}", name);
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getC... | [
"public",
"Configuration",
"[",
"]",
"getConfigurations",
"(",
"String",
"name",
")",
"{",
"ArrayList",
"<",
"Configuration",
">",
"valuesList",
"=",
"new",
"ArrayList",
"<",
"Configuration",
">",
"(",
")",
";",
"logger",
".",
"info",
"(",
"\"Getting data for ... | Get the values for a particular configuration property
@param name - name of the property
@return All values encountered or null | [
"Get",
"the",
"values",
"for",
"a",
"particular",
"configuration",
"property"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ConfigurationService.java#L86-L138 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/EditController.java | EditController.disableAll | @RequestMapping(value = "api/edit/disableAll", method = RequestMethod.POST)
public
@ResponseBody
String disableAll(Model model, int profileID,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) {
editService.disableAll(profileID, clientUUID);
... | java | @RequestMapping(value = "api/edit/disableAll", method = RequestMethod.POST)
public
@ResponseBody
String disableAll(Model model, int profileID,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) {
editService.disableAll(profileID, clientUUID);
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"api/edit/disableAll\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"String",
"disableAll",
"(",
"Model",
"model",
",",
"int",
"profileID",
",",
"@",
"RequestParam",
"(",
"d... | Disables all the overrides for a specific profile
@param model
@param profileID
@param clientUUID
@return | [
"Disables",
"all",
"the",
"overrides",
"for",
"a",
"specific",
"profile"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/EditController.java#L74-L81 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/EditController.java | EditController.updateRepeatNumber | @RequestMapping(value = "api/edit/repeatNumber", method = RequestMethod.POST)
public
@ResponseBody
String updateRepeatNumber(Model model, int newNum, int path_id,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
log... | java | @RequestMapping(value = "api/edit/repeatNumber", method = RequestMethod.POST)
public
@ResponseBody
String updateRepeatNumber(Model model, int newNum, int path_id,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
log... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"api/edit/repeatNumber\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"String",
"updateRepeatNumber",
"(",
"Model",
"model",
",",
"int",
"newNum",
",",
"int",
"path_id",
",",
... | Calls a method from editService to update the repeat number for a path
@param model
@param newNum
@param path_id
@param clientUUID
@return
@throws Exception | [
"Calls",
"a",
"method",
"from",
"editService",
"to",
"update",
"the",
"repeat",
"number",
"for",
"a",
"path"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/EditController.java#L110-L118 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/EditController.java | EditController.enableCustomResponse | @RequestMapping(value = "api/edit/enable/custom", method = RequestMethod.POST)
public
@ResponseBody
String enableCustomResponse(Model model, String custom, int path_id,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
... | java | @RequestMapping(value = "api/edit/enable/custom", method = RequestMethod.POST)
public
@ResponseBody
String enableCustomResponse(Model model, String custom, int path_id,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"api/edit/enable/custom\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"String",
"enableCustomResponse",
"(",
"Model",
"model",
",",
"String",
"custom",
",",
"int",
"path_id",
... | Enables a custom response
@param model
@param custom
@param path_id
@param clientUUID
@return
@throws Exception | [
"Enables",
"a",
"custom",
"response"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/EditController.java#L130-L139 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/EditController.java | EditController.disableResponses | @RequestMapping(value = "api/edit/disable", method = RequestMethod.POST)
public
@ResponseBody
String disableResponses(Model model, int path_id, @RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
OverrideService.getInstance().disableAllOverrides(pa... | java | @RequestMapping(value = "api/edit/disable", method = RequestMethod.POST)
public
@ResponseBody
String disableResponses(Model model, int path_id, @RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
OverrideService.getInstance().disableAllOverrides(pa... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"api/edit/disable\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"String",
"disableResponses",
"(",
"Model",
"model",
",",
"int",
"path_id",
",",
"@",
"RequestParam",
"(",
"... | disables the responses for a given pathname and user id
@param model
@param path_id
@param clientUUID
@return
@throws Exception | [
"disables",
"the",
"responses",
"for",
"a",
"given",
"pathname",
"and",
"user",
"id"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/EditController.java#L150-L159 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.startServer | public void startServer() throws Exception {
if (!externalDatabaseHost) {
try {
this.port = Utils.getSystemPort(Constants.SYS_DB_PORT);
server = Server.createTcpServer("-tcpPort", String.valueOf(port), "-tcpAllowOthers").start();
} catch (SQLException e) {... | java | public void startServer() throws Exception {
if (!externalDatabaseHost) {
try {
this.port = Utils.getSystemPort(Constants.SYS_DB_PORT);
server = Server.createTcpServer("-tcpPort", String.valueOf(port), "-tcpAllowOthers").start();
} catch (SQLException e) {... | [
"public",
"void",
"startServer",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"externalDatabaseHost",
")",
"{",
"try",
"{",
"this",
".",
"port",
"=",
"Utils",
".",
"getSystemPort",
"(",
"Constants",
".",
"SYS_DB_PORT",
")",
";",
"server",
"=",
"... | Only meant to be called once
@throws Exception exception | [
"Only",
"meant",
"to",
"be",
"called",
"once"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L64-L77 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.stopServer | public void stopServer() throws Exception {
if (!externalDatabaseHost) {
try (Connection sqlConnection = getConnection()) {
sqlConnection.prepareStatement("SHUTDOWN").execute();
} catch (Exception e) {
}
try {
server.stop();
... | java | public void stopServer() throws Exception {
if (!externalDatabaseHost) {
try (Connection sqlConnection = getConnection()) {
sqlConnection.prepareStatement("SHUTDOWN").execute();
} catch (Exception e) {
}
try {
server.stop();
... | [
"public",
"void",
"stopServer",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"externalDatabaseHost",
")",
"{",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"getConnection",
"(",
")",
")",
"{",
"sqlConnection",
".",
"prepareStatement",
"(",
"\"SHUTD... | Shutdown the server
@throws Exception exception | [
"Shutdown",
"the",
"server"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L84-L96 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.getInstance | public static SQLService getInstance() throws Exception {
if (_instance == null) {
_instance = new SQLService();
_instance.startServer();
// default pool size is 20
// can be overriden by env variable
int dbPool = 20;
if (Utils.getEnvironm... | java | public static SQLService getInstance() throws Exception {
if (_instance == null) {
_instance = new SQLService();
_instance.startServer();
// default pool size is 20
// can be overriden by env variable
int dbPool = 20;
if (Utils.getEnvironm... | [
"public",
"static",
"SQLService",
"getInstance",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"_instance",
"==",
"null",
")",
"{",
"_instance",
"=",
"new",
"SQLService",
"(",
")",
";",
"_instance",
".",
"startServer",
"(",
")",
";",
"// default pool size... | Obtain instance of the SQL Service
@return instance of SQLService
@throws Exception exception | [
"Obtain",
"instance",
"of",
"the",
"SQL",
"Service"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L104-L142 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.updateSchema | public void updateSchema(String migrationPath) {
try {
logger.info("Updating schema... ");
int current_version = 0;
// first check the current schema version
HashMap<String, Object> configuration = getFirstResult("SELECT * FROM " + Constants.DB_TABLE_CONFIGURATIO... | java | public void updateSchema(String migrationPath) {
try {
logger.info("Updating schema... ");
int current_version = 0;
// first check the current schema version
HashMap<String, Object> configuration = getFirstResult("SELECT * FROM " + Constants.DB_TABLE_CONFIGURATIO... | [
"public",
"void",
"updateSchema",
"(",
"String",
"migrationPath",
")",
"{",
"try",
"{",
"logger",
".",
"info",
"(",
"\"Updating schema... \"",
")",
";",
"int",
"current_version",
"=",
"0",
";",
"// first check the current schema version",
"HashMap",
"<",
"String",
... | Update database schema
@param migrationPath path to migrations | [
"Update",
"database",
"schema"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L187-L248 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.executeUpdate | public int executeUpdate(String query) throws Exception {
int returnVal = 0;
Statement queryStatement = null;
try (Connection sqlConnection = getConnection()) {
queryStatement = sqlConnection.createStatement();
returnVal = queryStatement.executeUpdate(query);
} c... | java | public int executeUpdate(String query) throws Exception {
int returnVal = 0;
Statement queryStatement = null;
try (Connection sqlConnection = getConnection()) {
queryStatement = sqlConnection.createStatement();
returnVal = queryStatement.executeUpdate(query);
} c... | [
"public",
"int",
"executeUpdate",
"(",
"String",
"query",
")",
"throws",
"Exception",
"{",
"int",
"returnVal",
"=",
"0",
";",
"Statement",
"queryStatement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"getConnection",
"(",
")",
")",
"{"... | Wrapped version of standard jdbc executeUpdate Pays attention to DB
locked exception and waits up to 1s
@param query SQL query to execute
@throws Exception - will throw an exception if we can never get a lock | [
"Wrapped",
"version",
"of",
"standard",
"jdbc",
"executeUpdate",
"Pays",
"attention",
"to",
"DB",
"locked",
"exception",
"and",
"waits",
"up",
"to",
"1s"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L257-L275 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.getFirstResult | public HashMap<String, Object> getFirstResult(String query)
throws Exception {
HashMap<String, Object> result = null;
Statement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = getConnection()) {
queryStatement = sqlConnection.createSt... | java | public HashMap<String, Object> getFirstResult(String query)
throws Exception {
HashMap<String, Object> result = null;
Statement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = getConnection()) {
queryStatement = sqlConnection.createSt... | [
"public",
"HashMap",
"<",
"String",
",",
"Object",
">",
"getFirstResult",
"(",
"String",
"query",
")",
"throws",
"Exception",
"{",
"HashMap",
"<",
"String",
",",
"Object",
">",
"result",
"=",
"null",
";",
"Statement",
"queryStatement",
"=",
"null",
";",
"R... | Gets the first row for a query
@param query query to execute
@return result or NULL | [
"Gets",
"the",
"first",
"row",
"for",
"a",
"query"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L283-L318 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.toClob | public Clob toClob(String stringName, Connection sqlConnection) {
Clob clobName = null;
try {
clobName = sqlConnection.createClob();
clobName.setString(1, stringName);
} catch (SQLException e) {
// TODO Auto-generated catch block
logger.info("Unabl... | java | public Clob toClob(String stringName, Connection sqlConnection) {
Clob clobName = null;
try {
clobName = sqlConnection.createClob();
clobName.setString(1, stringName);
} catch (SQLException e) {
// TODO Auto-generated catch block
logger.info("Unabl... | [
"public",
"Clob",
"toClob",
"(",
"String",
"stringName",
",",
"Connection",
"sqlConnection",
")",
"{",
"Clob",
"clobName",
"=",
"null",
";",
"try",
"{",
"clobName",
"=",
"sqlConnection",
".",
"createClob",
"(",
")",
";",
"clobName",
".",
"setString",
"(",
... | Converts the given string to a clob object
@param stringName string name to clob
@param sqlConnection Connection object
@return Clob object or NULL | [
"Converts",
"the",
"given",
"string",
"to",
"a",
"clob",
"object"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L328-L339 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java | SQLService.getColumnNames | private String[] getColumnNames(ResultSetMetaData rsmd) throws Exception {
ArrayList<String> names = new ArrayList<String>();
// Get result set meta data
int numColumns = rsmd.getColumnCount();
// Get the column names; column indices start from 1
for (int i = 1; i < numColumns ... | java | private String[] getColumnNames(ResultSetMetaData rsmd) throws Exception {
ArrayList<String> names = new ArrayList<String>();
// Get result set meta data
int numColumns = rsmd.getColumnCount();
// Get the column names; column indices start from 1
for (int i = 1; i < numColumns ... | [
"private",
"String",
"[",
"]",
"getColumnNames",
"(",
"ResultSetMetaData",
"rsmd",
")",
"throws",
"Exception",
"{",
"ArrayList",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"// Get result set meta data",
"int",
"num... | Gets all of the column names for a result meta data
@param rsmd Resultset metadata
@return Array of column names
@throws Exception exception | [
"Gets",
"all",
"of",
"the",
"column",
"names",
"for",
"a",
"result",
"meta",
"data"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/SQLService.java#L348-L362 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.tableServers | public List<ServerRedirect> tableServers(int clientId) {
List<ServerRedirect> servers = new ArrayList<>();
try {
Client client = ClientService.getInstance().getClient(clientId);
servers = tableServers(client.getProfile().getId(), client.getActiveServerGroup());
} catch (... | java | public List<ServerRedirect> tableServers(int clientId) {
List<ServerRedirect> servers = new ArrayList<>();
try {
Client client = ClientService.getInstance().getClient(clientId);
servers = tableServers(client.getProfile().getId(), client.getActiveServerGroup());
} catch (... | [
"public",
"List",
"<",
"ServerRedirect",
">",
"tableServers",
"(",
"int",
"clientId",
")",
"{",
"List",
"<",
"ServerRedirect",
">",
"servers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"Client",
"client",
"=",
"ClientService",
".",
"getInst... | Get the server redirects for a given clientId from the database
@param clientId client ID
@return collection of ServerRedirects | [
"Get",
"the",
"server",
"redirects",
"for",
"a",
"given",
"clientId",
"from",
"the",
"database"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L64-L76 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.tableServers | public List<ServerRedirect> tableServers(int profileId, int serverGroupId) {
ArrayList<ServerRedirect> servers = new ArrayList<>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement... | java | public List<ServerRedirect> tableServers(int profileId, int serverGroupId) {
ArrayList<ServerRedirect> servers = new ArrayList<>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement... | [
"public",
"List",
"<",
"ServerRedirect",
">",
"tableServers",
"(",
"int",
"profileId",
",",
"int",
"serverGroupId",
")",
"{",
"ArrayList",
"<",
"ServerRedirect",
">",
"servers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"PreparedStatement",
"queryStatement",... | Get the server redirects belonging to a server group
@param profileId ID of profile
@param serverGroupId ID of server group
@return Collection of ServerRedirect for a server group | [
"Get",
"the",
"server",
"redirects",
"belonging",
"to",
"a",
"server",
"group"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L85-L127 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.tableServerGroups | public List<ServerGroup> tableServerGroups(int profileId) {
ArrayList<ServerGroup> serverGroups = new ArrayList<>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnectio... | java | public List<ServerGroup> tableServerGroups(int profileId) {
ArrayList<ServerGroup> serverGroups = new ArrayList<>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnectio... | [
"public",
"List",
"<",
"ServerGroup",
">",
"tableServerGroups",
"(",
"int",
"profileId",
")",
"{",
"ArrayList",
"<",
"ServerGroup",
">",
"serverGroups",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"PreparedStatement",
"queryStatement",
"=",
"null",
";",
"Res... | Return all server groups for a profile
@param profileId ID of profile
@return collection of ServerGroups for a profile | [
"Return",
"all",
"server",
"groups",
"for",
"a",
"profile"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L135-L172 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.getRedirect | public ServerRedirect getRedirect(int id) throws Exception {
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants... | java | public ServerRedirect getRedirect(int id) throws Exception {
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants... | [
"public",
"ServerRedirect",
"getRedirect",
"(",
"int",
"id",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"queryStatement",
"=",
"null",
";",
"ResultSet",
"results",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"g... | Returns redirect information for the given ID
@param id ID of redirect
@return ServerRedirect
@throws Exception exception | [
"Returns",
"redirect",
"information",
"for",
"the",
"given",
"ID"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L181-L220 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.getServerGroup | public ServerGroup getServerGroup(int id, int profileId) throws Exception {
PreparedStatement queryStatement = null;
ResultSet results = null;
if (id == 0) {
return new ServerGroup(0, "Default", profileId);
}
try (Connection sqlConnection = sqlService.getConnection(... | java | public ServerGroup getServerGroup(int id, int profileId) throws Exception {
PreparedStatement queryStatement = null;
ResultSet results = null;
if (id == 0) {
return new ServerGroup(0, "Default", profileId);
}
try (Connection sqlConnection = sqlService.getConnection(... | [
"public",
"ServerGroup",
"getServerGroup",
"(",
"int",
"id",
",",
"int",
"profileId",
")",
"throws",
"Exception",
"{",
"PreparedStatement",
"queryStatement",
"=",
"null",
";",
"ResultSet",
"results",
"=",
"null",
";",
"if",
"(",
"id",
"==",
"0",
")",
"{",
... | Returns server group by ID
@param id ID of server group
@return ServerGroup
@throws Exception exception | [
"Returns",
"server",
"group",
"by",
"ID"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L229-L268 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.addServerRedirectToProfile | public int addServerRedirectToProfile(String region, String srcUrl, String destUrl, String hostHeader,
int profileId, int clientId) throws Exception {
int serverId = -1;
try {
Client client = ClientService.getInstance().getClient(clientId);
... | java | public int addServerRedirectToProfile(String region, String srcUrl, String destUrl, String hostHeader,
int profileId, int clientId) throws Exception {
int serverId = -1;
try {
Client client = ClientService.getInstance().getClient(clientId);
... | [
"public",
"int",
"addServerRedirectToProfile",
"(",
"String",
"region",
",",
"String",
"srcUrl",
",",
"String",
"destUrl",
",",
"String",
"hostHeader",
",",
"int",
"profileId",
",",
"int",
"clientId",
")",
"throws",
"Exception",
"{",
"int",
"serverId",
"=",
"-... | Add server redirect to a profile, using current active ServerGroup
@param region region
@param srcUrl source URL
@param destUrl destination URL
@param hostHeader host header
@param profileId profile ID
@return ID of added ServerRedirect
@throws Exception exception | [
"Add",
"server",
"redirect",
"to",
"a",
"profile",
"using",
"current",
"active",
"ServerGroup"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L281-L293 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.addServerRedirect | public int addServerRedirect(String region, String srcUrl, String destUrl, String hostHeader, int profileId, int groupId) throws Exception {
int serverId = -1;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
... | java | public int addServerRedirect(String region, String srcUrl, String destUrl, String hostHeader, int profileId, int groupId) throws Exception {
int serverId = -1;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
... | [
"public",
"int",
"addServerRedirect",
"(",
"String",
"region",
",",
"String",
"srcUrl",
",",
"String",
"destUrl",
",",
"String",
"hostHeader",
",",
"int",
"profileId",
",",
"int",
"groupId",
")",
"throws",
"Exception",
"{",
"int",
"serverId",
"=",
"-",
"1",
... | Add server redirect to a profile
@param region region
@param srcUrl source URL
@param destUrl destination URL
@param hostHeader host header
@param profileId profile ID
@param groupId group ID
@return ID of added ServerRedirect
@throws Exception exception | [
"Add",
"server",
"redirect",
"to",
"a",
"profile"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L307-L355 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.addServerGroup | public int addServerGroup(String groupName, int profileId) throws Exception {
int groupId = -1;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement("INSERT INTO... | java | public int addServerGroup(String groupName, int profileId) throws Exception {
int groupId = -1;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement("INSERT INTO... | [
"public",
"int",
"addServerGroup",
"(",
"String",
"groupName",
",",
"int",
"profileId",
")",
"throws",
"Exception",
"{",
"int",
"groupId",
"=",
"-",
"1",
";",
"PreparedStatement",
"statement",
"=",
"null",
";",
"ResultSet",
"results",
"=",
"null",
";",
"try"... | Add a new server group
@param groupName name of the group
@param profileId ID of associated profile
@return id of server group
@throws Exception | [
"Add",
"a",
"new",
"server",
"group"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L365-L405 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.setGroupName | public void setGroupName(String name, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVER_GROUPS +
" SET " + Constant... | java | public void setGroupName(String name, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVER_GROUPS +
" SET " + Constant... | [
"public",
"void",
"setGroupName",
"(",
"String",
"name",
",",
"int",
"id",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"statement",
"=",... | Set the group name
@param name new name of server group
@param id ID of group | [
"Set",
"the",
"group",
"name"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L413-L436 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.setSourceUrl | public void setSourceUrl(String newUrl, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVERS +
" SET " + Constants.SE... | java | public void setSourceUrl(String newUrl, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVERS +
" SET " + Constants.SE... | [
"public",
"void",
"setSourceUrl",
"(",
"String",
"newUrl",
",",
"int",
"id",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"statement",
"=... | Set source url for a server
@param newUrl new URL
@param id Server ID | [
"Set",
"source",
"url",
"for",
"a",
"server"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L476-L499 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.deleteRedirect | public void deleteRedirect(int id) {
try {
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS +
" WHERE " + Constants.GENERIC_ID + " = " + id + ";");
} catch (Exception e) {
e.printStackTrace();
}
} | java | public void deleteRedirect(int id) {
try {
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS +
" WHERE " + Constants.GENERIC_ID + " = " + id + ";");
} catch (Exception e) {
e.printStackTrace();
}
} | [
"public",
"void",
"deleteRedirect",
"(",
"int",
"id",
")",
"{",
"try",
"{",
"sqlService",
".",
"executeUpdate",
"(",
"\"DELETE FROM \"",
"+",
"Constants",
".",
"DB_TABLE_SERVERS",
"+",
"\" WHERE \"",
"+",
"Constants",
".",
"GENERIC_ID",
"+",
"\" = \"",
"+",
"i... | Deletes a redirect by id
@param id redirect ID | [
"Deletes",
"a",
"redirect",
"by",
"id"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L568-L575 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.deleteServerGroup | public void deleteServerGroup(int id) {
try {
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVER_GROUPS +
" WHERE " + Constants.GENERIC_ID + " = " + id + ";");
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS ... | java | public void deleteServerGroup(int id) {
try {
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVER_GROUPS +
" WHERE " + Constants.GENERIC_ID + " = " + id + ";");
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS ... | [
"public",
"void",
"deleteServerGroup",
"(",
"int",
"id",
")",
"{",
"try",
"{",
"sqlService",
".",
"executeUpdate",
"(",
"\"DELETE FROM \"",
"+",
"Constants",
".",
"DB_TABLE_SERVER_GROUPS",
"+",
"\" WHERE \"",
"+",
"Constants",
".",
"GENERIC_ID",
"+",
"\" = \"",
... | Delete a server group by id
@param id server group ID | [
"Delete",
"a",
"server",
"group",
"by",
"id"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L582-L592 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.getProfilesForServerName | public Profile[] getProfilesForServerName(String serverName) throws Exception {
int profileId = -1;
ArrayList<Profile> returnProfiles = new ArrayList<Profile>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConn... | java | public Profile[] getProfilesForServerName(String serverName) throws Exception {
int profileId = -1;
ArrayList<Profile> returnProfiles = new ArrayList<Profile>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConn... | [
"public",
"Profile",
"[",
"]",
"getProfilesForServerName",
"(",
"String",
"serverName",
")",
"throws",
"Exception",
"{",
"int",
"profileId",
"=",
"-",
"1",
";",
"ArrayList",
"<",
"Profile",
">",
"returnProfiles",
"=",
"new",
"ArrayList",
"<",
"Profile",
">",
... | This returns all profiles associated with a server name
@param serverName server Name
@return profile UUID
@throws Exception exception | [
"This",
"returns",
"all",
"profiles",
"associated",
"with",
"a",
"server",
"name"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L601-L644 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.getInstance | public static PluginManager getInstance() {
if (_instance == null) {
_instance = new PluginManager();
_instance.classInformation = new HashMap<String, ClassInformation>();
_instance.methodInformation = new HashMap<String, com.groupon.odo.proxylib.models.Method>();
... | java | public static PluginManager getInstance() {
if (_instance == null) {
_instance = new PluginManager();
_instance.classInformation = new HashMap<String, ClassInformation>();
_instance.methodInformation = new HashMap<String, com.groupon.odo.proxylib.models.Method>();
... | [
"public",
"static",
"PluginManager",
"getInstance",
"(",
")",
"{",
"if",
"(",
"_instance",
"==",
"null",
")",
"{",
"_instance",
"=",
"new",
"PluginManager",
"(",
")",
";",
"_instance",
".",
"classInformation",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Cl... | Gets the current instance of plugin manager
@return PluginManager | [
"Gets",
"the",
"current",
"instance",
"of",
"plugin",
"manager"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L72-L97 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.identifyClasses | public void identifyClasses(final String pluginDirectory) throws Exception {
methodInformation.clear();
jarInformation.clear();
try {
new FileTraversal() {
public void onDirectory(final File d) {
}
public void onFile(final File f) {
... | java | public void identifyClasses(final String pluginDirectory) throws Exception {
methodInformation.clear();
jarInformation.clear();
try {
new FileTraversal() {
public void onDirectory(final File d) {
}
public void onFile(final File f) {
... | [
"public",
"void",
"identifyClasses",
"(",
"final",
"String",
"pluginDirectory",
")",
"throws",
"Exception",
"{",
"methodInformation",
".",
"clear",
"(",
")",
";",
"jarInformation",
".",
"clear",
"(",
")",
";",
"try",
"{",
"new",
"FileTraversal",
"(",
")",
"{... | This loads plugin file information into a hash for lazy loading later on
@param pluginDirectory path of plugin
@throws Exception exception | [
"This",
"loads",
"plugin",
"file",
"information",
"into",
"a",
"hash",
"for",
"lazy",
"loading",
"later",
"on"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L117-L186 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.getClassNameFromPath | private String getClassNameFromPath(String path) {
String className = path.replace(".class", "");
// for *nix
if (className.startsWith("/")) {
className = className.substring(1, className.length());
}
className = className.replace("/", ".");
// for windows
... | java | private String getClassNameFromPath(String path) {
String className = path.replace(".class", "");
// for *nix
if (className.startsWith("/")) {
className = className.substring(1, className.length());
}
className = className.replace("/", ".");
// for windows
... | [
"private",
"String",
"getClassNameFromPath",
"(",
"String",
"path",
")",
"{",
"String",
"className",
"=",
"path",
".",
"replace",
"(",
"\".class\"",
",",
"\"\"",
")",
";",
"// for *nix",
"if",
"(",
"className",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{... | Create a classname from a given path
@param path
@return | [
"Create",
"a",
"classname",
"from",
"a",
"given",
"path"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L194-L210 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.loadClass | public void loadClass(String className) throws Exception {
ClassInformation classInfo = classInformation.get(className);
logger.info("Loading plugin.: {}, {}", className, classInfo.pluginPath);
// get URL for proxylib
// need to load this also otherwise the annotations cannot be found ... | java | public void loadClass(String className) throws Exception {
ClassInformation classInfo = classInformation.get(className);
logger.info("Loading plugin.: {}, {}", className, classInfo.pluginPath);
// get URL for proxylib
// need to load this also otherwise the annotations cannot be found ... | [
"public",
"void",
"loadClass",
"(",
"String",
"className",
")",
"throws",
"Exception",
"{",
"ClassInformation",
"classInfo",
"=",
"classInformation",
".",
"get",
"(",
"className",
")",
";",
"logger",
".",
"info",
"(",
"\"Loading plugin.: {}, {}\"",
",",
"className... | Loads the specified class name and stores it in the hash
@param className class name
@throws Exception exception | [
"Loads",
"the",
"specified",
"class",
"name",
"and",
"stores",
"it",
"in",
"the",
"hash"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L218-L248 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.callFunction | public void callFunction(String className, String methodName, PluginArguments pluginArgs, Object... args) throws Exception {
Class<?> cls = getClass(className);
ArrayList<Object> newArgs = new ArrayList<>();
newArgs.add(pluginArgs);
com.groupon.odo.proxylib.models.Method m = preparePlug... | java | public void callFunction(String className, String methodName, PluginArguments pluginArgs, Object... args) throws Exception {
Class<?> cls = getClass(className);
ArrayList<Object> newArgs = new ArrayList<>();
newArgs.add(pluginArgs);
com.groupon.odo.proxylib.models.Method m = preparePlug... | [
"public",
"void",
"callFunction",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"PluginArguments",
"pluginArgs",
",",
"Object",
"...",
"args",
")",
"throws",
"Exception",
"{",
"Class",
"<",
"?",
">",
"cls",
"=",
"getClass",
"(",
"className",
... | Calls the specified function with the specified arguments. This is used for v2 response overrides
@param className name of class
@param methodName name of method
@param pluginArgs plugin arguments
@param args arguments to supply to function
@throws Exception exception | [
"Calls",
"the",
"specified",
"function",
"with",
"the",
"specified",
"arguments",
".",
"This",
"is",
"used",
"for",
"v2",
"response",
"overrides"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L259-L267 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.getClass | private synchronized Class<?> getClass(String className) throws Exception {
// see if we need to invalidate the class
ClassInformation classInfo = classInformation.get(className);
File classFile = new File(classInfo.pluginPath);
if (classFile.lastModified() > classInfo.lastModified) {
... | java | private synchronized Class<?> getClass(String className) throws Exception {
// see if we need to invalidate the class
ClassInformation classInfo = classInformation.get(className);
File classFile = new File(classInfo.pluginPath);
if (classFile.lastModified() > classInfo.lastModified) {
... | [
"private",
"synchronized",
"Class",
"<",
"?",
">",
"getClass",
"(",
"String",
"className",
")",
"throws",
"Exception",
"{",
"// see if we need to invalidate the class",
"ClassInformation",
"classInfo",
"=",
"classInformation",
".",
"get",
"(",
"className",
")",
";",
... | Obtain the class of a given className
@param className
@return
@throws Exception | [
"Obtain",
"the",
"class",
"of",
"a",
"given",
"className"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L435-L460 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.getMethods | public String[] getMethods(String pluginClass) throws Exception {
ArrayList<String> methodNames = new ArrayList<String>();
Method[] methods = getClass(pluginClass).getDeclaredMethods();
for (Method method : methods) {
logger.info("Checking {}", method.getName());
com.gr... | java | public String[] getMethods(String pluginClass) throws Exception {
ArrayList<String> methodNames = new ArrayList<String>();
Method[] methods = getClass(pluginClass).getDeclaredMethods();
for (Method method : methods) {
logger.info("Checking {}", method.getName());
com.gr... | [
"public",
"String",
"[",
"]",
"getMethods",
"(",
"String",
"pluginClass",
")",
"throws",
"Exception",
"{",
"ArrayList",
"<",
"String",
">",
"methodNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Method",
"[",
"]",
"methods",
"=",
"ge... | Returns a string array of the methods loaded for a class
@param pluginClass name of class
@return string array of the methods loaded for the class
@throws Exception exception | [
"Returns",
"a",
"string",
"array",
"of",
"the",
"methods",
"loaded",
"for",
"a",
"class"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L478-L503 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.getMethodsNotInGroup | public List<com.groupon.odo.proxylib.models.Method> getMethodsNotInGroup(int groupId) throws Exception {
List<com.groupon.odo.proxylib.models.Method> allMethods = getAllMethods();
List<com.groupon.odo.proxylib.models.Method> methodsNotInGroup = new ArrayList<com.groupon.odo.proxylib.models.Method>();
... | java | public List<com.groupon.odo.proxylib.models.Method> getMethodsNotInGroup(int groupId) throws Exception {
List<com.groupon.odo.proxylib.models.Method> allMethods = getAllMethods();
List<com.groupon.odo.proxylib.models.Method> methodsNotInGroup = new ArrayList<com.groupon.odo.proxylib.models.Method>();
... | [
"public",
"List",
"<",
"com",
".",
"groupon",
".",
"odo",
".",
"proxylib",
".",
"models",
".",
"Method",
">",
"getMethodsNotInGroup",
"(",
"int",
"groupId",
")",
"throws",
"Exception",
"{",
"List",
"<",
"com",
".",
"groupon",
".",
"odo",
".",
"proxylib",... | returns all methods not in the group
@param groupId Id of group
@return List of Methods for a group
@throws Exception exception | [
"returns",
"all",
"methods",
"not",
"in",
"the",
"group"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L562-L583 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.getPlugins | public Plugin[] getPlugins(Boolean onlyValid) {
Configuration[] configurations = ConfigurationService.getInstance().getConfigurations(Constants.DB_TABLE_CONFIGURATION_PLUGIN_PATH);
ArrayList<Plugin> plugins = new ArrayList<Plugin>();
if (configurations == null) {
return new Plugin[... | java | public Plugin[] getPlugins(Boolean onlyValid) {
Configuration[] configurations = ConfigurationService.getInstance().getConfigurations(Constants.DB_TABLE_CONFIGURATION_PLUGIN_PATH);
ArrayList<Plugin> plugins = new ArrayList<Plugin>();
if (configurations == null) {
return new Plugin[... | [
"public",
"Plugin",
"[",
"]",
"getPlugins",
"(",
"Boolean",
"onlyValid",
")",
"{",
"Configuration",
"[",
"]",
"configurations",
"=",
"ConfigurationService",
".",
"getInstance",
"(",
")",
".",
"getConfigurations",
"(",
"Constants",
".",
"DB_TABLE_CONFIGURATION_PLUGIN... | Returns the data about all of the plugins that are set
@param onlyValid True to get only valid plugins, False for all
@return array of Plugins set | [
"Returns",
"the",
"data",
"about",
"all",
"of",
"the",
"plugins",
"that",
"are",
"set"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L591-L620 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java | PluginManager.getResource | public byte[] getResource(String pluginName, String fileName) throws Exception {
// TODO: This is going to be slow.. future improvement is to cache the data instead of searching all jars
for (String jarFilename : jarInformation) {
JarFile jarFile = new JarFile(new File(jarFilename));
... | java | public byte[] getResource(String pluginName, String fileName) throws Exception {
// TODO: This is going to be slow.. future improvement is to cache the data instead of searching all jars
for (String jarFilename : jarInformation) {
JarFile jarFile = new JarFile(new File(jarFilename));
... | [
"public",
"byte",
"[",
"]",
"getResource",
"(",
"String",
"pluginName",
",",
"String",
"fileName",
")",
"throws",
"Exception",
"{",
"// TODO: This is going to be slow.. future improvement is to cache the data instead of searching all jars",
"for",
"(",
"String",
"jarFilename",
... | Gets a static resource from a plugin
@param pluginName - Name of the plugin(defined in the plugin manifest)
@param fileName - Filename to fetch
@return byte array of the resource
@throws Exception exception | [
"Gets",
"a",
"static",
"resource",
"from",
"a",
"plugin"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L640-L677 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/HostsFileUtils.java | HostsFileUtils.changeHost | public static boolean changeHost(String hostName,
boolean enable,
boolean disable,
boolean remove,
boolean isEnabled,
boolean exists) t... | java | public static boolean changeHost(String hostName,
boolean enable,
boolean disable,
boolean remove,
boolean isEnabled,
boolean exists) t... | [
"public",
"static",
"boolean",
"changeHost",
"(",
"String",
"hostName",
",",
"boolean",
"enable",
",",
"boolean",
"disable",
",",
"boolean",
"remove",
",",
"boolean",
"isEnabled",
",",
"boolean",
"exists",
")",
"throws",
"Exception",
"{",
"// Open the file that is... | Only one boolean param should be true at a time for this function to return the proper results
@param hostName
@param enable
@param disable
@param remove
@param isEnabled
@param exists
@return
@throws Exception | [
"Only",
"one",
"boolean",
"param",
"should",
"be",
"true",
"at",
"a",
"time",
"for",
"this",
"function",
"to",
"return",
"the",
"proper",
"results"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/HostsFileUtils.java#L74-L164 | train |
groupon/odo | proxyplugin/src/main/java/com/groupon/odo/plugin/PluginHelper.java | PluginHelper.getByteArrayDataAsString | public static String getByteArrayDataAsString(String contentEncoding, byte[] bytes) {
ByteArrayOutputStream byteout = null;
if (contentEncoding != null &&
contentEncoding.equals("gzip")) {
// GZIP
ByteArrayInputStream bytein = null;
GZIPInputStream zis... | java | public static String getByteArrayDataAsString(String contentEncoding, byte[] bytes) {
ByteArrayOutputStream byteout = null;
if (contentEncoding != null &&
contentEncoding.equals("gzip")) {
// GZIP
ByteArrayInputStream bytein = null;
GZIPInputStream zis... | [
"public",
"static",
"String",
"getByteArrayDataAsString",
"(",
"String",
"contentEncoding",
",",
"byte",
"[",
"]",
"bytes",
")",
"{",
"ByteArrayOutputStream",
"byteout",
"=",
"null",
";",
"if",
"(",
"contentEncoding",
"!=",
"null",
"&&",
"contentEncoding",
".",
... | Decodes stream data based on content encoding
@param contentEncoding
@param bytes
@return String representing the stream data | [
"Decodes",
"stream",
"data",
"based",
"on",
"content",
"encoding"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyplugin/src/main/java/com/groupon/odo/plugin/PluginHelper.java#L137-L187 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java | BackupController.getBackup | @SuppressWarnings("deprecation")
@RequestMapping(value = "/api/backup", method = RequestMethod.GET)
public
@ResponseBody
String getBackup(Model model, HttpServletResponse response) throws Exception {
response.addHeader("Content-Disposition", "attachment; filename=backup.json");
response.... | java | @SuppressWarnings("deprecation")
@RequestMapping(value = "/api/backup", method = RequestMethod.GET)
public
@ResponseBody
String getBackup(Model model, HttpServletResponse response) throws Exception {
response.addHeader("Content-Disposition", "attachment; filename=backup.json");
response.... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/api/backup\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"@",
"ResponseBody",
"String",
"getBackup",
"(",
"Model",
"model",
",",
"HttpServle... | Get all backup data
@param model
@return
@throws Exception | [
"Get",
"all",
"backup",
"data"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java#L64-L77 | train |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java | BackupController.processBackup | @RequestMapping(value = "/api/backup", method = RequestMethod.POST)
public
@ResponseBody
Backup processBackup(@RequestParam("fileData") MultipartFile fileData) throws Exception {
// Method taken from: http://spring.io/guides/gs/uploading-files/
if (!fileData.isEmpty()) {
try {
... | java | @RequestMapping(value = "/api/backup", method = RequestMethod.POST)
public
@ResponseBody
Backup processBackup(@RequestParam("fileData") MultipartFile fileData) throws Exception {
// Method taken from: http://spring.io/guides/gs/uploading-files/
if (!fileData.isEmpty()) {
try {
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/api/backup\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"Backup",
"processBackup",
"(",
"@",
"RequestParam",
"(",
"\"fileData\"",
")",
"MultipartFile",
"fileData",
")",
"t... | Restore backup data
@param fileData - json file with restore data
@return
@throws Exception | [
"Restore",
"backup",
"data"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java#L86-L105 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java | Client.enableHost | public static void enableHost(String hostName) throws Exception {
Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);
impl.enableHost(hostName... | java | public static void enableHost(String hostName) throws Exception {
Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);
impl.enableHost(hostName... | [
"public",
"static",
"void",
"enableHost",
"(",
"String",
"hostName",
")",
"throws",
"Exception",
"{",
"Registry",
"myRegistry",
"=",
"LocateRegistry",
".",
"getRegistry",
"(",
"\"127.0.0.1\"",
",",
"port",
")",
";",
"com",
".",
"groupon",
".",
"odo",
".",
"p... | Enable a host
@param hostName
@throws Exception | [
"Enable",
"a",
"host"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java#L33-L38 | train |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java | Client.isAvailable | public static boolean isAvailable() throws Exception {
try {
Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);
return tru... | java | public static boolean isAvailable() throws Exception {
try {
Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);
return tru... | [
"public",
"static",
"boolean",
"isAvailable",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"Registry",
"myRegistry",
"=",
"LocateRegistry",
".",
"getRegistry",
"(",
"\"127.0.0.1\"",
",",
"port",
")",
";",
"com",
".",
"groupon",
".",
"odo",
".",
"proxyli... | Returns whether or not the host editor service is available
@return
@throws Exception | [
"Returns",
"whether",
"or",
"not",
"the",
"host",
"editor",
"service",
"is",
"available"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java#L100-L108 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java | FreeMarkerTag.getContextPath | protected String getContextPath(){
if(context != null) return context;
if(get("context_path") == null){
throw new ViewException("context_path missing - red alarm!");
}
return get("context_path").toString();
} | java | protected String getContextPath(){
if(context != null) return context;
if(get("context_path") == null){
throw new ViewException("context_path missing - red alarm!");
}
return get("context_path").toString();
} | [
"protected",
"String",
"getContextPath",
"(",
")",
"{",
"if",
"(",
"context",
"!=",
"null",
")",
"return",
"context",
";",
"if",
"(",
"get",
"(",
"\"context_path\"",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"ViewException",
"(",
"\"context_path missing -... | Returns this applications' context path.
@return context path. | [
"Returns",
"this",
"applications",
"context",
"path",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java#L122-L130 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java | FreeMarkerTag.process | protected void process(String text, Map params, Writer writer){
try{
Template t = new Template("temp", new StringReader(text), FreeMarkerTL.getEnvironment().getConfiguration());
t.process(params, writer);
}catch(Exception e){
throw new ViewException(e);
... | java | protected void process(String text, Map params, Writer writer){
try{
Template t = new Template("temp", new StringReader(text), FreeMarkerTL.getEnvironment().getConfiguration());
t.process(params, writer);
}catch(Exception e){
throw new ViewException(e);
... | [
"protected",
"void",
"process",
"(",
"String",
"text",
",",
"Map",
"params",
",",
"Writer",
"writer",
")",
"{",
"try",
"{",
"Template",
"t",
"=",
"new",
"Template",
"(",
"\"temp\"",
",",
"new",
"StringReader",
"(",
"text",
")",
",",
"FreeMarkerTL",
".",
... | Processes text as a FreeMarker template. Usually used to process an inner body of a tag.
@param text text of a template.
@param params map with parameters for processing.
@param writer writer to write output to. | [
"Processes",
"text",
"as",
"a",
"FreeMarker",
"template",
".",
"Usually",
"used",
"to",
"process",
"an",
"inner",
"body",
"of",
"a",
"tag",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java#L140-L148 | train |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java | FreeMarkerTag.getAllVariables | protected Map getAllVariables(){
try{
Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator();
Map vars = new HashMap();
while (names.hasNext()) {
Object name =names.next();
vars.put(name, get(name.toString()));
... | java | protected Map getAllVariables(){
try{
Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator();
Map vars = new HashMap();
while (names.hasNext()) {
Object name =names.next();
vars.put(name, get(name.toString()));
... | [
"protected",
"Map",
"getAllVariables",
"(",
")",
"{",
"try",
"{",
"Iterator",
"names",
"=",
"FreeMarkerTL",
".",
"getEnvironment",
"(",
")",
".",
"getKnownVariableNames",
"(",
")",
".",
"iterator",
"(",
")",
";",
"Map",
"vars",
"=",
"new",
"HashMap",
"(",
... | Returns a map of all variables in scope.
@return map of all variables in scope. | [
"Returns",
"a",
"map",
"of",
"all",
"variables",
"in",
"scope",
"."
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java#L154-L166 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/favorites/AbstractFavoritesController.java | AbstractFavoritesController.setMarketplaceFName | @Value("${org.apereo.portal.portlets.favorites.MarketplaceFunctionalName:null}")
public void setMarketplaceFName(String marketplaceFunctionalName) {
// interpret null, non-text-having, or literal "null" as
// signaling lack of Marketplace functional name.
if (!StringUtils.hasText(marketplac... | java | @Value("${org.apereo.portal.portlets.favorites.MarketplaceFunctionalName:null}")
public void setMarketplaceFName(String marketplaceFunctionalName) {
// interpret null, non-text-having, or literal "null" as
// signaling lack of Marketplace functional name.
if (!StringUtils.hasText(marketplac... | [
"@",
"Value",
"(",
"\"${org.apereo.portal.portlets.favorites.MarketplaceFunctionalName:null}\"",
")",
"public",
"void",
"setMarketplaceFName",
"(",
"String",
"marketplaceFunctionalName",
")",
"{",
"// interpret null, non-text-having, or literal \"null\" as",
"// signaling lack of Marketp... | Configures FavoritesController to include a Marketplace portlet functional name in the Model,
which ultimately signals and enables the View to include convenient link to Marketplace for
user to add new favorites.
<p>When set to null, signals Favorites portlet to suppress links to Marketplace. Setting to
the empty Stri... | [
"Configures",
"FavoritesController",
"to",
"include",
"a",
"Marketplace",
"portlet",
"functional",
"name",
"in",
"the",
"Model",
"which",
"ultimately",
"signals",
"and",
"enables",
"the",
"View",
"to",
"include",
"convenient",
"link",
"to",
"Marketplace",
"for",
"... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/favorites/AbstractFavoritesController.java#L76-L87 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.handleSearchResult | @EventMapping(SearchConstants.SEARCH_RESULTS_QNAME_STRING)
public void handleSearchResult(EventRequest request) {
// UP-3887 Design flaw. Both the searchLauncher portlet instance and the search portlet
// instance receive
// searchRequest and searchResult events because they are in the sam... | java | @EventMapping(SearchConstants.SEARCH_RESULTS_QNAME_STRING)
public void handleSearchResult(EventRequest request) {
// UP-3887 Design flaw. Both the searchLauncher portlet instance and the search portlet
// instance receive
// searchRequest and searchResult events because they are in the sam... | [
"@",
"EventMapping",
"(",
"SearchConstants",
".",
"SEARCH_RESULTS_QNAME_STRING",
")",
"public",
"void",
"handleSearchResult",
"(",
"EventRequest",
"request",
")",
"{",
"// UP-3887 Design flaw. Both the searchLauncher portlet instance and the search portlet",
"// instance receive",
... | Handles all the SearchResults events coming back from portlets | [
"Handles",
"all",
"the",
"SearchResults",
"events",
"coming",
"back",
"from",
"portlets"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L464-L517 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.showSearchForm | @RequestMapping
public ModelAndView showSearchForm(RenderRequest request, RenderResponse response) {
final Map<String, Object> model = new HashMap<>();
String viewName;
// Determine if the new REST search should be used
if (isRestSearch(request)) {
viewName = "/jsp/Searc... | java | @RequestMapping
public ModelAndView showSearchForm(RenderRequest request, RenderResponse response) {
final Map<String, Object> model = new HashMap<>();
String viewName;
// Determine if the new REST search should be used
if (isRestSearch(request)) {
viewName = "/jsp/Searc... | [
"@",
"RequestMapping",
"public",
"ModelAndView",
"showSearchForm",
"(",
"RenderRequest",
"request",
",",
"RenderResponse",
"response",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"String",
... | Display a search form | [
"Display",
"a",
"search",
"form"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L538-L563 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.calculateSearchLaunchUrl | private String calculateSearchLaunchUrl(RenderRequest request, RenderResponse response) {
final HttpServletRequest httpRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
final IPortalUrlBuilder portalUrlBuilder =
this.portalUrlProvider.getPortalUrlBuilderBy... | java | private String calculateSearchLaunchUrl(RenderRequest request, RenderResponse response) {
final HttpServletRequest httpRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
final IPortalUrlBuilder portalUrlBuilder =
this.portalUrlProvider.getPortalUrlBuilderBy... | [
"private",
"String",
"calculateSearchLaunchUrl",
"(",
"RenderRequest",
"request",
",",
"RenderResponse",
"response",
")",
"{",
"final",
"HttpServletRequest",
"httpRequest",
"=",
"this",
".",
"portalRequestUtils",
".",
"getPortletHttpRequest",
"(",
"request",
")",
";",
... | Create an actionUrl for the indicated portlet The resource URL is for the ajax typing search
results response.
@param request render request
@param response render response | [
"Create",
"an",
"actionUrl",
"for",
"the",
"indicated",
"portlet",
"The",
"resource",
"URL",
"is",
"for",
"the",
"ajax",
"typing",
"search",
"results",
"response",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L572-L579 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.showJSONSearchResults | @ResourceMapping(value = "retrieveSearchJSONResults")
public ModelAndView showJSONSearchResults(PortletRequest request) {
PortletPreferences prefs = request.getPreferences();
int maxTextLength =
Integer.parseInt(prefs.getValue(AUTOCOMPLETE_MAX_TEXT_LENGTH_PREF_NAME, "180"));
... | java | @ResourceMapping(value = "retrieveSearchJSONResults")
public ModelAndView showJSONSearchResults(PortletRequest request) {
PortletPreferences prefs = request.getPreferences();
int maxTextLength =
Integer.parseInt(prefs.getValue(AUTOCOMPLETE_MAX_TEXT_LENGTH_PREF_NAME, "180"));
... | [
"@",
"ResourceMapping",
"(",
"value",
"=",
"\"retrieveSearchJSONResults\"",
")",
"public",
"ModelAndView",
"showJSONSearchResults",
"(",
"PortletRequest",
"request",
")",
"{",
"PortletPreferences",
"prefs",
"=",
"request",
".",
"getPreferences",
"(",
")",
";",
"int",
... | Display AJAX autocomplete search results for the last query | [
"Display",
"AJAX",
"autocomplete",
"search",
"results",
"for",
"the",
"last",
"query"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L660-L684 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.getCleanedAndSortedMapResults | private SortedMap<Integer, List<AutocompleteResultsModel>> getCleanedAndSortedMapResults(
ConcurrentMap<String, List<Tuple<SearchResult, String>>> resultsMap,
int maxTextLength) {
SortedMap<Integer, List<AutocompleteResultsModel>> prioritizedResultsMap =
createAutocomplet... | java | private SortedMap<Integer, List<AutocompleteResultsModel>> getCleanedAndSortedMapResults(
ConcurrentMap<String, List<Tuple<SearchResult, String>>> resultsMap,
int maxTextLength) {
SortedMap<Integer, List<AutocompleteResultsModel>> prioritizedResultsMap =
createAutocomplet... | [
"private",
"SortedMap",
"<",
"Integer",
",",
"List",
"<",
"AutocompleteResultsModel",
">",
">",
"getCleanedAndSortedMapResults",
"(",
"ConcurrentMap",
"<",
"String",
",",
"List",
"<",
"Tuple",
"<",
"SearchResult",
",",
"String",
">",
">",
">",
"resultsMap",
",",... | Return the search results in a sorted map based on priority of the search result type
@param resultsMap Search results map
@return Sorted map of search results ordered on search result type priority | [
"Return",
"the",
"search",
"results",
"in",
"a",
"sorted",
"map",
"based",
"on",
"priority",
"of",
"the",
"search",
"result",
"type"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L734-L766 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.modifySearchResultLinkTitle | protected void modifySearchResultLinkTitle(
SearchResult result,
final HttpServletRequest httpServletRequest,
final IPortletWindowId portletWindowId) {
// If the title contains a SpEL expression, parse it with the portlet definition in the
// evaluation context.
... | java | protected void modifySearchResultLinkTitle(
SearchResult result,
final HttpServletRequest httpServletRequest,
final IPortletWindowId portletWindowId) {
// If the title contains a SpEL expression, parse it with the portlet definition in the
// evaluation context.
... | [
"protected",
"void",
"modifySearchResultLinkTitle",
"(",
"SearchResult",
"result",
",",
"final",
"HttpServletRequest",
"httpServletRequest",
",",
"final",
"IPortletWindowId",
"portletWindowId",
")",
"{",
"// If the title contains a SpEL expression, parse it with the portlet definitio... | Since portlets don't have access to the portlet definition to create a useful search results
link using something like the portlet definition's title, post-process the link text and for
those portlets whose type is present in the substitution set, replace the title with the
portlet definition's title.
@param result Se... | [
"Since",
"portlets",
"don",
"t",
"have",
"access",
"to",
"the",
"portlet",
"definition",
"to",
"create",
"a",
"useful",
"search",
"results",
"link",
"using",
"something",
"like",
"the",
"portlet",
"definition",
"s",
"title",
"post",
"-",
"process",
"the",
"l... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L845-L868 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.getResultUrl | protected String getResultUrl(
HttpServletRequest httpServletRequest,
SearchResult result,
IPortletWindowId portletWindowId) {
final String externalUrl = result.getExternalUrl();
if (externalUrl != null) {
return externalUrl;
}
UrlType url... | java | protected String getResultUrl(
HttpServletRequest httpServletRequest,
SearchResult result,
IPortletWindowId portletWindowId) {
final String externalUrl = result.getExternalUrl();
if (externalUrl != null) {
return externalUrl;
}
UrlType url... | [
"protected",
"String",
"getResultUrl",
"(",
"HttpServletRequest",
"httpServletRequest",
",",
"SearchResult",
"result",
",",
"IPortletWindowId",
"portletWindowId",
")",
"{",
"final",
"String",
"externalUrl",
"=",
"result",
".",
"getExternalUrl",
"(",
")",
";",
"if",
... | Determine the url for the search result | [
"Determine",
"the",
"url",
"for",
"the",
"search",
"result"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L871-L930 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/dlm/FragmentChannelInfo.java | FragmentChannelInfo.getParameterValue | public String getParameterValue(String name) {
NodeList parms = node.getChildNodes();
for (int i = 0; i < parms.getLength(); i++) {
Element parm = (Element) parms.item(i);
if (parm.getTagName().equals(Constants.ELM_PARAMETER)) {
String parmName = parm.getAttribut... | java | public String getParameterValue(String name) {
NodeList parms = node.getChildNodes();
for (int i = 0; i < parms.getLength(); i++) {
Element parm = (Element) parms.item(i);
if (parm.getTagName().equals(Constants.ELM_PARAMETER)) {
String parmName = parm.getAttribut... | [
"public",
"String",
"getParameterValue",
"(",
"String",
"name",
")",
"{",
"NodeList",
"parms",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"parms",
".",
"getLength",
"(",
")",
";",
"i",
"++",
"... | Returns the value of an parameter or null if such a parameter is not defined on the
underlying channel element. | [
"Returns",
"the",
"value",
"of",
"an",
"parameter",
"or",
"null",
"if",
"such",
"a",
"parameter",
"is",
"not",
"defined",
"on",
"the",
"underlying",
"channel",
"element",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/dlm/FragmentChannelInfo.java#L37-L52 | train |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/oauth/OidcUserInfoController.java | OidcUserInfoController.userInfo | @RequestMapping(
value = USERINFO_ENDPOINT_URI,
produces = USERINFO_CONTENT_TYPE,
method = {RequestMethod.GET, RequestMethod.POST})
public String userInfo(
HttpServletRequest request,
@RequestParam(value = "claims", required = false) String claims,
... | java | @RequestMapping(
value = USERINFO_ENDPOINT_URI,
produces = USERINFO_CONTENT_TYPE,
method = {RequestMethod.GET, RequestMethod.POST})
public String userInfo(
HttpServletRequest request,
@RequestParam(value = "claims", required = false) String claims,
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"USERINFO_ENDPOINT_URI",
",",
"produces",
"=",
"USERINFO_CONTENT_TYPE",
",",
"method",
"=",
"{",
"RequestMethod",
".",
"GET",
",",
"RequestMethod",
".",
"POST",
"}",
")",
"public",
"String",
"userInfo",
"(",
"HttpServlet... | Obtain an OIDC Id token for the current user. | [
"Obtain",
"an",
"OIDC",
"Id",
"token",
"for",
"the",
"current",
"user",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/oauth/OidcUserInfoController.java#L92-L103 | train |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/SimpleStringTargetProviderImpl.java | SimpleStringTargetProviderImpl.setTargets | public void setTargets(Collection<IPermissionTarget> targets) {
// clear out any existing targets
targetMap.clear();
// add each target to the internal map and index it by the target key
for (IPermissionTarget target : targets) {
targetMap.put(target.getKey(), target);
... | java | public void setTargets(Collection<IPermissionTarget> targets) {
// clear out any existing targets
targetMap.clear();
// add each target to the internal map and index it by the target key
for (IPermissionTarget target : targets) {
targetMap.put(target.getKey(), target);
... | [
"public",
"void",
"setTargets",
"(",
"Collection",
"<",
"IPermissionTarget",
">",
"targets",
")",
"{",
"// clear out any existing targets",
"targetMap",
".",
"clear",
"(",
")",
";",
"// add each target to the internal map and index it by the target key",
"for",
"(",
"IPermi... | Set the permission targets for this provider.
@param targets collection of targets | [
"Set",
"the",
"permission",
"targets",
"for",
"this",
"provider",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/permission/target/SimpleStringTargetProviderImpl.java#L48-L57 | train |
Jasig/uPortal | uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java | PortalRootPersonAttributeDao.getPerson | @Override
public IPersonAttributes getPerson(String uid) {
final IPersonAttributes rslt = delegatePersonAttributeDao.getPerson(uid);
if (rslt == null) {
// Nothing we can do with that
return null;
}
return postProcessPerson(rslt, uid);
} | java | @Override
public IPersonAttributes getPerson(String uid) {
final IPersonAttributes rslt = delegatePersonAttributeDao.getPerson(uid);
if (rslt == null) {
// Nothing we can do with that
return null;
}
return postProcessPerson(rslt, uid);
} | [
"@",
"Override",
"public",
"IPersonAttributes",
"getPerson",
"(",
"String",
"uid",
")",
"{",
"final",
"IPersonAttributes",
"rslt",
"=",
"delegatePersonAttributeDao",
".",
"getPerson",
"(",
"uid",
")",
";",
"if",
"(",
"rslt",
"==",
"null",
")",
"{",
"// Nothing... | This method is for "filling" a specific individual.
@param uid The username (identity) of a known individual
@return A completely "filled" person, including overrides, or <code>null</code> if the person
is unknown | [
"This",
"method",
"is",
"for",
"filling",
"a",
"specific",
"individual",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java#L110-L120 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/LocalPortletContextManager.java | LocalPortletContextManager.register | @Override
public synchronized String register(ServletConfig config) throws PortletContainerException {
ServletContext servletContext = config.getServletContext();
String contextPath = servletContext.getContextPath();
if (!portletContexts.containsKey(contextPath)) {
PortletApplic... | java | @Override
public synchronized String register(ServletConfig config) throws PortletContainerException {
ServletContext servletContext = config.getServletContext();
String contextPath = servletContext.getContextPath();
if (!portletContexts.containsKey(contextPath)) {
PortletApplic... | [
"@",
"Override",
"public",
"synchronized",
"String",
"register",
"(",
"ServletConfig",
"config",
")",
"throws",
"PortletContainerException",
"{",
"ServletContext",
"servletContext",
"=",
"config",
".",
"getServletContext",
"(",
")",
";",
"String",
"contextPath",
"=",
... | Retrieves the PortletContext associated with the given ServletContext. If one does not exist,
it is created.
@param config the servlet config.
@return the InternalPortletContext associated with the ServletContext.
@throws PortletContainerException | [
"Retrieves",
"the",
"PortletContext",
"associated",
"with",
"the",
"given",
"ServletContext",
".",
"If",
"one",
"does",
"not",
"exist",
"it",
"is",
"created",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/LocalPortletContextManager.java#L126-L184 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/LocalPortletContextManager.java | LocalPortletContextManager.getPortletAppDD | public synchronized PortletApplicationDefinition getPortletAppDD(
ServletContext servletContext, String name, String contextPath)
throws PortletContainerException {
PortletApplicationDefinition portletApp =
this.portletAppDefinitionCache.get(servletContext);
if (p... | java | public synchronized PortletApplicationDefinition getPortletAppDD(
ServletContext servletContext, String name, String contextPath)
throws PortletContainerException {
PortletApplicationDefinition portletApp =
this.portletAppDefinitionCache.get(servletContext);
if (p... | [
"public",
"synchronized",
"PortletApplicationDefinition",
"getPortletAppDD",
"(",
"ServletContext",
"servletContext",
",",
"String",
"name",
",",
"String",
"contextPath",
")",
"throws",
"PortletContainerException",
"{",
"PortletApplicationDefinition",
"portletApp",
"=",
"this... | Retrieve the Portlet Application Deployment Descriptor for the given servlet context. Create
it if it does not allready exist.
@param servletContext the servlet context.
@return The portlet application deployment descriptor.
@throws PortletContainerException if the descriptor can not be found or parsed | [
"Retrieve",
"the",
"Portlet",
"Application",
"Deployment",
"Descriptor",
"for",
"the",
"given",
"servlet",
"context",
".",
"Create",
"it",
"if",
"it",
"does",
"not",
"allready",
"exist",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/LocalPortletContextManager.java#L306-L316 | train |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/LocalPortletContextManager.java | LocalPortletContextManager.createDefinition | private PortletApplicationDefinition createDefinition(
ServletContext servletContext, String name, String contextPath)
throws PortletContainerException {
PortletApplicationDefinition portletApp = null;
try {
InputStream paIn = servletContext.getResourceAsStream(PORTLE... | java | private PortletApplicationDefinition createDefinition(
ServletContext servletContext, String name, String contextPath)
throws PortletContainerException {
PortletApplicationDefinition portletApp = null;
try {
InputStream paIn = servletContext.getResourceAsStream(PORTLE... | [
"private",
"PortletApplicationDefinition",
"createDefinition",
"(",
"ServletContext",
"servletContext",
",",
"String",
"name",
",",
"String",
"contextPath",
")",
"throws",
"PortletContainerException",
"{",
"PortletApplicationDefinition",
"portletApp",
"=",
"null",
";",
"try... | Creates the portlet.xml deployment descriptor representation.
@param servletContext the servlet context for which the DD is requested.
@return the Portlet Application Deployment Descriptor.
@throws PortletContainerException | [
"Creates",
"the",
"portlet",
".",
"xml",
"deployment",
"descriptor",
"representation",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/container/services/LocalPortletContextManager.java#L327-L355 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java | JpaClusterLockDao.getClusterMutexInternal | protected ClusterMutex getClusterMutexInternal(final String mutexName) {
final TransactionOperations transactionOperations = this.getTransactionOperations();
return transactionOperations.execute(
new TransactionCallback<ClusterMutex>() {
@Override
... | java | protected ClusterMutex getClusterMutexInternal(final String mutexName) {
final TransactionOperations transactionOperations = this.getTransactionOperations();
return transactionOperations.execute(
new TransactionCallback<ClusterMutex>() {
@Override
... | [
"protected",
"ClusterMutex",
"getClusterMutexInternal",
"(",
"final",
"String",
"mutexName",
")",
"{",
"final",
"TransactionOperations",
"transactionOperations",
"=",
"this",
".",
"getTransactionOperations",
"(",
")",
";",
"return",
"transactionOperations",
".",
"execute"... | Retrieves a ClusterMutex in a new TX | [
"Retrieves",
"a",
"ClusterMutex",
"in",
"a",
"new",
"TX"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java#L217-L241 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java | JpaClusterLockDao.createClusterMutex | protected void createClusterMutex(final String mutexName) {
this.executeIgnoreRollback(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
final EntityManager e... | java | protected void createClusterMutex(final String mutexName) {
this.executeIgnoreRollback(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
final EntityManager e... | [
"protected",
"void",
"createClusterMutex",
"(",
"final",
"String",
"mutexName",
")",
"{",
"this",
".",
"executeIgnoreRollback",
"(",
"new",
"TransactionCallbackWithoutResult",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"doInTransactionWithoutResult",
"(",
"T... | Creates a new ClusterMutex with the specified name. Returns the created mutex or null if the
mutex already exists. | [
"Creates",
"a",
"new",
"ClusterMutex",
"with",
"the",
"specified",
"name",
".",
"Returns",
"the",
"created",
"mutex",
"or",
"null",
"if",
"the",
"mutex",
"already",
"exists",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java#L247-L273 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java | JpaClusterLockDao.validateLockedMutex | protected void validateLockedMutex(ClusterMutex clusterMutex) {
if (!clusterMutex.isLocked()) {
throw new IllegalMonitorStateException(
"Mutex is not currently locked, it cannot be updated: " + clusterMutex);
}
final String serverName = this.portalInfoProvider.get... | java | protected void validateLockedMutex(ClusterMutex clusterMutex) {
if (!clusterMutex.isLocked()) {
throw new IllegalMonitorStateException(
"Mutex is not currently locked, it cannot be updated: " + clusterMutex);
}
final String serverName = this.portalInfoProvider.get... | [
"protected",
"void",
"validateLockedMutex",
"(",
"ClusterMutex",
"clusterMutex",
")",
"{",
"if",
"(",
"!",
"clusterMutex",
".",
"isLocked",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalMonitorStateException",
"(",
"\"Mutex is not currently locked, it cannot be updated: \""... | Validates that the specified mutex is locked by this server, throws
IllegalMonitorStateException if either test fails | [
"Validates",
"that",
"the",
"specified",
"mutex",
"is",
"locked",
"by",
"this",
"server",
"throws",
"IllegalMonitorStateException",
"if",
"either",
"test",
"fails"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java#L279-L292 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java | JpaClusterLockDao.unlockAbandonedLock | protected void unlockAbandonedLock(final String mutexName) {
this.executeIgnoreRollback(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
final EntityManager ... | java | protected void unlockAbandonedLock(final String mutexName) {
this.executeIgnoreRollback(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
final EntityManager ... | [
"protected",
"void",
"unlockAbandonedLock",
"(",
"final",
"String",
"mutexName",
")",
"{",
"this",
".",
"executeIgnoreRollback",
"(",
"new",
"TransactionCallbackWithoutResult",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"doInTransactionWithoutResult",
"(",
"... | Unlocks an abandoned mutex | [
"Unlocks",
"an",
"abandoned",
"mutex"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java#L295-L320 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java | JpaClusterLockDao.executeIgnoreRollback | protected <T> T executeIgnoreRollback(TransactionCallback<T> action, T rollbackValue) {
try {
// Try to create the mutex in a new TX
return this.newTransactionTemplate.execute(action);
} catch (TransactionSystemException e) {
if (e.getCause() instanceof RollbackExcept... | java | protected <T> T executeIgnoreRollback(TransactionCallback<T> action, T rollbackValue) {
try {
// Try to create the mutex in a new TX
return this.newTransactionTemplate.execute(action);
} catch (TransactionSystemException e) {
if (e.getCause() instanceof RollbackExcept... | [
"protected",
"<",
"T",
">",
"T",
"executeIgnoreRollback",
"(",
"TransactionCallback",
"<",
"T",
">",
"action",
",",
"T",
"rollbackValue",
")",
"{",
"try",
"{",
"// Try to create the mutex in a new TX",
"return",
"this",
".",
"newTransactionTemplate",
".",
"execute",... | Utility for using TransactionTemplate when we know that a rollback might happen and just want
to ignore it | [
"Utility",
"for",
"using",
"TransactionTemplate",
"when",
"we",
"know",
"that",
"a",
"rollback",
"might",
"happen",
"and",
"just",
"want",
"to",
"ignore",
"it"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/JpaClusterLockDao.java#L335-L348 | train |
Jasig/uPortal | uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/favorites/FavoritesUtils.java | FavoritesUtils.hasAnyFavorites | public boolean hasAnyFavorites(IUserLayout layout) {
Validate.notNull(layout, "Cannot determine whether a null layout contains favorites.");
// (premature) performance optimization: short circuit returns true if nonzero favorite
// portlets
return (!getFavoritePortletLayoutNodes(layout)... | java | public boolean hasAnyFavorites(IUserLayout layout) {
Validate.notNull(layout, "Cannot determine whether a null layout contains favorites.");
// (premature) performance optimization: short circuit returns true if nonzero favorite
// portlets
return (!getFavoritePortletLayoutNodes(layout)... | [
"public",
"boolean",
"hasAnyFavorites",
"(",
"IUserLayout",
"layout",
")",
"{",
"Validate",
".",
"notNull",
"(",
"layout",
",",
"\"Cannot determine whether a null layout contains favorites.\"",
")",
";",
"// (premature) performance optimization: short circuit returns true if nonzer... | True if the layout contains any favorited collections or favorited individual portlets, false
otherwise.
@param layout non-null user layout that might contain favorite portlets and/or collections
@return true if the layout contains at least one favorited portlet or collection, false
otherwise
@throws IllegalArgumentEx... | [
"True",
"if",
"the",
"layout",
"contains",
"any",
"favorited",
"collections",
"or",
"favorited",
"individual",
"portlets",
"false",
"otherwise",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/favorites/FavoritesUtils.java#L280-L287 | train |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAChangeAttribute.java | LPAChangeAttribute.perform | @Override
public void perform() throws PortalException {
// push the change into the PLF
if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
// we are dealing with an incorporated node, so get a plf ghost
// node, set its attribute, then add a directive indicating the... | java | @Override
public void perform() throws PortalException {
// push the change into the PLF
if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
// we are dealing with an incorporated node, so get a plf ghost
// node, set its attribute, then add a directive indicating the... | [
"@",
"Override",
"public",
"void",
"perform",
"(",
")",
"throws",
"PortalException",
"{",
"// push the change into the PLF",
"if",
"(",
"nodeId",
".",
"startsWith",
"(",
"Constants",
".",
"FRAGMENT_ID_USER_PREFIX",
")",
")",
"{",
"// we are dealing with an incorporated ... | Apply the attribute change. | [
"Apply",
"the",
"attribute",
"change",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/LPAChangeAttribute.java#L39-L76 | train |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java | PersonDirectoryUserInfoService.getUserInfo | protected Map<String, String> getUserInfo(
String remoteUser, HttpServletRequest httpServletRequest, IPortletWindow portletWindow)
throws PortletContainerException {
// Get the list of user attributes the portal knows about the user
final IPersonAttributes personAttributes = this... | java | protected Map<String, String> getUserInfo(
String remoteUser, HttpServletRequest httpServletRequest, IPortletWindow portletWindow)
throws PortletContainerException {
// Get the list of user attributes the portal knows about the user
final IPersonAttributes personAttributes = this... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"getUserInfo",
"(",
"String",
"remoteUser",
",",
"HttpServletRequest",
"httpServletRequest",
",",
"IPortletWindow",
"portletWindow",
")",
"throws",
"PortletContainerException",
"{",
"// Get the list of user attributes t... | Commons logic to get a subset of the user's attributes for the specified portlet window.
@param remoteUser The user to get attributes for.
@param httpServletRequest The current, underlying httpServletRequest
@param portletWindow The window to filter attributes for
@return A Map of user attributes for the user and wind... | [
"Commons",
"logic",
"to",
"get",
"a",
"subset",
"of",
"the",
"user",
"s",
"attributes",
"for",
"the",
"specified",
"portlet",
"window",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java#L122-L136 | train |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java | PersonDirectoryUserInfoService.generateUserInfo | protected Map<String, String> generateUserInfo(
final IPersonAttributes personAttributes,
final List<? extends UserAttribute> expectedUserAttributes,
HttpServletRequest httpServletRequest) {
final Map<String, String> portletUserAttributes =
new HashMap<String,... | java | protected Map<String, String> generateUserInfo(
final IPersonAttributes personAttributes,
final List<? extends UserAttribute> expectedUserAttributes,
HttpServletRequest httpServletRequest) {
final Map<String, String> portletUserAttributes =
new HashMap<String,... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"generateUserInfo",
"(",
"final",
"IPersonAttributes",
"personAttributes",
",",
"final",
"List",
"<",
"?",
"extends",
"UserAttribute",
">",
"expectedUserAttributes",
",",
"HttpServletRequest",
"httpServletRequest",
... | Using the Map of portal user attributes and a List of expected attributes generate the
USER_INFO map for the portlet
@param portalUserAttributes All the attributes the portal knows about the user
@param expectedUserAttributes The attributes the portlet expects to get
@return The Map to use for the USER_INFO attribute | [
"Using",
"the",
"Map",
"of",
"portal",
"user",
"attributes",
"and",
"a",
"List",
"of",
"expected",
"attributes",
"generate",
"the",
"USER_INFO",
"map",
"for",
"the",
"portlet"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/PersonDirectoryUserInfoService.java#L146-L168 | train |
Jasig/uPortal | uPortal-security/uPortal-security-mvc/src/main/java/org/apereo/portal/security/mvc/LoginController.java | LoginController.service | @RequestMapping
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// create... | java | @RequestMapping
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// create... | [
"@",
"RequestMapping",
"public",
"void",
"service",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"response",
".",
"setHeader",
"(",
"\"Pragma\"",
",",
"\"no-cache\"",
")",
"... | Process the incoming HttpServletRequest. Note that this processing occurs after
PortalPreAuthenticatedProcessingFilter has run and performed pre-processing.
@param request
@param response
@exception ServletException
@exception IOException | [
"Process",
"the",
"incoming",
"HttpServletRequest",
".",
"Note",
"that",
"this",
"processing",
"occurs",
"after",
"PortalPreAuthenticatedProcessingFilter",
"has",
"run",
"and",
"performed",
"pre",
"-",
"processing",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-mvc/src/main/java/org/apereo/portal/security/mvc/LoginController.java#L75-L149 | train |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/statistics/BasePortletLayoutStatisticsController.java | BasePortletLayoutStatisticsController.selectFormDefaultPortlet | protected void selectFormDefaultPortlet(final F report) {
final Set<AggregatedPortletMapping> portlets = this.getPortlets();
if (!portlets.isEmpty()) {
report.getPortlets().add(portlets.iterator().next().getFname());
}
} | java | protected void selectFormDefaultPortlet(final F report) {
final Set<AggregatedPortletMapping> portlets = this.getPortlets();
if (!portlets.isEmpty()) {
report.getPortlets().add(portlets.iterator().next().getFname());
}
} | [
"protected",
"void",
"selectFormDefaultPortlet",
"(",
"final",
"F",
"report",
")",
"{",
"final",
"Set",
"<",
"AggregatedPortletMapping",
">",
"portlets",
"=",
"this",
".",
"getPortlets",
"(",
")",
";",
"if",
"(",
"!",
"portlets",
".",
"isEmpty",
"(",
")",
... | Select the first portlet name by default for the form | [
"Select",
"the",
"first",
"portlet",
"name",
"by",
"default",
"for",
"the",
"form"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/statistics/BasePortletLayoutStatisticsController.java#L83-L88 | train |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jdbc/DatabaseMetaDataImpl.java | DatabaseMetaDataImpl.getMetaData | private void getMetaData(final Connection conn) {
try {
final DatabaseMetaData dmd = conn.getMetaData();
this.databaseProductName = dmd.getDatabaseProductName();
this.databaseProductVersion = dmd.getDatabaseProductVersion();
this.driverName = dmd.getDriverName();... | java | private void getMetaData(final Connection conn) {
try {
final DatabaseMetaData dmd = conn.getMetaData();
this.databaseProductName = dmd.getDatabaseProductName();
this.databaseProductVersion = dmd.getDatabaseProductVersion();
this.driverName = dmd.getDriverName();... | [
"private",
"void",
"getMetaData",
"(",
"final",
"Connection",
"conn",
")",
"{",
"try",
"{",
"final",
"DatabaseMetaData",
"dmd",
"=",
"conn",
".",
"getMetaData",
"(",
")",
";",
"this",
".",
"databaseProductName",
"=",
"dmd",
".",
"getDatabaseProductName",
"(",
... | Gets meta data about the connection. | [
"Gets",
"meta",
"data",
"about",
"the",
"connection",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/jdbc/DatabaseMetaDataImpl.java#L314-L328 | train |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/rendering/PortalController.java | PortalController.actionRequest | @RequestMapping(
headers = {"org.apereo.portal.url.UrlType=ACTION"},
method = RequestMethod.POST)
public void actionRequest(HttpServletRequest request, HttpServletResponse response)
throws IOException {
final IPortalRequestInfo portalRequestInfo =
this.ur... | java | @RequestMapping(
headers = {"org.apereo.portal.url.UrlType=ACTION"},
method = RequestMethod.POST)
public void actionRequest(HttpServletRequest request, HttpServletResponse response)
throws IOException {
final IPortalRequestInfo portalRequestInfo =
this.ur... | [
"@",
"RequestMapping",
"(",
"headers",
"=",
"{",
"\"org.apereo.portal.url.UrlType=ACTION\"",
"}",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"void",
"actionRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")... | HTTP POST required for security. | [
"HTTP",
"POST",
"required",
"for",
"security",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/rendering/PortalController.java#L112-L162 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.