id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
51,800 | AzureAD/azure-activedirectory-library-for-java | src/main/java/com/microsoft/aad/adal4j/JwtHelper.java | JwtHelper.buildJwt | static ClientAssertion buildJwt(final AsymmetricKeyCredential credential,
final String jwtAudience) throws AuthenticationException {
if (credential == null) {
throw new IllegalArgumentException("credential is null");
}
final long time = System.currentTimeMillis();
... | java | static ClientAssertion buildJwt(final AsymmetricKeyCredential credential,
final String jwtAudience) throws AuthenticationException {
if (credential == null) {
throw new IllegalArgumentException("credential is null");
}
final long time = System.currentTimeMillis();
... | [
"static",
"ClientAssertion",
"buildJwt",
"(",
"final",
"AsymmetricKeyCredential",
"credential",
",",
"final",
"String",
"jwtAudience",
")",
"throws",
"AuthenticationException",
"{",
"if",
"(",
"credential",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcep... | Builds JWT object.
@param credential
@return
@throws AuthenticationException | [
"Builds",
"JWT",
"object",
"."
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/main/java/com/microsoft/aad/adal4j/JwtHelper.java#L52-L89 |
51,801 | AzureAD/azure-activedirectory-library-for-java | src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java | JSONHelper.fetchDirectoryObjectJSONArray | public static JSONArray fetchDirectoryObjectJSONArray(JSONObject jsonObject) throws Exception {
JSONArray jsonArray = new JSONArray();
jsonArray = jsonObject.optJSONObject("responseMsg").optJSONArray("value");
return jsonArray;
} | java | public static JSONArray fetchDirectoryObjectJSONArray(JSONObject jsonObject) throws Exception {
JSONArray jsonArray = new JSONArray();
jsonArray = jsonObject.optJSONObject("responseMsg").optJSONArray("value");
return jsonArray;
} | [
"public",
"static",
"JSONArray",
"fetchDirectoryObjectJSONArray",
"(",
"JSONObject",
"jsonObject",
")",
"throws",
"Exception",
"{",
"JSONArray",
"jsonArray",
"=",
"new",
"JSONArray",
"(",
")",
";",
"jsonArray",
"=",
"jsonObject",
".",
"optJSONObject",
"(",
"\"respon... | This method parses an JSON Array out of a collection of JSON Objects
within a string.
@param jSonData
The JSON String that holds the collection.
@return An JSON Array that would contains all the collection object.
@throws Exception | [
"This",
"method",
"parses",
"an",
"JSON",
"Array",
"out",
"of",
"a",
"collection",
"of",
"JSON",
"Objects",
"within",
"a",
"string",
"."
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java#L63-L67 |
51,802 | AzureAD/azure-activedirectory-library-for-java | src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java | JSONHelper.fetchDirectoryObjectJSONObject | public static JSONObject fetchDirectoryObjectJSONObject(JSONObject jsonObject) throws Exception {
JSONObject jObj = new JSONObject();
jObj = jsonObject.optJSONObject("responseMsg");
return jObj;
} | java | public static JSONObject fetchDirectoryObjectJSONObject(JSONObject jsonObject) throws Exception {
JSONObject jObj = new JSONObject();
jObj = jsonObject.optJSONObject("responseMsg");
return jObj;
} | [
"public",
"static",
"JSONObject",
"fetchDirectoryObjectJSONObject",
"(",
"JSONObject",
"jsonObject",
")",
"throws",
"Exception",
"{",
"JSONObject",
"jObj",
"=",
"new",
"JSONObject",
"(",
")",
";",
"jObj",
"=",
"jsonObject",
".",
"optJSONObject",
"(",
"\"responseMsg\... | This method parses an JSON Object out of a collection of JSON Objects
within a string
@param jsonObject
@return An JSON Object that would contains the DirectoryObject.
@throws Exception | [
"This",
"method",
"parses",
"an",
"JSON",
"Object",
"out",
"of",
"a",
"collection",
"of",
"JSON",
"Objects",
"within",
"a",
"string"
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java#L77-L81 |
51,803 | AzureAD/azure-activedirectory-library-for-java | src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java | JSONHelper.fetchNextSkiptoken | public static String fetchNextSkiptoken(JSONObject jsonObject) throws Exception {
String skipToken = "";
// Parse the skip token out of the string.
skipToken = jsonObject.optJSONObject("responseMsg").optString("odata.nextLink");
if (!skipToken.equalsIgnoreCase("")) {
/... | java | public static String fetchNextSkiptoken(JSONObject jsonObject) throws Exception {
String skipToken = "";
// Parse the skip token out of the string.
skipToken = jsonObject.optJSONObject("responseMsg").optString("odata.nextLink");
if (!skipToken.equalsIgnoreCase("")) {
/... | [
"public",
"static",
"String",
"fetchNextSkiptoken",
"(",
"JSONObject",
"jsonObject",
")",
"throws",
"Exception",
"{",
"String",
"skipToken",
"=",
"\"\"",
";",
"// Parse the skip token out of the string.\r",
"skipToken",
"=",
"jsonObject",
".",
"optJSONObject",
"(",
"\"r... | This method parses the skip token from a json formatted string.
@param jsonData
The JSON Formatted String.
@return The skipToken.
@throws Exception | [
"This",
"method",
"parses",
"the",
"skip",
"token",
"from",
"a",
"json",
"formatted",
"string",
"."
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java#L91-L102 |
51,804 | AzureAD/azure-activedirectory-library-for-java | src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java | JSONHelper.createJSONString | public static String createJSONString(HttpServletRequest request, String controller) throws Exception {
JSONObject obj = new JSONObject();
try {
Field[] allFields = Class.forName(
"com.microsoft.windowsazure.activedirectory.sdk.graph.models." + controller).getDeclared... | java | public static String createJSONString(HttpServletRequest request, String controller) throws Exception {
JSONObject obj = new JSONObject();
try {
Field[] allFields = Class.forName(
"com.microsoft.windowsazure.activedirectory.sdk.graph.models." + controller).getDeclared... | [
"public",
"static",
"String",
"createJSONString",
"(",
"HttpServletRequest",
"request",
",",
"String",
"controller",
")",
"throws",
"Exception",
"{",
"JSONObject",
"obj",
"=",
"new",
"JSONObject",
"(",
")",
";",
"try",
"{",
"Field",
"[",
"]",
"allFields",
"=",... | This method would create a string consisting of a JSON document with all
the necessary elements set from the HttpServletRequest request.
@param request
The HttpServletRequest
@return the string containing the JSON document.
@throws Exception
If there is any error processing the request. | [
"This",
"method",
"would",
"create",
"a",
"string",
"consisting",
"of",
"a",
"JSON",
"document",
"with",
"all",
"the",
"necessary",
"elements",
"set",
"from",
"the",
"HttpServletRequest",
"request",
"."
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java#L136-L175 |
51,805 | AzureAD/azure-activedirectory-library-for-java | src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java | JSONHelper.convertJSONObjectToDirectoryObject | public static <T> void convertJSONObjectToDirectoryObject(JSONObject jsonObject, T destObject) throws Exception {
// Get the list of all the field names.
Field[] fieldList = destObject.getClass().getDeclaredFields();
// For all the declared field.
for (int i = 0; i < fieldList.le... | java | public static <T> void convertJSONObjectToDirectoryObject(JSONObject jsonObject, T destObject) throws Exception {
// Get the list of all the field names.
Field[] fieldList = destObject.getClass().getDeclaredFields();
// For all the declared field.
for (int i = 0; i < fieldList.le... | [
"public",
"static",
"<",
"T",
">",
"void",
"convertJSONObjectToDirectoryObject",
"(",
"JSONObject",
"jsonObject",
",",
"T",
"destObject",
")",
"throws",
"Exception",
"{",
"// Get the list of all the field names.\r",
"Field",
"[",
"]",
"fieldList",
"=",
"destObject",
"... | This is a generic method that copies the simple attribute values from an
argument jsonObject to an argument generic object.
@param jsonObject
The jsonObject from where the attributes are to be copied.
@param destObject
The object where the attributes should be copied into.
@throws Exception
Throws a Exception when the... | [
"This",
"is",
"a",
"generic",
"method",
"that",
"copies",
"the",
"simple",
"attribute",
"values",
"from",
"an",
"argument",
"jsonObject",
"to",
"an",
"argument",
"generic",
"object",
"."
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java#L207-L226 |
51,806 | AzureAD/azure-activedirectory-library-for-java | src/main/java/com/microsoft/aad/adal4j/AsymmetricKeyCredential.java | AsymmetricKeyCredential.getPublicCertificateHash | public String getPublicCertificateHash()
throws CertificateEncodingException, NoSuchAlgorithmException {
return Base64.encodeBase64String(AsymmetricKeyCredential
.getHash(this.publicCertificate.getEncoded()));
} | java | public String getPublicCertificateHash()
throws CertificateEncodingException, NoSuchAlgorithmException {
return Base64.encodeBase64String(AsymmetricKeyCredential
.getHash(this.publicCertificate.getEncoded()));
} | [
"public",
"String",
"getPublicCertificateHash",
"(",
")",
"throws",
"CertificateEncodingException",
",",
"NoSuchAlgorithmException",
"{",
"return",
"Base64",
".",
"encodeBase64String",
"(",
"AsymmetricKeyCredential",
".",
"getHash",
"(",
"this",
".",
"publicCertificate",
... | Base64 encoded hash of the the public certificate.
@return base64 encoded string
@throws CertificateEncodingException if an encoding error occurs
@throws NoSuchAlgorithmException if requested algorithm is not available in the environment | [
"Base64",
"encoded",
"hash",
"of",
"the",
"the",
"public",
"certificate",
"."
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/main/java/com/microsoft/aad/adal4j/AsymmetricKeyCredential.java#L122-L126 |
51,807 | AzureAD/azure-activedirectory-library-for-java | src/main/java/com/microsoft/aad/adal4j/DeviceCodeTokenErrorResponse.java | DeviceCodeTokenErrorResponse.isDeviceCodeError | public boolean isDeviceCodeError() {
ErrorObject errorObject = getErrorObject();
if (errorObject == null) {
return false;
}
String code = errorObject.getCode();
if (code == null) {
return false;
}
switch (code) {
case "authoriza... | java | public boolean isDeviceCodeError() {
ErrorObject errorObject = getErrorObject();
if (errorObject == null) {
return false;
}
String code = errorObject.getCode();
if (code == null) {
return false;
}
switch (code) {
case "authoriza... | [
"public",
"boolean",
"isDeviceCodeError",
"(",
")",
"{",
"ErrorObject",
"errorObject",
"=",
"getErrorObject",
"(",
")",
";",
"if",
"(",
"errorObject",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
"code",
"=",
"errorObject",
".",
"getCode",
... | Checks if is a device code error.
@return true if is one of the well known device code error code, otherwise false. | [
"Checks",
"if",
"is",
"a",
"device",
"code",
"error",
"."
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/main/java/com/microsoft/aad/adal4j/DeviceCodeTokenErrorResponse.java#L51-L69 |
51,808 | AzureAD/azure-activedirectory-library-for-java | src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/BasicFilter.java | BasicFilter.validateState | private StateData validateState(HttpSession session, String state) throws Exception {
if (StringUtils.isNotEmpty(state)) {
StateData stateDataInSession = removeStateFromSession(session, state);
if (stateDataInSession != null) {
return stateDataInSession;
... | java | private StateData validateState(HttpSession session, String state) throws Exception {
if (StringUtils.isNotEmpty(state)) {
StateData stateDataInSession = removeStateFromSession(session, state);
if (stateDataInSession != null) {
return stateDataInSession;
... | [
"private",
"StateData",
"validateState",
"(",
"HttpSession",
"session",
",",
"String",
"state",
")",
"throws",
"Exception",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"state",
")",
")",
"{",
"StateData",
"stateDataInSession",
"=",
"removeStateFromSessi... | make sure that state is stored in the session,
delete it from session - should be used only once
@param session
@param state
@throws Exception | [
"make",
"sure",
"that",
"state",
"is",
"stored",
"in",
"the",
"session",
"delete",
"it",
"from",
"session",
"-",
"should",
"be",
"used",
"only",
"once"
] | 7f0004fee6faee5818e75623113993a267ceb1c4 | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/BasicFilter.java#L182-L190 |
51,809 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdn.java | LdapRdn.getLdapEncoded | public String getLdapEncoded() {
if (components.size() == 0) {
throw new IndexOutOfBoundsException("No components in Rdn.");
}
StringBuffer sb = new StringBuffer(DEFAULT_BUFFER_SIZE);
for (Iterator iter = components.values().iterator(); iter.hasNext();) {
LdapRdnComponent component = (LdapRdnCompone... | java | public String getLdapEncoded() {
if (components.size() == 0) {
throw new IndexOutOfBoundsException("No components in Rdn.");
}
StringBuffer sb = new StringBuffer(DEFAULT_BUFFER_SIZE);
for (Iterator iter = components.values().iterator(); iter.hasNext();) {
LdapRdnComponent component = (LdapRdnCompone... | [
"public",
"String",
"getLdapEncoded",
"(",
")",
"{",
"if",
"(",
"components",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"No components in Rdn.\"",
")",
";",
"}",
"StringBuffer",
"sb",
"=",
"new",
"StringB... | Get a properly rfc2253-encoded String representation of this LdapRdn.
@return an escaped String corresponding to this LdapRdn.
@throws IndexOutOfBoundsException if there are no components in this Rdn. | [
"Get",
"a",
"properly",
"rfc2253",
"-",
"encoded",
"String",
"representation",
"of",
"this",
"LdapRdn",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdn.java#L136-L150 |
51,810 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdn.java | LdapRdn.encodeUrl | public String encodeUrl() {
StringBuffer sb = new StringBuffer(DEFAULT_BUFFER_SIZE);
for (Iterator iter = components.values().iterator(); iter.hasNext();) {
LdapRdnComponent component = (LdapRdnComponent) iter.next();
sb.append(component.encodeUrl());
if (iter.hasNext()) {
sb.append("+");
}
... | java | public String encodeUrl() {
StringBuffer sb = new StringBuffer(DEFAULT_BUFFER_SIZE);
for (Iterator iter = components.values().iterator(); iter.hasNext();) {
LdapRdnComponent component = (LdapRdnComponent) iter.next();
sb.append(component.encodeUrl());
if (iter.hasNext()) {
sb.append("+");
}
... | [
"public",
"String",
"encodeUrl",
"(",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
"DEFAULT_BUFFER_SIZE",
")",
";",
"for",
"(",
"Iterator",
"iter",
"=",
"components",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"iter",
".... | Get a String representation of this LdapRdn for use in urls.
@return a String representation of this LdapRdn for use in urls. | [
"Get",
"a",
"String",
"representation",
"of",
"this",
"LdapRdn",
"for",
"use",
"in",
"urls",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdn.java#L157-L168 |
51,811 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdn.java | LdapRdn.compareTo | public int compareTo(Object obj) {
LdapRdn that = (LdapRdn) obj;
if(this.components.size() != that.components.size()) {
return this.components.size() - that.components.size();
}
Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet();
for... | java | public int compareTo(Object obj) {
LdapRdn that = (LdapRdn) obj;
if(this.components.size() != that.components.size()) {
return this.components.size() - that.components.size();
}
Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet();
for... | [
"public",
"int",
"compareTo",
"(",
"Object",
"obj",
")",
"{",
"LdapRdn",
"that",
"=",
"(",
"LdapRdn",
")",
"obj",
";",
"if",
"(",
"this",
".",
"components",
".",
"size",
"(",
")",
"!=",
"that",
".",
"components",
".",
"size",
"(",
")",
")",
"{",
... | Compare this LdapRdn to another object.
@param obj the object to compare to.
@throws ClassCastException if the supplied object is not an LdapRdn
instance. | [
"Compare",
"this",
"LdapRdn",
"to",
"another",
"object",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdn.java#L177-L198 |
51,812 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdn.java | LdapRdn.immutableLdapRdn | public LdapRdn immutableLdapRdn() {
Map<String, LdapRdnComponent> mapWithImmutableRdns = new LinkedHashMap<String, LdapRdnComponent>(components.size());
for (Iterator iterator = components.values().iterator(); iterator.hasNext();) {
LdapRdnComponent rdnComponent = (LdapRdnComponent) iterator.next();
... | java | public LdapRdn immutableLdapRdn() {
Map<String, LdapRdnComponent> mapWithImmutableRdns = new LinkedHashMap<String, LdapRdnComponent>(components.size());
for (Iterator iterator = components.values().iterator(); iterator.hasNext();) {
LdapRdnComponent rdnComponent = (LdapRdnComponent) iterator.next();
... | [
"public",
"LdapRdn",
"immutableLdapRdn",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"LdapRdnComponent",
">",
"mapWithImmutableRdns",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"LdapRdnComponent",
">",
"(",
"components",
".",
"size",
"(",
")",
")",
";",
... | Create an immutable copy of this instance. It will not be possible to add
or remove components or modify the keys and values of these components.
@return an immutable copy of this instance.
@since 1.3 | [
"Create",
"an",
"immutable",
"copy",
"of",
"this",
"instance",
".",
"It",
"will",
"not",
"be",
"possible",
"to",
"add",
"or",
"remove",
"components",
"or",
"modify",
"the",
"keys",
"and",
"values",
"of",
"these",
"components",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdn.java#L297-L307 |
51,813 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareDirContextInvocationHandler.java | TransactionAwareDirContextInvocationHandler.doCloseConnection | void doCloseConnection(DirContext context, ContextSource contextSource)
throws javax.naming.NamingException {
DirContextHolder transactionContextHolder = (DirContextHolder) TransactionSynchronizationManager
.getResource(contextSource);
if (transactionContextHolder == null
... | java | void doCloseConnection(DirContext context, ContextSource contextSource)
throws javax.naming.NamingException {
DirContextHolder transactionContextHolder = (DirContextHolder) TransactionSynchronizationManager
.getResource(contextSource);
if (transactionContextHolder == null
... | [
"void",
"doCloseConnection",
"(",
"DirContext",
"context",
",",
"ContextSource",
"contextSource",
")",
"throws",
"javax",
".",
"naming",
".",
"NamingException",
"{",
"DirContextHolder",
"transactionContextHolder",
"=",
"(",
"DirContextHolder",
")",
"TransactionSynchroniza... | Close the supplied context, but only if it is not associated with the
current transaction.
@param context
the DirContext to close.
@param contextSource
the ContextSource bound to the transaction.
@throws NamingException | [
"Close",
"the",
"supplied",
"context",
"but",
"only",
"if",
"it",
"is",
"not",
"associated",
"with",
"the",
"current",
"transaction",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareDirContextInvocationHandler.java#L107-L120 |
51,814 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java | LdapRdnComponent.encodeLdap | protected String encodeLdap() {
StringBuffer buff = new StringBuffer(key.length() + value.length() * 2);
buff.append(key);
buff.append('=');
buff.append(LdapEncoder.nameEncode(value));
return buff.toString();
} | java | protected String encodeLdap() {
StringBuffer buff = new StringBuffer(key.length() + value.length() * 2);
buff.append(key);
buff.append('=');
buff.append(LdapEncoder.nameEncode(value));
return buff.toString();
} | [
"protected",
"String",
"encodeLdap",
"(",
")",
"{",
"StringBuffer",
"buff",
"=",
"new",
"StringBuffer",
"(",
"key",
".",
"length",
"(",
")",
"+",
"value",
".",
"length",
"(",
")",
"*",
"2",
")",
";",
"buff",
".",
"append",
"(",
"key",
")",
";",
"bu... | Encode key and value to ldap.
@return Properly ldap escaped rdn. | [
"Encode",
"key",
"and",
"value",
"to",
"ldap",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java#L145-L153 |
51,815 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java | LdapRdnComponent.encodeUrl | public String encodeUrl() {
// Use the URI class to properly URL encode the value.
try {
URI valueUri = new URI(null, null, value, null);
return key + "=" + valueUri.toString();
}
catch (URISyntaxException e) {
// This should really never happen...
return key + "=" + "value";
}
} | java | public String encodeUrl() {
// Use the URI class to properly URL encode the value.
try {
URI valueUri = new URI(null, null, value, null);
return key + "=" + valueUri.toString();
}
catch (URISyntaxException e) {
// This should really never happen...
return key + "=" + "value";
}
} | [
"public",
"String",
"encodeUrl",
"(",
")",
"{",
"// Use the URI class to properly URL encode the value.",
"try",
"{",
"URI",
"valueUri",
"=",
"new",
"URI",
"(",
"null",
",",
"null",
",",
"value",
",",
"null",
")",
";",
"return",
"key",
"+",
"\"=\"",
"+",
"va... | Get a String representation of this instance for use in URLs.
@return a properly URL encoded representation of this instancs. | [
"Get",
"a",
"String",
"representation",
"of",
"this",
"instance",
"for",
"use",
"in",
"URLs",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java#L176-L186 |
51,816 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java | LdapRdnComponent.compareTo | public int compareTo(Object obj) {
LdapRdnComponent that = (LdapRdnComponent) obj;
// It's safe to compare directly against key and value,
// because they are validated not to be null on instance creation.
int keyCompare = this.key.toLowerCase().compareTo(that.key.toLowerCase());
if(k... | java | public int compareTo(Object obj) {
LdapRdnComponent that = (LdapRdnComponent) obj;
// It's safe to compare directly against key and value,
// because they are validated not to be null on instance creation.
int keyCompare = this.key.toLowerCase().compareTo(that.key.toLowerCase());
if(k... | [
"public",
"int",
"compareTo",
"(",
"Object",
"obj",
")",
"{",
"LdapRdnComponent",
"that",
"=",
"(",
"LdapRdnComponent",
")",
"obj",
";",
"// It's safe to compare directly against key and value,",
"// because they are validated not to be null on instance creation.",
"int",
"keyC... | Compare this instance to the supplied object.
@param obj the object to compare to.
@throws ClassCastException if the object is not possible to cast to an
LdapRdnComponent. | [
"Compare",
"this",
"instance",
"to",
"the",
"supplied",
"object",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapRdnComponent.java#L225-L236 |
51,817 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.collectAttributeValues | public static void collectAttributeValues(Attributes attributes, String name, Collection<Object> collection) {
collectAttributeValues(attributes, name, collection, Object.class);
} | java | public static void collectAttributeValues(Attributes attributes, String name, Collection<Object> collection) {
collectAttributeValues(attributes, name, collection, Object.class);
} | [
"public",
"static",
"void",
"collectAttributeValues",
"(",
"Attributes",
"attributes",
",",
"String",
"name",
",",
"Collection",
"<",
"Object",
">",
"collection",
")",
"{",
"collectAttributeValues",
"(",
"attributes",
",",
"name",
",",
"collection",
",",
"Object",... | Collect all the values of a the specified attribute from the supplied
Attributes.
@param attributes The Attributes; not <code>null</code>.
@param name The name of the Attribute to get values for.
@param collection the collection to collect the values in.
@throws NoSuchAttributeException if no attribute with the specif... | [
"Collect",
"all",
"the",
"values",
"of",
"a",
"the",
"specified",
"attribute",
"from",
"the",
"supplied",
"Attributes",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L258-L260 |
51,818 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.collectAttributeValues | public static <T> void collectAttributeValues(
Attributes attributes, String name, Collection<T> collection, Class<T> clazz) {
Assert.notNull(attributes, "Attributes must not be null");
Assert.hasText(name, "Name must not be empty");
Assert.notNull(collection, "Collection must not b... | java | public static <T> void collectAttributeValues(
Attributes attributes, String name, Collection<T> collection, Class<T> clazz) {
Assert.notNull(attributes, "Attributes must not be null");
Assert.hasText(name, "Name must not be empty");
Assert.notNull(collection, "Collection must not b... | [
"public",
"static",
"<",
"T",
">",
"void",
"collectAttributeValues",
"(",
"Attributes",
"attributes",
",",
"String",
"name",
",",
"Collection",
"<",
"T",
">",
"collection",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"Assert",
".",
"notNull",
"(",
"a... | Collect all the values of a the specified attribute from the supplied
Attributes as the specified class.
@param attributes The Attributes; not <code>null</code>.
@param name The name of the Attribute to get values for.
@param collection the collection to collect the values in.
@param clazz the class of the collected a... | [
"Collect",
"all",
"the",
"values",
"of",
"a",
"the",
"specified",
"attribute",
"from",
"the",
"supplied",
"Attributes",
"as",
"the",
"specified",
"class",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L275-L289 |
51,819 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.iterateAttributeValues | public static void iterateAttributeValues(Attribute attribute, AttributeValueCallbackHandler callbackHandler) {
Assert.notNull(attribute, "Attribute must not be null");
Assert.notNull(callbackHandler, "callbackHandler must not be null");
if (attribute instanceof Iterable) {
int i = 0;
for (Object obj : (It... | java | public static void iterateAttributeValues(Attribute attribute, AttributeValueCallbackHandler callbackHandler) {
Assert.notNull(attribute, "Attribute must not be null");
Assert.notNull(callbackHandler, "callbackHandler must not be null");
if (attribute instanceof Iterable) {
int i = 0;
for (Object obj : (It... | [
"public",
"static",
"void",
"iterateAttributeValues",
"(",
"Attribute",
"attribute",
",",
"AttributeValueCallbackHandler",
"callbackHandler",
")",
"{",
"Assert",
".",
"notNull",
"(",
"attribute",
",",
"\"Attribute must not be null\"",
")",
";",
"Assert",
".",
"notNull",... | Iterate through all the values of the specified Attribute calling back to
the specified callbackHandler.
@param attribute the Attribute to work with; not <code>null</code>.
@param callbackHandler the callbackHandler; not <code>null</code>.
@since 1.3 | [
"Iterate",
"through",
"all",
"the",
"values",
"of",
"the",
"specified",
"Attribute",
"calling",
"back",
"to",
"the",
"specified",
"callbackHandler",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L298-L318 |
51,820 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.newLdapName | public static LdapName newLdapName(String distinguishedName) {
Assert.notNull(distinguishedName, "distinguishedName must not be null");
try {
return new LdapName(distinguishedName);
} catch (InvalidNameException e) {
throw convertLdapException(e);
}
} | java | public static LdapName newLdapName(String distinguishedName) {
Assert.notNull(distinguishedName, "distinguishedName must not be null");
try {
return new LdapName(distinguishedName);
} catch (InvalidNameException e) {
throw convertLdapException(e);
}
} | [
"public",
"static",
"LdapName",
"newLdapName",
"(",
"String",
"distinguishedName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"distinguishedName",
",",
"\"distinguishedName must not be null\"",
")",
";",
"try",
"{",
"return",
"new",
"LdapName",
"(",
"distinguishedName",... | Construct a new LdapName instance from the supplied distinguished name string.
@param distinguishedName the string to parse for constructing an LdapName instance.
@return a new LdapName instance.
@throws org.springframework.ldap.InvalidNameException to wrap any InvalidNameExceptions thrown by LdapName.
@since 2.0 | [
"Construct",
"a",
"new",
"LdapName",
"instance",
"from",
"the",
"supplied",
"distinguished",
"name",
"string",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L410-L418 |
51,821 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.getRdn | public static Rdn getRdn(Name name, String key) {
Assert.notNull(name, "name must not be null");
Assert.hasText(key, "key must not be blank");
LdapName ldapName = returnOrConstructLdapNameFromName(name);
List<Rdn> rdns = ldapName.getRdns();
for (Rdn rdn : rdns) {
Na... | java | public static Rdn getRdn(Name name, String key) {
Assert.notNull(name, "name must not be null");
Assert.hasText(key, "key must not be blank");
LdapName ldapName = returnOrConstructLdapNameFromName(name);
List<Rdn> rdns = ldapName.getRdns();
for (Rdn rdn : rdns) {
Na... | [
"public",
"static",
"Rdn",
"getRdn",
"(",
"Name",
"name",
",",
"String",
"key",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"name must not be null\"",
")",
";",
"Assert",
".",
"hasText",
"(",
"key",
",",
"\"key must not be blank\"",
")",
";",
"... | Find the Rdn with the requested key in the supplied Name.
@param name the Name in which to search for the key.
@param key the attribute key to search for.
@return the rdn corresponding to the <b>first</b> occurrence of the requested key.
@throws NoSuchElementException if no corresponding entry is found.
@since 2.0 | [
"Find",
"the",
"Rdn",
"with",
"the",
"requested",
"key",
"in",
"the",
"supplied",
"Name",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L506-L524 |
51,822 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.getValue | public static Object getValue(Name name, String key) {
NamingEnumeration<? extends Attribute> allAttributes = getRdn(name, key).toAttributes().getAll();
while (allAttributes.hasMoreElements()) {
Attribute oneAttribute = allAttributes.nextElement();
if(key.equalsIgnoreCase(oneAttr... | java | public static Object getValue(Name name, String key) {
NamingEnumeration<? extends Attribute> allAttributes = getRdn(name, key).toAttributes().getAll();
while (allAttributes.hasMoreElements()) {
Attribute oneAttribute = allAttributes.nextElement();
if(key.equalsIgnoreCase(oneAttr... | [
"public",
"static",
"Object",
"getValue",
"(",
"Name",
"name",
",",
"String",
"key",
")",
"{",
"NamingEnumeration",
"<",
"?",
"extends",
"Attribute",
">",
"allAttributes",
"=",
"getRdn",
"(",
"name",
",",
"key",
")",
".",
"toAttributes",
"(",
")",
".",
"... | Get the value of the Rdn with the requested key in the supplied Name.
@param name the Name in which to search for the key.
@param key the attribute key to search for.
@return the value of the rdn corresponding to the <b>first</b> occurrence of the requested key.
@throws NoSuchElementException if no corresponding entry... | [
"Get",
"the",
"value",
"of",
"the",
"Rdn",
"with",
"the",
"requested",
"key",
"in",
"the",
"supplied",
"Name",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L535-L550 |
51,823 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.getValue | public static Object getValue(Name name, int index) {
Assert.notNull(name, "name must not be null");
LdapName ldapName = returnOrConstructLdapNameFromName(name);
Rdn rdn = ldapName.getRdn(index);
if(rdn.size() > 1) {
LOGGER.warn("Rdn at position " + index + " of dn '" + name... | java | public static Object getValue(Name name, int index) {
Assert.notNull(name, "name must not be null");
LdapName ldapName = returnOrConstructLdapNameFromName(name);
Rdn rdn = ldapName.getRdn(index);
if(rdn.size() > 1) {
LOGGER.warn("Rdn at position " + index + " of dn '" + name... | [
"public",
"static",
"Object",
"getValue",
"(",
"Name",
"name",
",",
"int",
"index",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"name must not be null\"",
")",
";",
"LdapName",
"ldapName",
"=",
"returnOrConstructLdapNameFromName",
"(",
"name",
")",
... | Get the value of the Rdn at the requested index in the supplied Name.
@param name the Name to work on.
@param index The 0-based index of the rdn value to retrieve. Must be in the range [0,size()).
@return the value of the rdn at the requested index.
@throws IndexOutOfBoundsException if index is outside the specified r... | [
"Get",
"the",
"value",
"of",
"the",
"Rdn",
"at",
"the",
"requested",
"index",
"in",
"the",
"supplied",
"Name",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L561-L572 |
51,824 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.getStringValue | public static String getStringValue(Name name, String key) {
return (String) getValue(name, key);
} | java | public static String getStringValue(Name name, String key) {
return (String) getValue(name, key);
} | [
"public",
"static",
"String",
"getStringValue",
"(",
"Name",
"name",
",",
"String",
"key",
")",
"{",
"return",
"(",
"String",
")",
"getValue",
"(",
"name",
",",
"key",
")",
";",
"}"
] | Get the value of the Rdn with the requested key in the supplied Name as a String.
@param name the Name in which to search for the key.
@param key the attribute key to search for.
@return the String value of the rdn corresponding to the <b>first</b> occurrence of the requested key.
@throws NoSuchElementException if no ... | [
"Get",
"the",
"value",
"of",
"the",
"Rdn",
"with",
"the",
"requested",
"key",
"in",
"the",
"supplied",
"Name",
"as",
"a",
"String",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L598-L600 |
51,825 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.numberToBytes | static byte[] numberToBytes(String number, int length, boolean bigEndian) {
BigInteger bi = new BigInteger(number);
byte[] bytes = bi.toByteArray();
int remaining = length - bytes.length;
if (remaining < 0) {
bytes = Arrays.copyOfRange(bytes, -remaining, bytes.length);
} else {
byte[] fill = new byte[re... | java | static byte[] numberToBytes(String number, int length, boolean bigEndian) {
BigInteger bi = new BigInteger(number);
byte[] bytes = bi.toByteArray();
int remaining = length - bytes.length;
if (remaining < 0) {
bytes = Arrays.copyOfRange(bytes, -remaining, bytes.length);
} else {
byte[] fill = new byte[re... | [
"static",
"byte",
"[",
"]",
"numberToBytes",
"(",
"String",
"number",
",",
"int",
"length",
",",
"boolean",
"bigEndian",
")",
"{",
"BigInteger",
"bi",
"=",
"new",
"BigInteger",
"(",
"number",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"bi",
".",
"toByte... | Converts the given number to a binary representation of the specified
length and "endian-ness".
@param number String with number to convert
@param length How long the resulting binary array should be
@param bigEndian <code>true</code> if big endian (5=0005), or
<code>false</code> if little endian (5=5000)
@return byte... | [
"Converts",
"the",
"given",
"number",
"to",
"a",
"binary",
"representation",
"of",
"the",
"specified",
"length",
"and",
"endian",
"-",
"ness",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L725-L739 |
51,826 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.toHexString | static String toHexString(final byte b) {
String hexString = Integer.toHexString(b & 0xFF);
if (hexString.length() % 2 != 0) {
// Pad with 0
hexString = "0" + hexString;
}
return hexString;
} | java | static String toHexString(final byte b) {
String hexString = Integer.toHexString(b & 0xFF);
if (hexString.length() % 2 != 0) {
// Pad with 0
hexString = "0" + hexString;
}
return hexString;
} | [
"static",
"String",
"toHexString",
"(",
"final",
"byte",
"b",
")",
"{",
"String",
"hexString",
"=",
"Integer",
".",
"toHexString",
"(",
"b",
"&",
"0xFF",
")",
";",
"if",
"(",
"hexString",
".",
"length",
"(",
")",
"%",
"2",
"!=",
"0",
")",
"{",
"// ... | Converts a byte into its hexadecimal representation, padding with a
leading zero to get an even number of characters.
@param b value to convert
@return hex string, possibly padded with a zero | [
"Converts",
"a",
"byte",
"into",
"its",
"hexadecimal",
"representation",
"padding",
"with",
"a",
"leading",
"zero",
"to",
"get",
"an",
"even",
"number",
"of",
"characters",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L761-L768 |
51,827 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.toHexString | static String toHexString(final byte[] b) {
StringBuffer sb = new StringBuffer("{");
for (int i = 0; i < b.length; i++) {
sb.append(toHexString(b[i]));
if (i < b.length - 1) {
sb.append(",");
}
}
sb.append("}");
return sb.toString();
} | java | static String toHexString(final byte[] b) {
StringBuffer sb = new StringBuffer("{");
for (int i = 0; i < b.length; i++) {
sb.append(toHexString(b[i]));
if (i < b.length - 1) {
sb.append(",");
}
}
sb.append("}");
return sb.toString();
} | [
"static",
"String",
"toHexString",
"(",
"final",
"byte",
"[",
"]",
"b",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
"\"{\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"b",
".",
"length",
";",
"i",
"++",
")",
... | Converts a byte array into its hexadecimal representation, padding each
with a leading zero to get an even number of characters.
@param b values to convert
@return hex string, possibly with elements padded with a zero | [
"Converts",
"a",
"byte",
"array",
"into",
"its",
"hexadecimal",
"representation",
"padding",
"each",
"with",
"a",
"leading",
"zero",
"to",
"get",
"an",
"even",
"number",
"of",
"characters",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L777-L787 |
51,828 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/pool2/DelegatingContext.java | DelegatingContext.getInnermostDelegateContext | public Context getInnermostDelegateContext() {
final Context delegateContext = this.getDelegateContext();
if (delegateContext instanceof DelegatingContext) {
return ((DelegatingContext)delegateContext).getInnermostDelegateContext();
}
return delegateContext;
} | java | public Context getInnermostDelegateContext() {
final Context delegateContext = this.getDelegateContext();
if (delegateContext instanceof DelegatingContext) {
return ((DelegatingContext)delegateContext).getInnermostDelegateContext();
}
return delegateContext;
} | [
"public",
"Context",
"getInnermostDelegateContext",
"(",
")",
"{",
"final",
"Context",
"delegateContext",
"=",
"this",
".",
"getDelegateContext",
"(",
")",
";",
"if",
"(",
"delegateContext",
"instanceof",
"DelegatingContext",
")",
"{",
"return",
"(",
"(",
"Delegat... | Recursivley inspect delegates until a non-delegating context is found.
@return The innermost (real) Context that is being delegated to. | [
"Recursivley",
"inspect",
"delegates",
"until",
"a",
"non",
"-",
"delegating",
"context",
"is",
"found",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/pool2/DelegatingContext.java#L73-L81 |
51,829 | spring-projects/spring-ldap | ldif/ldif-core/src/main/java/org/springframework/ldap/schema/BasicSchemaSpecification.java | BasicSchemaSpecification.isSatisfiedBy | public boolean isSatisfiedBy(LdapAttributes record) throws NamingException {
if (record != null) {
//DN is required.
LdapName dn = record.getName();
if (dn != null) {
//objectClass definition is required.
if (record.get("objectClass") != null) {
//Naming attribute is req... | java | public boolean isSatisfiedBy(LdapAttributes record) throws NamingException {
if (record != null) {
//DN is required.
LdapName dn = record.getName();
if (dn != null) {
//objectClass definition is required.
if (record.get("objectClass") != null) {
//Naming attribute is req... | [
"public",
"boolean",
"isSatisfiedBy",
"(",
"LdapAttributes",
"record",
")",
"throws",
"NamingException",
"{",
"if",
"(",
"record",
"!=",
"null",
")",
"{",
"//DN is required.\r",
"LdapName",
"dn",
"=",
"record",
".",
"getName",
"(",
")",
";",
"if",
"(",
"dn",... | Determines if the policy is satisfied by the supplied LdapAttributes object.
@throws NamingException | [
"Determines",
"if",
"the",
"policy",
"is",
"satisfied",
"by",
"the",
"supplied",
"LdapAttributes",
"object",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/ldif/ldif-core/src/main/java/org/springframework/ldap/schema/BasicSchemaSpecification.java#L31-L59 |
51,830 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/support/SingleContextSource.java | SingleContextSource.destroy | public void destroy() {
try {
ctx.close();
}
catch (javax.naming.NamingException e) {
LOG.warn("Error when closing", e);
}
} | java | public void destroy() {
try {
ctx.close();
}
catch (javax.naming.NamingException e) {
LOG.warn("Error when closing", e);
}
} | [
"public",
"void",
"destroy",
"(",
")",
"{",
"try",
"{",
"ctx",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"javax",
".",
"naming",
".",
"NamingException",
"e",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Error when closing\"",
",",
"e",
")",
";",
"}"... | Destroy method that allows the target DirContext to be cleaned up when
the SingleContextSource is not going to be used any more. | [
"Destroy",
"method",
"that",
"allows",
"the",
"target",
"DirContext",
"to",
"be",
"cleaned",
"up",
"when",
"the",
"SingleContextSource",
"is",
"not",
"going",
"to",
"be",
"used",
"any",
"more",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/SingleContextSource.java#L90-L97 |
51,831 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/DistinguishedName.java | DistinguishedName.parse | protected final void parse(String path) {
DnParser parser = DefaultDnParserFactory.createDnParser(unmangleCompositeName(path));
DistinguishedName dn;
try {
dn = parser.dn();
}
catch (ParseException e) {
throw new BadLdapGrammarException("Failed to parse DN", e);
}
catch (TokenMgrError e) {
throw ... | java | protected final void parse(String path) {
DnParser parser = DefaultDnParserFactory.createDnParser(unmangleCompositeName(path));
DistinguishedName dn;
try {
dn = parser.dn();
}
catch (ParseException e) {
throw new BadLdapGrammarException("Failed to parse DN", e);
}
catch (TokenMgrError e) {
throw ... | [
"protected",
"final",
"void",
"parse",
"(",
"String",
"path",
")",
"{",
"DnParser",
"parser",
"=",
"DefaultDnParserFactory",
".",
"createDnParser",
"(",
"unmangleCompositeName",
"(",
"path",
")",
")",
";",
"DistinguishedName",
"dn",
";",
"try",
"{",
"dn",
"=",... | Parse the supplied String and make this instance represent the
corresponding distinguished name.
@param path the LDAP path to parse. | [
"Parse",
"the",
"supplied",
"String",
"and",
"make",
"this",
"instance",
"represent",
"the",
"corresponding",
"distinguished",
"name",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java#L222-L235 |
51,832 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/DistinguishedName.java | DistinguishedName.toUrl | public String toUrl() {
StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE);
for (int i = names.size() - 1; i >= 0; i--) {
LdapRdn n = (LdapRdn) names.get(i);
buffer.append(n.encodeUrl());
if (i > 0) {
buffer.append(",");
}
}
return buffer.toString();
} | java | public String toUrl() {
StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE);
for (int i = names.size() - 1; i >= 0; i--) {
LdapRdn n = (LdapRdn) names.get(i);
buffer.append(n.encodeUrl());
if (i > 0) {
buffer.append(",");
}
}
return buffer.toString();
} | [
"public",
"String",
"toUrl",
"(",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
"DEFAULT_BUFFER_SIZE",
")",
";",
"for",
"(",
"int",
"i",
"=",
"names",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",... | Builds a complete LDAP path, ldap and url encoded. Separates only with
",".
@return the LDAP path, for use in an url. | [
"Builds",
"a",
"complete",
"LDAP",
"path",
"ldap",
"and",
"url",
"encoded",
".",
"Separates",
"only",
"with",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java#L391-L402 |
51,833 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/DistinguishedName.java | DistinguishedName.compareTo | public int compareTo(Object obj) {
DistinguishedName that = (DistinguishedName) obj;
ListComparator comparator = new ListComparator();
return comparator.compare(this.names, that.names);
} | java | public int compareTo(Object obj) {
DistinguishedName that = (DistinguishedName) obj;
ListComparator comparator = new ListComparator();
return comparator.compare(this.names, that.names);
} | [
"public",
"int",
"compareTo",
"(",
"Object",
"obj",
")",
"{",
"DistinguishedName",
"that",
"=",
"(",
"DistinguishedName",
")",
"obj",
";",
"ListComparator",
"comparator",
"=",
"new",
"ListComparator",
"(",
")",
";",
"return",
"comparator",
".",
"compare",
"(",... | Compare this instance to another object. Note that the comparison is done
in order of significance, so the most significant Rdn is compared first,
then the second and so on.
@see javax.naming.Name#compareTo(java.lang.Object) | [
"Compare",
"this",
"instance",
"to",
"another",
"object",
".",
"Note",
"that",
"the",
"comparison",
"is",
"done",
"in",
"order",
"of",
"significance",
"so",
"the",
"most",
"significant",
"Rdn",
"is",
"compared",
"first",
"then",
"the",
"second",
"and",
"so",... | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java#L577-L581 |
51,834 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/DistinguishedName.java | DistinguishedName.immutableDistinguishedName | public DistinguishedName immutableDistinguishedName() {
List listWithImmutableRdns = new ArrayList(names.size());
for (Iterator iterator = names.iterator(); iterator.hasNext();) {
LdapRdn rdn = (LdapRdn) iterator.next();
listWithImmutableRdns.add(rdn.immutableLdapRdn());
}
return new DistinguishedName(Co... | java | public DistinguishedName immutableDistinguishedName() {
List listWithImmutableRdns = new ArrayList(names.size());
for (Iterator iterator = names.iterator(); iterator.hasNext();) {
LdapRdn rdn = (LdapRdn) iterator.next();
listWithImmutableRdns.add(rdn.immutableLdapRdn());
}
return new DistinguishedName(Co... | [
"public",
"DistinguishedName",
"immutableDistinguishedName",
"(",
")",
"{",
"List",
"listWithImmutableRdns",
"=",
"new",
"ArrayList",
"(",
"names",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Iterator",
"iterator",
"=",
"names",
".",
"iterator",
"(",
")",
... | Return an immutable copy of this instance. It will not be possible to add
or remove any Rdns to or from the returned instance, and the respective
Rdns will also be immutable in turn.
@return a copy of this instance backed by an immutable list.
@since 1.2 | [
"Return",
"an",
"immutable",
"copy",
"of",
"this",
"instance",
".",
"It",
"will",
"not",
"be",
"possible",
"to",
"add",
"or",
"remove",
"any",
"Rdns",
"to",
"or",
"from",
"the",
"returned",
"instance",
"and",
"the",
"respective",
"Rdns",
"will",
"also",
... | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/DistinguishedName.java#L840-L848 |
51,835 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/odm/core/impl/AttributeMetaData.java | AttributeMetaData.processAttributeAnnotation | private boolean processAttributeAnnotation(Field field) {
// Default to no syntax specified
syntax = "";
// Default to a String based attribute
isBinary = false;
// Default name of attribute to the name of the field
name = new CaseIgnoreString(fi... | java | private boolean processAttributeAnnotation(Field field) {
// Default to no syntax specified
syntax = "";
// Default to a String based attribute
isBinary = false;
// Default name of attribute to the name of the field
name = new CaseIgnoreString(fi... | [
"private",
"boolean",
"processAttributeAnnotation",
"(",
"Field",
"field",
")",
"{",
"// Default to no syntax specified\r",
"syntax",
"=",
"\"\"",
";",
"// Default to a String based attribute\r",
"isBinary",
"=",
"false",
";",
"// Default name of attribute to the name of the fiel... | syntax, isBinary, isObjectClass and name. | [
"syntax",
"isBinary",
"isObjectClass",
"and",
"name",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/odm/core/impl/AttributeMetaData.java#L86-L123 |
51,836 | spring-projects/spring-ldap | odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java | SchemaToJava.readSyntaxMap | private static Map<String, String> readSyntaxMap(File syntaxMapFile)
throws IOException {
Map<String, String> result = new HashMap<String, String>();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(syntaxMapFile));
String ... | java | private static Map<String, String> readSyntaxMap(File syntaxMapFile)
throws IOException {
Map<String, String> result = new HashMap<String, String>();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(syntaxMapFile));
String ... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"readSyntaxMap",
"(",
"File",
"syntaxMapFile",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"result",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
... | Read mappings of LDAP syntaxes to Java classes. | [
"Read",
"mappings",
"of",
"LDAP",
"syntaxes",
"to",
"Java",
"classes",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java#L195-L230 |
51,837 | spring-projects/spring-ldap | odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java | SchemaToJava.readSchema | private static ObjectSchema readSchema(String url, String user, String pass,
SyntaxToJavaClass syntaxToJavaClass, Set<String> binarySet, Set<String> objectClasses)
throws NamingException, ClassNotFoundException {
// Set up environment
Hashtable<String, String> env = new Ha... | java | private static ObjectSchema readSchema(String url, String user, String pass,
SyntaxToJavaClass syntaxToJavaClass, Set<String> binarySet, Set<String> objectClasses)
throws NamingException, ClassNotFoundException {
// Set up environment
Hashtable<String, String> env = new Ha... | [
"private",
"static",
"ObjectSchema",
"readSchema",
"(",
"String",
"url",
",",
"String",
"user",
",",
"String",
"pass",
",",
"SyntaxToJavaClass",
"syntaxToJavaClass",
",",
"Set",
"<",
"String",
">",
"binarySet",
",",
"Set",
"<",
"String",
">",
"objectClasses",
... | Bind to the directory, read and process the schema | [
"Bind",
"to",
"the",
"directory",
"read",
"and",
"process",
"the",
"schema"
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java#L233-L258 |
51,838 | spring-projects/spring-ldap | odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java | SchemaToJava.createCode | private static void createCode(String packageName,
String className, ObjectSchema schema, Set<SyntaxToJavaClass.ClassInfo> imports, File outputFile)
throws IOException, TemplateException {
Configuration freeMarkerConfiguration = new Configuration();
freeMarkerConfiguratio... | java | private static void createCode(String packageName,
String className, ObjectSchema schema, Set<SyntaxToJavaClass.ClassInfo> imports, File outputFile)
throws IOException, TemplateException {
Configuration freeMarkerConfiguration = new Configuration();
freeMarkerConfiguratio... | [
"private",
"static",
"void",
"createCode",
"(",
"String",
"packageName",
",",
"String",
"className",
",",
"ObjectSchema",
"schema",
",",
"Set",
"<",
"SyntaxToJavaClass",
".",
"ClassInfo",
">",
"imports",
",",
"File",
"outputFile",
")",
"throws",
"IOException",
"... | Create the Java | [
"Create",
"the",
"Java"
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java#L261-L293 |
51,839 | spring-projects/spring-ldap | odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java | SchemaToJava.makeOutputFile | private static File makeOutputFile(String outputDir, String packageName, String className)
throws IOException {
// Convert the package name to a path
Pattern pattern=Pattern.compile("\\.");
Matcher matcher=pattern.matcher(packageName);
String sepToUse=File.separator;
... | java | private static File makeOutputFile(String outputDir, String packageName, String className)
throws IOException {
// Convert the package name to a path
Pattern pattern=Pattern.compile("\\.");
Matcher matcher=pattern.matcher(packageName);
String sepToUse=File.separator;
... | [
"private",
"static",
"File",
"makeOutputFile",
"(",
"String",
"outputDir",
",",
"String",
"packageName",
",",
"String",
"className",
")",
"throws",
"IOException",
"{",
"// Convert the package name to a path",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
... | Create the output file for the generated code along with all intervening directories | [
"Create",
"the",
"output",
"file",
"for",
"the",
"generated",
"code",
"along",
"with",
"all",
"intervening",
"directories"
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/odm/src/main/java/org/springframework/ldap/odm/tools/SchemaToJava.java#L296-L324 |
51,840 | spring-projects/spring-ldap | odm/src/main/java/org/springframework/ldap/odm/tools/SchemaReader.java | SchemaReader.getObjectSchema | public ObjectSchema getObjectSchema(Set<String> objectClasses)
throws NamingException, ClassNotFoundException {
ObjectSchema result = new ObjectSchema();
createObjectClass(objectClasses, schemaContext, result);
return result;
} | java | public ObjectSchema getObjectSchema(Set<String> objectClasses)
throws NamingException, ClassNotFoundException {
ObjectSchema result = new ObjectSchema();
createObjectClass(objectClasses, schemaContext, result);
return result;
} | [
"public",
"ObjectSchema",
"getObjectSchema",
"(",
"Set",
"<",
"String",
">",
"objectClasses",
")",
"throws",
"NamingException",
",",
"ClassNotFoundException",
"{",
"ObjectSchema",
"result",
"=",
"new",
"ObjectSchema",
"(",
")",
";",
"createObjectClass",
"(",
"object... | Get the object schema for the given object classes | [
"Get",
"the",
"object",
"schema",
"for",
"the",
"given",
"object",
"classes"
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/odm/src/main/java/org/springframework/ldap/odm/tools/SchemaReader.java#L44-L50 |
51,841 | spring-projects/spring-ldap | odm/src/main/java/org/springframework/ldap/odm/tools/SchemaReader.java | SchemaReader.createObjectClass | private void createObjectClass(Set<String> objectClasses, DirContext schemaContext, ObjectSchema schema)
throws NamingException, ClassNotFoundException {
// Super classes
Set<String> supList = new HashSet<String>();
// For each of the given object classes
for (String... | java | private void createObjectClass(Set<String> objectClasses, DirContext schemaContext, ObjectSchema schema)
throws NamingException, ClassNotFoundException {
// Super classes
Set<String> supList = new HashSet<String>();
// For each of the given object classes
for (String... | [
"private",
"void",
"createObjectClass",
"(",
"Set",
"<",
"String",
">",
"objectClasses",
",",
"DirContext",
"schemaContext",
",",
"ObjectSchema",
"schema",
")",
"throws",
"NamingException",
",",
"ClassNotFoundException",
"{",
"// Super classes\r",
"Set",
"<",
"String"... | Recursively extract schema from the directory and process it | [
"Recursively",
"extract",
"schema",
"from",
"the",
"directory",
"and",
"process",
"it"
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/odm/src/main/java/org/springframework/ldap/odm/tools/SchemaReader.java#L131-L185 |
51,842 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java | AbstractContextSource.closeContext | private void closeContext(DirContext ctx) {
if (ctx != null) {
try {
ctx.close();
}
catch (Exception e) {
LOG.debug("Exception closing context", e);
}
}
} | java | private void closeContext(DirContext ctx) {
if (ctx != null) {
try {
ctx.close();
}
catch (Exception e) {
LOG.debug("Exception closing context", e);
}
}
} | [
"private",
"void",
"closeContext",
"(",
"DirContext",
"ctx",
")",
"{",
"if",
"(",
"ctx",
"!=",
"null",
")",
"{",
"try",
"{",
"ctx",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Exception c... | Close the context and swallow any exceptions.
@param ctx the DirContext to close. | [
"Close",
"the",
"context",
"and",
"swallow",
"any",
"exceptions",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java#L206-L215 |
51,843 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java | AbstractContextSource.createContext | protected DirContext createContext(Hashtable<String, Object> environment) {
DirContext ctx = null;
try {
ctx = getDirContextInstance(environment);
if (LOG.isInfoEnabled()) {
Hashtable<?, ?> ctxEnv = ctx.getEnvironment();
String ldapUrl = (String) ctxEnv.get(Context.PROVIDER_URL);
LOG.debug("Got ... | java | protected DirContext createContext(Hashtable<String, Object> environment) {
DirContext ctx = null;
try {
ctx = getDirContextInstance(environment);
if (LOG.isInfoEnabled()) {
Hashtable<?, ?> ctxEnv = ctx.getEnvironment();
String ldapUrl = (String) ctxEnv.get(Context.PROVIDER_URL);
LOG.debug("Got ... | [
"protected",
"DirContext",
"createContext",
"(",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"environment",
")",
"{",
"DirContext",
"ctx",
"=",
"null",
";",
"try",
"{",
"ctx",
"=",
"getDirContextInstance",
"(",
"environment",
")",
";",
"if",
"(",
"LOG",
... | Create a DirContext using the supplied environment.
@param environment the LDAP environment to use when creating the
<code>DirContext</code>.
@return a new DirContext implementation initialized with the supplied
environment. | [
"Create",
"a",
"DirContext",
"using",
"the",
"supplied",
"environment",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java#L339-L357 |
51,844 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java | AbstractContextSource.afterPropertiesSet | public void afterPropertiesSet() {
if (ObjectUtils.isEmpty(urls)) {
throw new IllegalArgumentException("At least one server url must be set");
}
if (authenticationSource == null) {
LOG.debug("AuthenticationSource not set - " + "using default implementation");
if (!StringUtils.hasText(userDn)) {
LOG.... | java | public void afterPropertiesSet() {
if (ObjectUtils.isEmpty(urls)) {
throw new IllegalArgumentException("At least one server url must be set");
}
if (authenticationSource == null) {
LOG.debug("AuthenticationSource not set - " + "using default implementation");
if (!StringUtils.hasText(userDn)) {
LOG.... | [
"public",
"void",
"afterPropertiesSet",
"(",
")",
"{",
"if",
"(",
"ObjectUtils",
".",
"isEmpty",
"(",
"urls",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"At least one server url must be set\"",
")",
";",
"}",
"if",
"(",
"authenticationSource... | Checks that all necessary data is set and that there is no compatibility
issues, after which the instance is initialized. Note that you need to
call this method explicitly after setting all desired properties if using
the class outside of a Spring Context. | [
"Checks",
"that",
"all",
"necessary",
"data",
"is",
"set",
"and",
"that",
"there",
"is",
"no",
"compatibility",
"issues",
"after",
"which",
"the",
"instance",
"is",
"initialized",
".",
"Note",
"that",
"you",
"need",
"to",
"call",
"this",
"method",
"explicitl... | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java#L407-L427 |
51,845 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java | AbstractContextSource.setBaseEnvironmentProperties | public void setBaseEnvironmentProperties(Map<String, Object> baseEnvironmentProperties) {
this.baseEnv = new Hashtable<String, Object>(baseEnvironmentProperties);
} | java | public void setBaseEnvironmentProperties(Map<String, Object> baseEnvironmentProperties) {
this.baseEnv = new Hashtable<String, Object>(baseEnvironmentProperties);
} | [
"public",
"void",
"setBaseEnvironmentProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"baseEnvironmentProperties",
")",
"{",
"this",
".",
"baseEnv",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"(",
"baseEnvironmentProperties",
")",
";"... | If any custom environment properties are needed, these can be set using
this method.
@param baseEnvironmentProperties the base environment properties that should always be used when
creating new Context instances. | [
"If",
"any",
"custom",
"environment",
"properties",
"are",
"needed",
"these",
"can",
"be",
"set",
"using",
"this",
"method",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java#L567-L569 |
51,846 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapNameBuilder.java | LdapNameBuilder.add | public LdapNameBuilder add(Name name) {
Assert.notNull(name, "name must not be null");
try {
ldapName.addAll(ldapName.size(), name);
return this;
} catch (InvalidNameException e) {
throw new org.springframework.ldap.InvalidNameException(e);
}
} | java | public LdapNameBuilder add(Name name) {
Assert.notNull(name, "name must not be null");
try {
ldapName.addAll(ldapName.size(), name);
return this;
} catch (InvalidNameException e) {
throw new org.springframework.ldap.InvalidNameException(e);
}
} | [
"public",
"LdapNameBuilder",
"add",
"(",
"Name",
"name",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"name must not be null\"",
")",
";",
"try",
"{",
"ldapName",
".",
"addAll",
"(",
"ldapName",
".",
"size",
"(",
")",
",",
"name",
")",
";",
... | Append the specified name to the currently built LdapName.
@param name the name to add.
@return this builder. | [
"Append",
"the",
"specified",
"name",
"to",
"the",
"currently",
"built",
"LdapName",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapNameBuilder.java#L101-L110 |
51,847 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapNameBuilder.java | LdapNameBuilder.add | public LdapNameBuilder add(String name) {
Assert.notNull(name, "name must not be null");
return add(LdapUtils.newLdapName(name));
} | java | public LdapNameBuilder add(String name) {
Assert.notNull(name, "name must not be null");
return add(LdapUtils.newLdapName(name));
} | [
"public",
"LdapNameBuilder",
"add",
"(",
"String",
"name",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"name must not be null\"",
")",
";",
"return",
"add",
"(",
"LdapUtils",
".",
"newLdapName",
"(",
"name",
")",
")",
";",
"}"
] | Append the LdapName represented by the specified string to the currently built LdapName.
@param name the name to add.
@return this builder. | [
"Append",
"the",
"LdapName",
"represented",
"by",
"the",
"specified",
"string",
"to",
"the",
"currently",
"built",
"LdapName",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapNameBuilder.java#L118-L122 |
51,848 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapTemplate.java | LdapTemplate.deleteRecursively | protected void deleteRecursively(DirContext ctx, Name name) {
NamingEnumeration enumeration = null;
try {
enumeration = ctx.listBindings(name);
while (enumeration.hasMore()) {
Binding binding = (Binding) enumeration.next();
LdapName childName = LdapUtils.newLdapName(binding.getName());
childName.... | java | protected void deleteRecursively(DirContext ctx, Name name) {
NamingEnumeration enumeration = null;
try {
enumeration = ctx.listBindings(name);
while (enumeration.hasMore()) {
Binding binding = (Binding) enumeration.next();
LdapName childName = LdapUtils.newLdapName(binding.getName());
childName.... | [
"protected",
"void",
"deleteRecursively",
"(",
"DirContext",
"ctx",
",",
"Name",
"name",
")",
"{",
"NamingEnumeration",
"enumeration",
"=",
"null",
";",
"try",
"{",
"enumeration",
"=",
"ctx",
".",
"listBindings",
"(",
"name",
")",
";",
"while",
"(",
"enumera... | Delete all subcontexts including the current one recursively.
@param ctx The context to use for deleting.
@param name The starting point to delete recursively.
@throws NamingException if any error occurs | [
"Delete",
"all",
"subcontexts",
"including",
"the",
"current",
"one",
"recursively",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java#L1096-L1123 |
51,849 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapTemplate.java | LdapTemplate.assureReturnObjFlagSet | private void assureReturnObjFlagSet(SearchControls controls) {
Assert.notNull(controls, "controls must not be null");
if (!controls.getReturningObjFlag()) {
LOG.debug("The returnObjFlag of supplied SearchControls is not set"
+ " but a ContextMapper is used - setting flag to true");
control... | java | private void assureReturnObjFlagSet(SearchControls controls) {
Assert.notNull(controls, "controls must not be null");
if (!controls.getReturningObjFlag()) {
LOG.debug("The returnObjFlag of supplied SearchControls is not set"
+ " but a ContextMapper is used - setting flag to true");
control... | [
"private",
"void",
"assureReturnObjFlagSet",
"(",
"SearchControls",
"controls",
")",
"{",
"Assert",
".",
"notNull",
"(",
"controls",
",",
"\"controls must not be null\"",
")",
";",
"if",
"(",
"!",
"controls",
".",
"getReturningObjFlag",
"(",
")",
")",
"{",
"LOG"... | Make sure the returnObjFlag is set in the supplied SearchControls. Set it
and log if it's not set.
@param controls the SearchControls to check. | [
"Make",
"sure",
"the",
"returnObjFlag",
"is",
"set",
"in",
"the",
"supplied",
"SearchControls",
".",
"Set",
"it",
"and",
"log",
"if",
"it",
"s",
"not",
"set",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java#L1241-L1248 |
51,850 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/pool/DelegatingDirContext.java | DelegatingDirContext.getInnermostDelegateDirContext | public DirContext getInnermostDelegateDirContext() {
final DirContext delegateDirContext = this.getDelegateDirContext();
if (delegateDirContext instanceof DelegatingDirContext) {
return ((DelegatingDirContext)delegateDirContext).getInnermostDelegateDirContext();
}
return de... | java | public DirContext getInnermostDelegateDirContext() {
final DirContext delegateDirContext = this.getDelegateDirContext();
if (delegateDirContext instanceof DelegatingDirContext) {
return ((DelegatingDirContext)delegateDirContext).getInnermostDelegateDirContext();
}
return de... | [
"public",
"DirContext",
"getInnermostDelegateDirContext",
"(",
")",
"{",
"final",
"DirContext",
"delegateDirContext",
"=",
"this",
".",
"getDelegateDirContext",
"(",
")",
";",
"if",
"(",
"delegateDirContext",
"instanceof",
"DelegatingDirContext",
")",
"{",
"return",
"... | Recursivley inspect delegates until a non-delegating dir context is found.
@return The innermost (real) DirContext that is being delegated to. | [
"Recursivley",
"inspect",
"delegates",
"until",
"a",
"non",
"-",
"delegating",
"dir",
"context",
"is",
"found",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/pool/DelegatingDirContext.java#L78-L86 |
51,851 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/transaction/compensating/LdapTransactionUtils.java | LdapTransactionUtils.getFirstArgumentAsName | public static Name getFirstArgumentAsName(Object[] args) {
Assert.notEmpty(args);
Object firstArg = args[0];
return getArgumentAsName(firstArg);
} | java | public static Name getFirstArgumentAsName(Object[] args) {
Assert.notEmpty(args);
Object firstArg = args[0];
return getArgumentAsName(firstArg);
} | [
"public",
"static",
"Name",
"getFirstArgumentAsName",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"Assert",
".",
"notEmpty",
"(",
"args",
")",
";",
"Object",
"firstArg",
"=",
"args",
"[",
"0",
"]",
";",
"return",
"getArgumentAsName",
"(",
"firstArg",
")",
... | Get the first parameter in the argument list as a Name.
@param args
arguments supplied to a ldap operation.
@return a Name representation of the first argument, or the Name itself
if it is a name. | [
"Get",
"the",
"first",
"parameter",
"in",
"the",
"argument",
"list",
"as",
"a",
"Name",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/transaction/compensating/LdapTransactionUtils.java#L57-L62 |
51,852 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/transaction/compensating/LdapTransactionUtils.java | LdapTransactionUtils.getArgumentAsName | public static Name getArgumentAsName(Object arg) {
if (arg instanceof String) {
return LdapUtils.newLdapName((String) arg);
} else if (arg instanceof Name) {
return (Name) arg;
} else {
throw new IllegalArgumentException(
"First argu... | java | public static Name getArgumentAsName(Object arg) {
if (arg instanceof String) {
return LdapUtils.newLdapName((String) arg);
} else if (arg instanceof Name) {
return (Name) arg;
} else {
throw new IllegalArgumentException(
"First argu... | [
"public",
"static",
"Name",
"getArgumentAsName",
"(",
"Object",
"arg",
")",
"{",
"if",
"(",
"arg",
"instanceof",
"String",
")",
"{",
"return",
"LdapUtils",
".",
"newLdapName",
"(",
"(",
"String",
")",
"arg",
")",
";",
"}",
"else",
"if",
"(",
"arg",
"in... | Get the argument as a Name.
@param arg
an argument supplied to an Ldap operation.
@return a Name representation of the argument, or the Name itself if it
is a Name. | [
"Get",
"the",
"argument",
"as",
"a",
"Name",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/transaction/compensating/LdapTransactionUtils.java#L72-L81 |
51,853 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/support/DefaultIncrementalAttributesMapper.java | DefaultIncrementalAttributesMapper.lookupAttributes | public static Attributes lookupAttributes(LdapOperations ldapOperations, Name dn, String[] attributes) {
return loopForAllAttributeValues(ldapOperations, dn, attributes).getCollectedAttributes();
} | java | public static Attributes lookupAttributes(LdapOperations ldapOperations, Name dn, String[] attributes) {
return loopForAllAttributeValues(ldapOperations, dn, attributes).getCollectedAttributes();
} | [
"public",
"static",
"Attributes",
"lookupAttributes",
"(",
"LdapOperations",
"ldapOperations",
",",
"Name",
"dn",
",",
"String",
"[",
"]",
"attributes",
")",
"{",
"return",
"loopForAllAttributeValues",
"(",
"ldapOperations",
",",
"dn",
",",
"attributes",
")",
".",... | Lookup all values for the specified attributes, looping through the results incrementally if necessary.
@param ldapOperations The instance to use for performing the actual lookup.
@param dn The distinguished name of the object to find.
@param attributes names of the attributes to request.
@return an At... | [
"Lookup",
"all",
"values",
"for",
"the",
"specified",
"attributes",
"looping",
"through",
"the",
"results",
"incrementally",
"if",
"necessary",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/DefaultIncrementalAttributesMapper.java#L304-L306 |
51,854 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/odm/typeconversion/impl/ConverterManagerFactoryBean.java | ConverterManagerFactoryBean.getObject | public Object getObject() throws Exception {
if (converterConfigList==null) {
throw new FactoryBeanNotInitializedException("converterConfigList has not been set");
}
ConverterManagerImpl result = new ConverterManagerImpl();
for (ConverterConfig converterConfig : conv... | java | public Object getObject() throws Exception {
if (converterConfigList==null) {
throw new FactoryBeanNotInitializedException("converterConfigList has not been set");
}
ConverterManagerImpl result = new ConverterManagerImpl();
for (ConverterConfig converterConfig : conv... | [
"public",
"Object",
"getObject",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"converterConfigList",
"==",
"null",
")",
"{",
"throw",
"new",
"FactoryBeanNotInitializedException",
"(",
"\"converterConfigList has not been set\"",
")",
";",
"}",
"ConverterManagerImpl",... | Creates a ConverterManagerImpl populating it with Converter instances from the converterConfigList property.
@return The newly created {@link org.springframework.ldap.odm.typeconversion.ConverterManager}.
@throws ClassNotFoundException Thrown if any of the classes to be converted to or from cannot be found.
@see org.... | [
"Creates",
"a",
"ConverterManagerImpl",
"populating",
"it",
"with",
"Converter",
"instances",
"from",
"the",
"converterConfigList",
"property",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/odm/typeconversion/impl/ConverterManagerFactoryBean.java#L169-L194 |
51,855 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/DirContextAdapter.java | DirContextAdapter.setAttribute | public void setAttribute(Attribute attribute) {
if (!updateMode) {
originalAttrs.put(attribute);
}
else {
updatedAttrs.put(attribute);
}
} | java | public void setAttribute(Attribute attribute) {
if (!updateMode) {
originalAttrs.put(attribute);
}
else {
updatedAttrs.put(attribute);
}
} | [
"public",
"void",
"setAttribute",
"(",
"Attribute",
"attribute",
")",
"{",
"if",
"(",
"!",
"updateMode",
")",
"{",
"originalAttrs",
".",
"put",
"(",
"attribute",
")",
";",
"}",
"else",
"{",
"updatedAttrs",
".",
"put",
"(",
"attribute",
")",
";",
"}",
"... | Set the supplied attribute.
@param attribute the attribute to set. | [
"Set",
"the",
"supplied",
"attribute",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/DirContextAdapter.java#L812-L819 |
51,856 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/pool/DelegatingLdapContext.java | DelegatingLdapContext.getInnermostDelegateLdapContext | public LdapContext getInnermostDelegateLdapContext() {
final LdapContext delegateLdapContext = this.getDelegateLdapContext();
if (delegateLdapContext instanceof DelegatingLdapContext) {
return ((DelegatingLdapContext)delegateLdapContext).getInnermostDelegateLdapContext();
}
... | java | public LdapContext getInnermostDelegateLdapContext() {
final LdapContext delegateLdapContext = this.getDelegateLdapContext();
if (delegateLdapContext instanceof DelegatingLdapContext) {
return ((DelegatingLdapContext)delegateLdapContext).getInnermostDelegateLdapContext();
}
... | [
"public",
"LdapContext",
"getInnermostDelegateLdapContext",
"(",
")",
"{",
"final",
"LdapContext",
"delegateLdapContext",
"=",
"this",
".",
"getDelegateLdapContext",
"(",
")",
";",
"if",
"(",
"delegateLdapContext",
"instanceof",
"DelegatingLdapContext",
")",
"{",
"retur... | Recursivley inspect delegates until a non-delegating ldap context is found.
@return The innermost (real) DirContext that is being delegated to. | [
"Recursivley",
"inspect",
"delegates",
"until",
"a",
"non",
"-",
"delegating",
"ldap",
"context",
"is",
"found",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/pool/DelegatingLdapContext.java#L74-L82 |
51,857 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/pool2/factory/PooledContextSource.java | PooledContextSource.getContext | protected DirContext getContext(DirContextType dirContextType) {
final DirContext dirContext;
try {
dirContext = (DirContext) this.keyedObjectPool.borrowObject(dirContextType);
}
catch (Exception e) {
throw new DataAccessResourceFailureException("Failed to borrow DirContext from pool.", e);
}
if (dir... | java | protected DirContext getContext(DirContextType dirContextType) {
final DirContext dirContext;
try {
dirContext = (DirContext) this.keyedObjectPool.borrowObject(dirContextType);
}
catch (Exception e) {
throw new DataAccessResourceFailureException("Failed to borrow DirContext from pool.", e);
}
if (dir... | [
"protected",
"DirContext",
"getContext",
"(",
"DirContextType",
"dirContextType",
")",
"{",
"final",
"DirContext",
"dirContext",
";",
"try",
"{",
"dirContext",
"=",
"(",
"DirContext",
")",
"this",
".",
"keyedObjectPool",
".",
"borrowObject",
"(",
"dirContextType",
... | Gets a DirContext of the specified type from the keyed object pool.
@param dirContextType The type of context to return.
@return A wrapped DirContext of the specified type.
@throws DataAccessResourceFailureException If retrieving the object from
the pool throws an exception | [
"Gets",
"a",
"DirContext",
"of",
"the",
"specified",
"type",
"from",
"the",
"keyed",
"object",
"pool",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/pool2/factory/PooledContextSource.java#L257-L271 |
51,858 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapEncoder.java | LdapEncoder.filterEncode | public static String filterEncode(String value) {
if (value == null)
return null;
// make buffer roomy
StringBuilder encodedValue = new StringBuilder(value.length() * 2);
int length = value.length();
for (int i = 0; i < length; i++) {
char... | java | public static String filterEncode(String value) {
if (value == null)
return null;
// make buffer roomy
StringBuilder encodedValue = new StringBuilder(value.length() * 2);
int length = value.length();
for (int i = 0; i < length; i++) {
char... | [
"public",
"static",
"String",
"filterEncode",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"// make buffer roomy\r",
"StringBuilder",
"encodedValue",
"=",
"new",
"StringBuilder",
"(",
"value",
".",
"length",
"... | Escape a value for use in a filter.
@param value
the value to escape.
@return a properly escaped representation of the supplied value. | [
"Escape",
"a",
"value",
"for",
"use",
"in",
"a",
"filter",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapEncoder.java#L99-L122 |
51,859 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapEncoder.java | LdapEncoder.nameEncode | public static String nameEncode(String value) {
if (value == null)
return null;
// make buffer roomy
StringBuilder encodedValue = new StringBuilder(value.length() * 2);
int length = value.length();
int last = length - 1;
for (int i = 0; i < leng... | java | public static String nameEncode(String value) {
if (value == null)
return null;
// make buffer roomy
StringBuilder encodedValue = new StringBuilder(value.length() * 2);
int length = value.length();
int last = length - 1;
for (int i = 0; i < leng... | [
"public",
"static",
"String",
"nameEncode",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"// make buffer roomy\r",
"StringBuilder",
"encodedValue",
"=",
"new",
"StringBuilder",
"(",
"value",
".",
"length",
"("... | LDAP Encodes a value for use with a DN. Escapes for LDAP, not JNDI!
<br>Escapes:<br> ' ' [space] - "\ " [if first or last] <br> '#'
[hash] - "\#" <br> ',' [comma] - "\," <br> ';' [semicolon] - "\;" <br> '=
[equals] - "\=" <br> '+' [plus] - "\+" <br> '<' [less than] -
"\<" <br> '>' [greater than] - "\>" <br... | [
"LDAP",
"Encodes",
"a",
"value",
"for",
"use",
"with",
"a",
"DN",
".",
"Escapes",
"for",
"LDAP",
"not",
"JNDI!"
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapEncoder.java#L137-L174 |
51,860 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapEncoder.java | LdapEncoder.nameDecode | static public String nameDecode(String value)
throws BadLdapGrammarException {
if (value == null)
return null;
// make buffer same size
StringBuilder decoded = new StringBuilder(value.length());
int i = 0;
while (i < value.length()) {
... | java | static public String nameDecode(String value)
throws BadLdapGrammarException {
if (value == null)
return null;
// make buffer same size
StringBuilder decoded = new StringBuilder(value.length());
int i = 0;
while (i < value.length()) {
... | [
"static",
"public",
"String",
"nameDecode",
"(",
"String",
"value",
")",
"throws",
"BadLdapGrammarException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"// make buffer same size\r",
"StringBuilder",
"decoded",
"=",
"new",
"StringBuilder",
... | Decodes a value. Converts escaped chars to ordinary chars.
@param value
Trimmed value, so no leading an trailing blanks, except an
escaped space last.
@return The decoded value as a string.
@throws BadLdapGrammarException | [
"Decodes",
"a",
"value",
".",
"Converts",
"escaped",
"chars",
"to",
"ordinary",
"chars",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapEncoder.java#L185-L237 |
51,861 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapEncoder.java | LdapEncoder.printBase64Binary | public static String printBase64Binary(byte[] val) {
Assert.notNull(val, "val must not be null!");
String encoded = DatatypeConverter.printBase64Binary(val);
int length = encoded.length();
StringBuilder sb = new StringBuilder(length + length / RFC2849_MAX_BASE64_CHARS_PER_LINE)... | java | public static String printBase64Binary(byte[] val) {
Assert.notNull(val, "val must not be null!");
String encoded = DatatypeConverter.printBase64Binary(val);
int length = encoded.length();
StringBuilder sb = new StringBuilder(length + length / RFC2849_MAX_BASE64_CHARS_PER_LINE)... | [
"public",
"static",
"String",
"printBase64Binary",
"(",
"byte",
"[",
"]",
"val",
")",
"{",
"Assert",
".",
"notNull",
"(",
"val",
",",
"\"val must not be null!\"",
")",
";",
"String",
"encoded",
"=",
"DatatypeConverter",
".",
"printBase64Binary",
"(",
"val",
")... | Converts an array of bytes into a Base64 encoded string according to the rules for converting LDAP Attributes in RFC2849.
@param val
@return
A string containing a lexical representation of base64Binary wrapped around 76 characters.
@throws IllegalArgumentException if <tt>val</tt> is null. | [
"Converts",
"an",
"array",
"of",
"bytes",
"into",
"a",
"Base64",
"encoded",
"string",
"according",
"to",
"the",
"rules",
"for",
"converting",
"LDAP",
"Attributes",
"in",
"RFC2849",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapEncoder.java#L247-L266 |
51,862 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapEncoder.java | LdapEncoder.parseBase64Binary | public static byte[] parseBase64Binary(String val) {
Assert.notNull(val, "val must not be null!");
int length = val.length();
StringBuilder sb = new StringBuilder(length);
for (int i = 0, len = length; i < len; i++) {
char c = val.charAt(i);
if(c == ... | java | public static byte[] parseBase64Binary(String val) {
Assert.notNull(val, "val must not be null!");
int length = val.length();
StringBuilder sb = new StringBuilder(length);
for (int i = 0, len = length; i < len; i++) {
char c = val.charAt(i);
if(c == ... | [
"public",
"static",
"byte",
"[",
"]",
"parseBase64Binary",
"(",
"String",
"val",
")",
"{",
"Assert",
".",
"notNull",
"(",
"val",
",",
"\"val must not be null!\"",
")",
";",
"int",
"length",
"=",
"val",
".",
"length",
"(",
")",
";",
"StringBuilder",
"sb",
... | Converts the Base64 encoded string argument into an array of bytes.
@param val
@return
An array of bytes represented by the string argument.
@throws IllegalArgumentException if <tt>val</tt> is null or does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary. | [
"Converts",
"the",
"Base64",
"encoded",
"string",
"argument",
"into",
"an",
"array",
"of",
"bytes",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapEncoder.java#L276-L297 |
51,863 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java | AbstractFallbackRequestAndResponseControlDirContextProcessor.invokeMethod | protected Object invokeMethod(String method, Class<?> clazz, Object control) {
Method actualMethod = ReflectionUtils.findMethod(clazz, method);
return ReflectionUtils.invokeMethod(actualMethod, control);
} | java | protected Object invokeMethod(String method, Class<?> clazz, Object control) {
Method actualMethod = ReflectionUtils.findMethod(clazz, method);
return ReflectionUtils.invokeMethod(actualMethod, control);
} | [
"protected",
"Object",
"invokeMethod",
"(",
"String",
"method",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"Object",
"control",
")",
"{",
"Method",
"actualMethod",
"=",
"ReflectionUtils",
".",
"findMethod",
"(",
"clazz",
",",
"method",
")",
";",
"return",
... | Utility method for invoking a method on a Control.
@param method name of method to invoke
@param clazz Class of the object that the method should be invoked on
@param control Instance that the method should be invoked on
@return the invocation result, if any | [
"Utility",
"method",
"for",
"invoking",
"a",
"method",
"on",
"a",
"Control",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java#L147-L150 |
51,864 | spring-projects/spring-ldap | samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/service/UserService.java | UserService.findAllMembers | public Set<User> findAllMembers(Iterable<Name> absoluteIds) {
return Sets.newLinkedHashSet(userRepo.findAll(toRelativeIds(absoluteIds)));
} | java | public Set<User> findAllMembers(Iterable<Name> absoluteIds) {
return Sets.newLinkedHashSet(userRepo.findAll(toRelativeIds(absoluteIds)));
} | [
"public",
"Set",
"<",
"User",
">",
"findAllMembers",
"(",
"Iterable",
"<",
"Name",
">",
"absoluteIds",
")",
"{",
"return",
"Sets",
".",
"newLinkedHashSet",
"(",
"userRepo",
".",
"findAll",
"(",
"toRelativeIds",
"(",
"absoluteIds",
")",
")",
")",
";",
"}"
] | This method expects absolute DNs of group members. In order to find the actual users
the DNs need to have the base LDAP path removed.
@param absoluteIds
@return | [
"This",
"method",
"expects",
"absolute",
"DNs",
"of",
"group",
"members",
".",
"In",
"order",
"to",
"find",
"the",
"actual",
"users",
"the",
"DNs",
"need",
"to",
"have",
"the",
"base",
"LDAP",
"path",
"removed",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/service/UserService.java#L99-L101 |
51,865 | spring-projects/spring-ldap | samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/service/UserService.java | UserService.updateUserStandard | private User updateUserStandard(LdapName originalId, User existingUser) {
User savedUser = userRepo.save(existingUser);
if(!originalId.equals(savedUser.getId())) {
// The user has moved - we need to update group references.
LdapName oldMemberDn = toAbsoluteDn(originalId);
... | java | private User updateUserStandard(LdapName originalId, User existingUser) {
User savedUser = userRepo.save(existingUser);
if(!originalId.equals(savedUser.getId())) {
// The user has moved - we need to update group references.
LdapName oldMemberDn = toAbsoluteDn(originalId);
... | [
"private",
"User",
"updateUserStandard",
"(",
"LdapName",
"originalId",
",",
"User",
"existingUser",
")",
"{",
"User",
"savedUser",
"=",
"userRepo",
".",
"save",
"(",
"existingUser",
")",
";",
"if",
"(",
"!",
"originalId",
".",
"equals",
"(",
"savedUser",
".... | Update the user and - if its id changed - update all group references to the user.
@param originalId the original id of the user.
@param existingUser the user, populated with new data
@return the updated entry | [
"Update",
"the",
"user",
"and",
"-",
"if",
"its",
"id",
"changed",
"-",
"update",
"all",
"group",
"references",
"to",
"the",
"user",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/service/UserService.java#L141-L153 |
51,866 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/transaction/compensating/ModifyAttributesOperationRecorder.java | ModifyAttributesOperationRecorder.getCompensatingModificationItem | protected ModificationItem getCompensatingModificationItem(
Attributes originalAttributes, ModificationItem modificationItem) {
Attribute modificationAttribute = modificationItem.getAttribute();
Attribute originalAttribute = originalAttributes
.get(modificationAttribute.g... | java | protected ModificationItem getCompensatingModificationItem(
Attributes originalAttributes, ModificationItem modificationItem) {
Attribute modificationAttribute = modificationItem.getAttribute();
Attribute originalAttribute = originalAttributes
.get(modificationAttribute.g... | [
"protected",
"ModificationItem",
"getCompensatingModificationItem",
"(",
"Attributes",
"originalAttributes",
",",
"ModificationItem",
"modificationItem",
")",
"{",
"Attribute",
"modificationAttribute",
"=",
"modificationItem",
".",
"getAttribute",
"(",
")",
";",
"Attribute",
... | Get a ModificationItem to use for rollback of the supplied modification.
@param originalAttributes
All Attributes of the target DN that are affected of any of
the ModificationItems.
@param modificationItem
the ModificationItem to create a rollback item for.
@return A ModificationItem to use for rollback of the supplie... | [
"Get",
"a",
"ModificationItem",
"to",
"use",
"for",
"rollback",
"of",
"the",
"supplied",
"modification",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/transaction/compensating/ModifyAttributesOperationRecorder.java#L119-L163 |
51,867 | spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/ListComparator.java | ListComparator.compare | public int compare(Object o1, Object o2) {
List list1 = (List) o1;
List list2 = (List) o2;
for (int i = 0; i < list1.size(); i++) {
if (list2.size() > i) {
Comparable component1 = (Comparable) list1.get(i);
Comparable component2 = (Comparable) list2.get(i);
int componentsCompared = compone... | java | public int compare(Object o1, Object o2) {
List list1 = (List) o1;
List list2 = (List) o2;
for (int i = 0; i < list1.size(); i++) {
if (list2.size() > i) {
Comparable component1 = (Comparable) list1.get(i);
Comparable component2 = (Comparable) list2.get(i);
int componentsCompared = compone... | [
"public",
"int",
"compare",
"(",
"Object",
"o1",
",",
"Object",
"o2",
")",
"{",
"List",
"list1",
"=",
"(",
"List",
")",
"o1",
";",
"List",
"list2",
"=",
"(",
"List",
")",
"o2",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list1",
".... | Compare two lists of Comparable objects.
@param o1 the first object to be compared.
@param o2 the second object to be compared.
@throws ClassCastException if any of the lists contains an object that
is not Comparable. | [
"Compare",
"two",
"lists",
"of",
"Comparable",
"objects",
"."
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/ListComparator.java#L38-L66 |
51,868 | p6spy/p6spy | src/main/java/com/p6spy/engine/common/PreparedStatementInformation.java | PreparedStatementInformation.getSqlWithValues | @Override
public String getSqlWithValues() {
final StringBuilder sb = new StringBuilder();
final String statementQuery = getStatementQuery();
// iterate over the characters in the query replacing the parameter placeholders
// with the actual values
int currentParameter = 0;
for( int pos = 0; ... | java | @Override
public String getSqlWithValues() {
final StringBuilder sb = new StringBuilder();
final String statementQuery = getStatementQuery();
// iterate over the characters in the query replacing the parameter placeholders
// with the actual values
int currentParameter = 0;
for( int pos = 0; ... | [
"@",
"Override",
"public",
"String",
"getSqlWithValues",
"(",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"final",
"String",
"statementQuery",
"=",
"getStatementQuery",
"(",
")",
";",
"// iterate over the characters in the q... | Generates the query for the prepared statement with all parameter placeholders
replaced with the actual parameter values
@return the SQL | [
"Generates",
"the",
"query",
"for",
"the",
"prepared",
"statement",
"with",
"all",
"parameter",
"placeholders",
"replaced",
"with",
"the",
"actual",
"parameter",
"values"
] | c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2 | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/common/PreparedStatementInformation.java#L43-L64 |
51,869 | p6spy/p6spy | src/main/java/com/p6spy/engine/common/P6LogQuery.java | P6LogQuery.doLogElapsed | protected static void doLogElapsed(int connectionId, long timeElapsedNanos, Category category, String prepared, String sql, String url) {
doLog(connectionId, timeElapsedNanos, category, prepared, sql, url);
} | java | protected static void doLogElapsed(int connectionId, long timeElapsedNanos, Category category, String prepared, String sql, String url) {
doLog(connectionId, timeElapsedNanos, category, prepared, sql, url);
} | [
"protected",
"static",
"void",
"doLogElapsed",
"(",
"int",
"connectionId",
",",
"long",
"timeElapsedNanos",
",",
"Category",
"category",
",",
"String",
"prepared",
",",
"String",
"sql",
",",
"String",
"url",
")",
"{",
"doLog",
"(",
"connectionId",
",",
"timeEl... | this is an internal method called by logElapsed | [
"this",
"is",
"an",
"internal",
"method",
"called",
"by",
"logElapsed"
] | c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2 | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/common/P6LogQuery.java#L90-L92 |
51,870 | p6spy/p6spy | src/main/java/com/p6spy/engine/common/P6LogQuery.java | P6LogQuery.doLog | protected static void doLog(int connectionId, long elapsedNanos, Category category, String prepared, String sql, String url) {
// give it one more try if not initialized yet
if (logger == null) {
initialize();
if (logger == null) {
return;
}
}
final String format =... | java | protected static void doLog(int connectionId, long elapsedNanos, Category category, String prepared, String sql, String url) {
// give it one more try if not initialized yet
if (logger == null) {
initialize();
if (logger == null) {
return;
}
}
final String format =... | [
"protected",
"static",
"void",
"doLog",
"(",
"int",
"connectionId",
",",
"long",
"elapsedNanos",
",",
"Category",
"category",
",",
"String",
"prepared",
",",
"String",
"sql",
",",
"String",
"url",
")",
"{",
"// give it one more try if not initialized yet",
"if",
"... | Writes log information provided.
@param connectionId
@param elapsedNanos
@param category
@param prepared
@param sql
@param url | [
"Writes",
"log",
"information",
"provided",
"."
] | c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2 | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/common/P6LogQuery.java#L104-L140 |
51,871 | p6spy/p6spy | src/main/java/com/p6spy/engine/common/P6LogQuery.java | P6LogQuery.meetsThresholdRequirement | private static boolean meetsThresholdRequirement(long timeTaken) {
final P6LogLoadableOptions opts = P6LogOptions.getActiveInstance();
long executionThreshold = null != opts ? opts.getExecutionThreshold() : 0;
return executionThreshold <= 0 || TimeUnit.NANOSECONDS.toMillis(timeTaken) > executio... | java | private static boolean meetsThresholdRequirement(long timeTaken) {
final P6LogLoadableOptions opts = P6LogOptions.getActiveInstance();
long executionThreshold = null != opts ? opts.getExecutionThreshold() : 0;
return executionThreshold <= 0 || TimeUnit.NANOSECONDS.toMillis(timeTaken) > executio... | [
"private",
"static",
"boolean",
"meetsThresholdRequirement",
"(",
"long",
"timeTaken",
")",
"{",
"final",
"P6LogLoadableOptions",
"opts",
"=",
"P6LogOptions",
".",
"getActiveInstance",
"(",
")",
";",
"long",
"executionThreshold",
"=",
"null",
"!=",
"opts",
"?",
"o... | on whether on not it has taken greater than x amount of time. | [
"on",
"whether",
"on",
"not",
"it",
"has",
"taken",
"greater",
"than",
"x",
"amount",
"of",
"time",
"."
] | c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2 | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/common/P6LogQuery.java#L213-L218 |
51,872 | p6spy/p6spy | src/main/java/com/p6spy/engine/spy/P6DataSource.java | P6DataSource.bindDataSource | protected synchronized void bindDataSource() throws SQLException {
// we'll check in the synchronized section again (to prevent unnecessary reinitialization)
if (null != realDataSource) {
return;
}
final P6SpyLoadableOptions options = P6SpyOptions.getActiveInstance();
// can be set when obje... | java | protected synchronized void bindDataSource() throws SQLException {
// we'll check in the synchronized section again (to prevent unnecessary reinitialization)
if (null != realDataSource) {
return;
}
final P6SpyLoadableOptions options = P6SpyOptions.getActiveInstance();
// can be set when obje... | [
"protected",
"synchronized",
"void",
"bindDataSource",
"(",
")",
"throws",
"SQLException",
"{",
"// we'll check in the synchronized section again (to prevent unnecessary reinitialization)",
"if",
"(",
"null",
"!=",
"realDataSource",
")",
"{",
"return",
";",
"}",
"final",
"P... | Binds the JNDI DataSource to proxy.
@throws SQLException | [
"Binds",
"the",
"JNDI",
"DataSource",
"to",
"proxy",
"."
] | c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2 | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/spy/P6DataSource.java#L100-L158 |
51,873 | p6spy/p6spy | src/main/java/com/p6spy/engine/common/ResultSetInformation.java | ResultSetInformation.generateLogMessage | public void generateLogMessage() {
if (lastRowLogged != currRow) {
P6LogQuery.log(Category.RESULTSET, this);
resultMap.clear();
lastRowLogged = currRow;
}
} | java | public void generateLogMessage() {
if (lastRowLogged != currRow) {
P6LogQuery.log(Category.RESULTSET, this);
resultMap.clear();
lastRowLogged = currRow;
}
} | [
"public",
"void",
"generateLogMessage",
"(",
")",
"{",
"if",
"(",
"lastRowLogged",
"!=",
"currRow",
")",
"{",
"P6LogQuery",
".",
"log",
"(",
"Category",
".",
"RESULTSET",
",",
"this",
")",
";",
"resultMap",
".",
"clear",
"(",
")",
";",
"lastRowLogged",
"... | Generates log message with column values accessed if the row's column values have not already been logged. | [
"Generates",
"log",
"message",
"with",
"column",
"values",
"accessed",
"if",
"the",
"row",
"s",
"column",
"values",
"have",
"not",
"already",
"been",
"logged",
"."
] | c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2 | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/common/ResultSetInformation.java#L45-L51 |
51,874 | p6spy/p6spy | src/main/java/com/p6spy/engine/logging/P6LogOptions.java | P6LogOptions.setExclude | @Override
public void setExclude(String exclude) {
optionsRepository.setSet(String.class, EXCLUDE_LIST, exclude);
// setting effective string
optionsRepository.set(String.class, EXCLUDE, P6Util.joinNullSafe(optionsRepository.getSet(String.class, EXCLUDE_LIST), ","));
optionsRepository.setOrUnSet(Patte... | java | @Override
public void setExclude(String exclude) {
optionsRepository.setSet(String.class, EXCLUDE_LIST, exclude);
// setting effective string
optionsRepository.set(String.class, EXCLUDE, P6Util.joinNullSafe(optionsRepository.getSet(String.class, EXCLUDE_LIST), ","));
optionsRepository.setOrUnSet(Patte... | [
"@",
"Override",
"public",
"void",
"setExclude",
"(",
"String",
"exclude",
")",
"{",
"optionsRepository",
".",
"setSet",
"(",
"String",
".",
"class",
",",
"EXCLUDE_LIST",
",",
"exclude",
")",
";",
"// setting effective string",
"optionsRepository",
".",
"set",
"... | JMX exposed API | [
"JMX",
"exposed",
"API"
] | c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2 | https://github.com/p6spy/p6spy/blob/c3c0fecd6e26156eecf90a90901c3c1c8a7dbdf2/src/main/java/com/p6spy/engine/logging/P6LogOptions.java#L96-L102 |
51,875 | h2oai/h2o-2 | src/main/java/water/api/SetTimezone.java | SetTimezone.serve | @Override
protected Response serve() {
invoke();
String s = ParseTime.getTimezone().getID();
JsonObject response = new JsonObject();
response.addProperty("tz", s);
return Response.done(response);
} | java | @Override
protected Response serve() {
invoke();
String s = ParseTime.getTimezone().getID();
JsonObject response = new JsonObject();
response.addProperty("tz", s);
return Response.done(response);
} | [
"@",
"Override",
"protected",
"Response",
"serve",
"(",
")",
"{",
"invoke",
"(",
")",
";",
"String",
"s",
"=",
"ParseTime",
".",
"getTimezone",
"(",
")",
".",
"getID",
"(",
")",
";",
"JsonObject",
"response",
"=",
"new",
"JsonObject",
"(",
")",
";",
... | Reply value is the current setting | [
"Reply",
"value",
"is",
"the",
"current",
"setting"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/SetTimezone.java#L44-L52 |
51,876 | h2oai/h2o-2 | src/main/java/water/RPC.java | RPC.get | @Override public V get() {
// check priorities - FJ task can only block on a task with higher priority!
Thread cThr = Thread.currentThread();
int priority = (cThr instanceof FJWThr) ? ((FJWThr)cThr)._priority : -1;
// was hitting this (priority=1 but _dt.priority()=0 for DRemoteTask) - not clear who inc... | java | @Override public V get() {
// check priorities - FJ task can only block on a task with higher priority!
Thread cThr = Thread.currentThread();
int priority = (cThr instanceof FJWThr) ? ((FJWThr)cThr)._priority : -1;
// was hitting this (priority=1 but _dt.priority()=0 for DRemoteTask) - not clear who inc... | [
"@",
"Override",
"public",
"V",
"get",
"(",
")",
"{",
"// check priorities - FJ task can only block on a task with higher priority!",
"Thread",
"cThr",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"int",
"priority",
"=",
"(",
"cThr",
"instanceof",
"FJWThr",
"... | null for canceled tasks, including those where the target dies. | [
"null",
"for",
"canceled",
"tasks",
"including",
"those",
"where",
"the",
"target",
"dies",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/RPC.java#L227-L250 |
51,877 | h2oai/h2o-2 | src/main/java/water/RPC.java | RPC.response | protected int response( AutoBuffer ab ) {
assert _tasknum==ab.getTask();
if( _done ) return ab.close(); // Ignore duplicate response packet
int flag = ab.getFlag(); // Must read flag also, to advance ab
if( flag == SERVER_TCP_SEND ) return ab.close(); // Ignore UDP packet for a TCP reply
assert f... | java | protected int response( AutoBuffer ab ) {
assert _tasknum==ab.getTask();
if( _done ) return ab.close(); // Ignore duplicate response packet
int flag = ab.getFlag(); // Must read flag also, to advance ab
if( flag == SERVER_TCP_SEND ) return ab.close(); // Ignore UDP packet for a TCP reply
assert f... | [
"protected",
"int",
"response",
"(",
"AutoBuffer",
"ab",
")",
"{",
"assert",
"_tasknum",
"==",
"ab",
".",
"getTask",
"(",
")",
";",
"if",
"(",
"_done",
")",
"return",
"ab",
".",
"close",
"(",
")",
";",
"// Ignore duplicate response packet",
"int",
"flag",
... | Install it as The Answer packet and wake up anybody waiting on an answer. | [
"Install",
"it",
"as",
"The",
"Answer",
"packet",
"and",
"wake",
"up",
"anybody",
"waiting",
"on",
"an",
"answer",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/RPC.java#L544-L563 |
51,878 | h2oai/h2o-2 | src/main/java/hex/gbm/SharedTreeModelBuilder.java | ScoreBuildHistogram.accum_all | private void accum_all(Chunk chks[], Chunk wrks, int nnids[]) {
final DHistogram hcs[][] = _hcs;
// Sort the rows by NID, so we visit all the same NIDs in a row
// Find the count of unique NIDs in this chunk
int nh[] = new int[hcs.length+1];
for( int i : nnids ) if( i >= 0 ) nh[i+1]++;
... | java | private void accum_all(Chunk chks[], Chunk wrks, int nnids[]) {
final DHistogram hcs[][] = _hcs;
// Sort the rows by NID, so we visit all the same NIDs in a row
// Find the count of unique NIDs in this chunk
int nh[] = new int[hcs.length+1];
for( int i : nnids ) if( i >= 0 ) nh[i+1]++;
... | [
"private",
"void",
"accum_all",
"(",
"Chunk",
"chks",
"[",
"]",
",",
"Chunk",
"wrks",
",",
"int",
"nnids",
"[",
"]",
")",
"{",
"final",
"DHistogram",
"hcs",
"[",
"]",
"[",
"]",
"=",
"_hcs",
";",
"// Sort the rows by NID, so we visit all the same NIDs in a row"... | histograms once-per-NID, but requires pre-sorting the rows by NID. | [
"histograms",
"once",
"-",
"per",
"-",
"NID",
"but",
"requires",
"pre",
"-",
"sorting",
"the",
"rows",
"by",
"NID",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/SharedTreeModelBuilder.java#L546-L562 |
51,879 | h2oai/h2o-2 | src/main/java/hex/gbm/SharedTreeModelBuilder.java | ScoreBuildHistogram.accum_all2 | private void accum_all2(Chunk chks[], Chunk wrks, int nh[], int[] rows) {
final DHistogram hcs[][] = _hcs;
// Local temp arrays, no atomic updates.
int bins[] = new int [nbins];
double sums[] = new double[nbins];
double ssqs[] = new double[nbins];
// For All Columns
for( i... | java | private void accum_all2(Chunk chks[], Chunk wrks, int nh[], int[] rows) {
final DHistogram hcs[][] = _hcs;
// Local temp arrays, no atomic updates.
int bins[] = new int [nbins];
double sums[] = new double[nbins];
double ssqs[] = new double[nbins];
// For All Columns
for( i... | [
"private",
"void",
"accum_all2",
"(",
"Chunk",
"chks",
"[",
"]",
",",
"Chunk",
"wrks",
",",
"int",
"nh",
"[",
"]",
",",
"int",
"[",
"]",
"rows",
")",
"{",
"final",
"DHistogram",
"hcs",
"[",
"]",
"[",
"]",
"=",
"_hcs",
";",
"// Local temp arrays, no a... | For all columns, for all NIDs, for all ROWS... | [
"For",
"all",
"columns",
"for",
"all",
"NIDs",
"for",
"all",
"ROWS",
"..."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/SharedTreeModelBuilder.java#L565-L615 |
51,880 | h2oai/h2o-2 | src/main/java/water/api/StoreView.java | StoreView.setAndServe | public String setAndServe(String offset) {
_offset.reset(); _offset.check(null,offset);
_view .reset(); _view .check(null,"20");
_filter.reset();
return new Gson().toJson(serve()._response);
} | java | public String setAndServe(String offset) {
_offset.reset(); _offset.check(null,offset);
_view .reset(); _view .check(null,"20");
_filter.reset();
return new Gson().toJson(serve()._response);
} | [
"public",
"String",
"setAndServe",
"(",
"String",
"offset",
")",
"{",
"_offset",
".",
"reset",
"(",
")",
";",
"_offset",
".",
"check",
"(",
"null",
",",
"offset",
")",
";",
"_view",
".",
"reset",
"(",
")",
";",
"_view",
".",
"check",
"(",
"null",
"... | Used by tests | [
"Used",
"by",
"tests"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/StoreView.java#L73-L78 |
51,881 | h2oai/h2o-2 | src/main/java/water/Arguments.java | Arguments.addArgument | public int addArgument(String str, String next) {
int i = commandLineArgs.length;
int consumed = 1;
commandLineArgs = Arrays.copyOf(commandLineArgs, i + 1);
/*
* Flags have a null string as val and flag of true; Binding have non-empty
* name, a non-null val (possibly ""), and a flag of false; ... | java | public int addArgument(String str, String next) {
int i = commandLineArgs.length;
int consumed = 1;
commandLineArgs = Arrays.copyOf(commandLineArgs, i + 1);
/*
* Flags have a null string as val and flag of true; Binding have non-empty
* name, a non-null val (possibly ""), and a flag of false; ... | [
"public",
"int",
"addArgument",
"(",
"String",
"str",
",",
"String",
"next",
")",
"{",
"int",
"i",
"=",
"commandLineArgs",
".",
"length",
";",
"int",
"consumed",
"=",
"1",
";",
"commandLineArgs",
"=",
"Arrays",
".",
"copyOf",
"(",
"commandLineArgs",
",",
... | Add a new argument to this command line. The argument will be parsed and
add at the end of the list. Bindings have the following format
"-name=value" if value is empty, the binding is treated as an option.
Options have the form "-name". All other strings are treated as values.
@param str
a string | [
"Add",
"a",
"new",
"argument",
"to",
"this",
"command",
"line",
".",
"The",
"argument",
"will",
"be",
"parsed",
"and",
"add",
"at",
"the",
"end",
"of",
"the",
"list",
".",
"Bindings",
"have",
"the",
"following",
"format",
"-",
"name",
"=",
"value",
"if... | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Arguments.java#L133-L167 |
51,882 | h2oai/h2o-2 | src/main/java/water/Arguments.java | Arguments.extract | private int extract(Arg arg, Field[] fields) {
int count = 0;
for( Field field : fields ){
String name = field.getName();
Class cl = field.getType();
String opt = getValue(name); // optional value
try{
if( cl.isPrimitive() ){
if( cl == Boolean.TYPE ){
boolea... | java | private int extract(Arg arg, Field[] fields) {
int count = 0;
for( Field field : fields ){
String name = field.getName();
Class cl = field.getType();
String opt = getValue(name); // optional value
try{
if( cl.isPrimitive() ){
if( cl == Boolean.TYPE ){
boolea... | [
"private",
"int",
"extract",
"(",
"Arg",
"arg",
",",
"Field",
"[",
"]",
"fields",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Field",
"field",
":",
"fields",
")",
"{",
"String",
"name",
"=",
"field",
".",
"getName",
"(",
")",
";",
"Clas... | Extracts bindings and options; and sets appropriate fields in the
CommandLineArgument object. | [
"Extracts",
"bindings",
"and",
"options",
";",
"and",
"sets",
"appropriate",
"fields",
"in",
"the",
"CommandLineArgument",
"object",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Arguments.java#L181-L215 |
51,883 | h2oai/h2o-2 | src/main/java/water/Arguments.java | Arguments.parse | private void parse(String[] s) {
commandLineArgs = new Entry[0];
for( int i = 0; i < s.length; ) {
String next = (i+1<s.length)? s[i+1]: null;
i += addArgument(s[i],next);
}
} | java | private void parse(String[] s) {
commandLineArgs = new Entry[0];
for( int i = 0; i < s.length; ) {
String next = (i+1<s.length)? s[i+1]: null;
i += addArgument(s[i],next);
}
} | [
"private",
"void",
"parse",
"(",
"String",
"[",
"]",
"s",
")",
"{",
"commandLineArgs",
"=",
"new",
"Entry",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
";",
")",
"{",
"String",
"next",
"=",
"(",
"i... | Parse the command line arguments and extracts options. The current
implementation allows the same command line instance to parse several
argument lists, the results will be merged.
@param s the array of arguments to be parsed | [
"Parse",
"the",
"command",
"line",
"arguments",
"and",
"extracts",
"options",
".",
"The",
"current",
"implementation",
"allows",
"the",
"same",
"command",
"line",
"instance",
"to",
"parse",
"several",
"argument",
"lists",
"the",
"results",
"will",
"be",
"merged"... | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Arguments.java#L238-L244 |
51,884 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.progress | public float progress() {
Freezable f = UKV.get(destination_key);
if( f instanceof Progress )
return ((Progress) f).progress();
return 0;
} | java | public float progress() {
Freezable f = UKV.get(destination_key);
if( f instanceof Progress )
return ((Progress) f).progress();
return 0;
} | [
"public",
"float",
"progress",
"(",
")",
"{",
"Freezable",
"f",
"=",
"UKV",
".",
"get",
"(",
"destination_key",
")",
";",
"if",
"(",
"f",
"instanceof",
"Progress",
")",
"return",
"(",
"(",
"Progress",
")",
"f",
")",
".",
"progress",
"(",
")",
";",
... | Return progress of this job.
@return the value in interval <0,1> representing job progress. | [
"Return",
"progress",
"of",
"this",
"job",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L130-L135 |
51,885 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.all | public static Job[] all() {
List list = UKV.get(LIST);
Job[] jobs = new Job[list==null?0:list._jobs.length];
int j=0;
for( int i=0; i<jobs.length; i++ ) {
Job job = UKV.get(list._jobs[i]);
if( job != null ) jobs[j++] = job;
}
if( j<jobs.length ) jobs = Arrays.copyOf(jobs,j);
retu... | java | public static Job[] all() {
List list = UKV.get(LIST);
Job[] jobs = new Job[list==null?0:list._jobs.length];
int j=0;
for( int i=0; i<jobs.length; i++ ) {
Job job = UKV.get(list._jobs[i]);
if( job != null ) jobs[j++] = job;
}
if( j<jobs.length ) jobs = Arrays.copyOf(jobs,j);
retu... | [
"public",
"static",
"Job",
"[",
"]",
"all",
"(",
")",
"{",
"List",
"list",
"=",
"UKV",
".",
"get",
"(",
"LIST",
")",
";",
"Job",
"[",
"]",
"jobs",
"=",
"new",
"Job",
"[",
"list",
"==",
"null",
"?",
"0",
":",
"list",
".",
"_jobs",
".",
"length... | Returns a list of all jobs in a system.
@return list of all jobs including running, done, cancelled, crashed jobs. | [
"Returns",
"a",
"list",
"of",
"all",
"jobs",
"in",
"a",
"system",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L238-L248 |
51,886 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.isRunning | public static boolean isRunning(Key job_key) {
Job j = UKV.get(job_key);
assert j!=null : "Job should be always in DKV!";
return j.isRunning();
} | java | public static boolean isRunning(Key job_key) {
Job j = UKV.get(job_key);
assert j!=null : "Job should be always in DKV!";
return j.isRunning();
} | [
"public",
"static",
"boolean",
"isRunning",
"(",
"Key",
"job_key",
")",
"{",
"Job",
"j",
"=",
"UKV",
".",
"get",
"(",
"job_key",
")",
";",
"assert",
"j",
"!=",
"null",
":",
"\"Job should be always in DKV!\"",
";",
"return",
"j",
".",
"isRunning",
"(",
")... | Check if given job is running.
@param job_key job key
@return true if job is still running else returns false. | [
"Check",
"if",
"given",
"job",
"is",
"running",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L254-L258 |
51,887 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.remove | public void remove() {
end_time = System.currentTimeMillis();
if( state == JobState.RUNNING )
state = JobState.DONE;
// Overwrite handle - copy end_time, state, msg
replaceByJobHandle();
} | java | public void remove() {
end_time = System.currentTimeMillis();
if( state == JobState.RUNNING )
state = JobState.DONE;
// Overwrite handle - copy end_time, state, msg
replaceByJobHandle();
} | [
"public",
"void",
"remove",
"(",
")",
"{",
"end_time",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"state",
"==",
"JobState",
".",
"RUNNING",
")",
"state",
"=",
"JobState",
".",
"DONE",
";",
"// Overwrite handle - copy end_time, state, m... | Marks job as finished and records job end time. | [
"Marks",
"job",
"as",
"finished",
"and",
"records",
"job",
"end",
"time",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L271-L277 |
51,888 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.findJobByDest | public static Job findJobByDest(final Key destKey) {
Job job = null;
for( Job current : Job.all() ) {
if( current.dest().equals(destKey) ) {
job = current;
break;
}
}
return job;
} | java | public static Job findJobByDest(final Key destKey) {
Job job = null;
for( Job current : Job.all() ) {
if( current.dest().equals(destKey) ) {
job = current;
break;
}
}
return job;
} | [
"public",
"static",
"Job",
"findJobByDest",
"(",
"final",
"Key",
"destKey",
")",
"{",
"Job",
"job",
"=",
"null",
";",
"for",
"(",
"Job",
"current",
":",
"Job",
".",
"all",
"(",
")",
")",
"{",
"if",
"(",
"current",
".",
"dest",
"(",
")",
".",
"equ... | Finds a job with given dest key or returns null | [
"Finds",
"a",
"job",
"with",
"given",
"dest",
"key",
"or",
"returns",
"null"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L287-L296 |
51,889 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.fork | public Job fork() {
init();
H2OCountedCompleter task = new H2OCountedCompleter() {
@Override public void compute2() {
try {
try {
// Exec always waits till the end of computation
Job.this.exec();
Job.this.remove();
} catch (Throwable t) {
... | java | public Job fork() {
init();
H2OCountedCompleter task = new H2OCountedCompleter() {
@Override public void compute2() {
try {
try {
// Exec always waits till the end of computation
Job.this.exec();
Job.this.remove();
} catch (Throwable t) {
... | [
"public",
"Job",
"fork",
"(",
")",
"{",
"init",
"(",
")",
";",
"H2OCountedCompleter",
"task",
"=",
"new",
"H2OCountedCompleter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"compute2",
"(",
")",
"{",
"try",
"{",
"try",
"{",
"// Exec always waits till... | Forks computation of this job.
<p>The call does not block.</p>
@return always returns this job. | [
"Forks",
"computation",
"of",
"this",
"job",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L327-L349 |
51,890 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.waitUntilJobEnded | public static void waitUntilJobEnded(Key jobkey, int pollingIntervalMillis) {
while (true) {
if (Job.isEnded(jobkey)) {
return;
}
try { Thread.sleep (pollingIntervalMillis); } catch (Exception ignore) {}
}
} | java | public static void waitUntilJobEnded(Key jobkey, int pollingIntervalMillis) {
while (true) {
if (Job.isEnded(jobkey)) {
return;
}
try { Thread.sleep (pollingIntervalMillis); } catch (Exception ignore) {}
}
} | [
"public",
"static",
"void",
"waitUntilJobEnded",
"(",
"Key",
"jobkey",
",",
"int",
"pollingIntervalMillis",
")",
"{",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"Job",
".",
"isEnded",
"(",
"jobkey",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"Threa... | Block synchronously waiting for a job to end, success or not.
@param jobkey Job to wait for.
@param pollingIntervalMillis Polling interval sleep time. | [
"Block",
"synchronously",
"waiting",
"for",
"a",
"job",
"to",
"end",
"success",
"or",
"not",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L374-L382 |
51,891 | h2oai/h2o-2 | src/main/java/water/Job.java | Job.hygiene | public static <T extends FrameJob> T hygiene(T job) {
job.source = null;
return job;
} | java | public static <T extends FrameJob> T hygiene(T job) {
job.source = null;
return job;
} | [
"public",
"static",
"<",
"T",
"extends",
"FrameJob",
">",
"T",
"hygiene",
"(",
"T",
"job",
")",
"{",
"job",
".",
"source",
"=",
"null",
";",
"return",
"job",
";",
"}"
] | Hygienic method to prevent accidental capture of non desired values. | [
"Hygienic",
"method",
"to",
"prevent",
"accidental",
"capture",
"of",
"non",
"desired",
"values",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Job.java#L1073-L1076 |
51,892 | h2oai/h2o-2 | src/main/java/hex/singlenoderf/EntropyStatistic.java | EntropyStatistic.ltSplit | @Override protected Split ltSplit(int col, Data d, int[] dist, int distWeight, Random rand) {
final int[] distL = new int[d.classes()], distR = dist.clone();
final double upperBoundReduction = upperBoundReduction(d.classes());
double maxReduction = -1;
int bestSplit = -1;
int totL = 0, totR = 0; ... | java | @Override protected Split ltSplit(int col, Data d, int[] dist, int distWeight, Random rand) {
final int[] distL = new int[d.classes()], distR = dist.clone();
final double upperBoundReduction = upperBoundReduction(d.classes());
double maxReduction = -1;
int bestSplit = -1;
int totL = 0, totR = 0; ... | [
"@",
"Override",
"protected",
"Split",
"ltSplit",
"(",
"int",
"col",
",",
"Data",
"d",
",",
"int",
"[",
"]",
"dist",
",",
"int",
"distWeight",
",",
"Random",
"rand",
")",
"{",
"final",
"int",
"[",
"]",
"distL",
"=",
"new",
"int",
"[",
"d",
".",
"... | LessThenEqual splits s | [
"LessThenEqual",
"splits",
"s"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/singlenoderf/EntropyStatistic.java#L31-L77 |
51,893 | h2oai/h2o-2 | src/main/java/water/util/UserSpecifiedNetwork.java | UserSpecifiedNetwork.inetAddressOnNetwork | public boolean inetAddressOnNetwork(InetAddress ia) {
int i = (_o1 << 24) |
(_o2 << 16) |
(_o3 << 8) |
(_o4 << 0);
byte[] barr = ia.getAddress();
if (barr.length != 4) {
return false;
}
int j = (((int)barr[0] & 0xff) << 24) |
(((int)barr[1] & 0... | java | public boolean inetAddressOnNetwork(InetAddress ia) {
int i = (_o1 << 24) |
(_o2 << 16) |
(_o3 << 8) |
(_o4 << 0);
byte[] barr = ia.getAddress();
if (barr.length != 4) {
return false;
}
int j = (((int)barr[0] & 0xff) << 24) |
(((int)barr[1] & 0... | [
"public",
"boolean",
"inetAddressOnNetwork",
"(",
"InetAddress",
"ia",
")",
"{",
"int",
"i",
"=",
"(",
"_o1",
"<<",
"24",
")",
"|",
"(",
"_o2",
"<<",
"16",
")",
"|",
"(",
"_o3",
"<<",
"8",
")",
"|",
"(",
"_o4",
"<<",
"0",
")",
";",
"byte",
"[",... | Test if an internet address lives on this user specified network.
@param ia Address to test.
@return true if the address is on the network; false otherwise. | [
"Test",
"if",
"an",
"internet",
"address",
"lives",
"on",
"this",
"user",
"specified",
"network",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/util/UserSpecifiedNetwork.java#L55-L82 |
51,894 | h2oai/h2o-2 | src/main/java/water/Lockable.java | Lockable.write_lock | public Lockable write_lock( Key job_key ) {
Log.debug(Log.Tag.Sys.LOCKS,"write-lock "+_key+" by job "+job_key);
return ((PriorWriteLock)new PriorWriteLock(job_key).invoke(_key))._old;
} | java | public Lockable write_lock( Key job_key ) {
Log.debug(Log.Tag.Sys.LOCKS,"write-lock "+_key+" by job "+job_key);
return ((PriorWriteLock)new PriorWriteLock(job_key).invoke(_key))._old;
} | [
"public",
"Lockable",
"write_lock",
"(",
"Key",
"job_key",
")",
"{",
"Log",
".",
"debug",
"(",
"Log",
".",
"Tag",
".",
"Sys",
".",
"LOCKS",
",",
"\"write-lock \"",
"+",
"_key",
"+",
"\" by job \"",
"+",
"job_key",
")",
";",
"return",
"(",
"(",
"PriorWr... | Write-lock 'this', returns OLD guy | [
"Write",
"-",
"lock",
"this",
"returns",
"OLD",
"guy"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Lockable.java#L58-L61 |
51,895 | h2oai/h2o-2 | src/main/java/water/Lockable.java | Lockable.delete_and_lock | public T delete_and_lock( Key job_key ) {
Lockable old = write_lock(job_key);
if( old != null ) {
Log.debug(Log.Tag.Sys.LOCKS,"lock-then-clear "+_key+" by job "+job_key);
old.delete_impl(new Futures()).blockForPending();
}
return (T)this;
} | java | public T delete_and_lock( Key job_key ) {
Lockable old = write_lock(job_key);
if( old != null ) {
Log.debug(Log.Tag.Sys.LOCKS,"lock-then-clear "+_key+" by job "+job_key);
old.delete_impl(new Futures()).blockForPending();
}
return (T)this;
} | [
"public",
"T",
"delete_and_lock",
"(",
"Key",
"job_key",
")",
"{",
"Lockable",
"old",
"=",
"write_lock",
"(",
"job_key",
")",
";",
"if",
"(",
"old",
"!=",
"null",
")",
"{",
"Log",
".",
"debug",
"(",
"Log",
".",
"Tag",
".",
"Sys",
".",
"LOCKS",
",",... | Write-lock 'this', delete any old thing, returns NEW guy | [
"Write",
"-",
"lock",
"this",
"delete",
"any",
"old",
"thing",
"returns",
"NEW",
"guy"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Lockable.java#L63-L70 |
51,896 | h2oai/h2o-2 | src/main/java/water/Lockable.java | Lockable.delete | public static void delete( Key k, Key job_key ) {
if( k == null ) return;
Value val = DKV.get(k);
if( val == null ) return; // Or just nothing there to delete
if( !val.isLockable() ) UKV.remove(k); // Simple things being deleted
else ((Lockable)val.get()).delete(job_key,0.0f); // Lockab... | java | public static void delete( Key k, Key job_key ) {
if( k == null ) return;
Value val = DKV.get(k);
if( val == null ) return; // Or just nothing there to delete
if( !val.isLockable() ) UKV.remove(k); // Simple things being deleted
else ((Lockable)val.get()).delete(job_key,0.0f); // Lockab... | [
"public",
"static",
"void",
"delete",
"(",
"Key",
"k",
",",
"Key",
"job_key",
")",
"{",
"if",
"(",
"k",
"==",
"null",
")",
"return",
";",
"Value",
"val",
"=",
"DKV",
".",
"get",
"(",
"k",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"return",... | Write-lock & delete 'k'. Will fail if 'k' is locked by anybody other than 'job_key' | [
"Write",
"-",
"lock",
"&",
"delete",
"k",
".",
"Will",
"fail",
"if",
"k",
"is",
"locked",
"by",
"anybody",
"other",
"than",
"job_key"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Lockable.java#L100-L106 |
51,897 | h2oai/h2o-2 | src/main/java/water/Lockable.java | Lockable.delete | public void delete( Key job_key, float dummy ) {
if( _key != null ) {
Log.debug(Log.Tag.Sys.LOCKS,"lock-then-delete "+_key+" by job "+job_key);
new PriorWriteLock(job_key).invoke(_key);
}
Futures fs = new Futures();
delete_impl(fs);
if( _key != null ) DKV.remove(_key,fs); // Delete self... | java | public void delete( Key job_key, float dummy ) {
if( _key != null ) {
Log.debug(Log.Tag.Sys.LOCKS,"lock-then-delete "+_key+" by job "+job_key);
new PriorWriteLock(job_key).invoke(_key);
}
Futures fs = new Futures();
delete_impl(fs);
if( _key != null ) DKV.remove(_key,fs); // Delete self... | [
"public",
"void",
"delete",
"(",
"Key",
"job_key",
",",
"float",
"dummy",
")",
"{",
"if",
"(",
"_key",
"!=",
"null",
")",
"{",
"Log",
".",
"debug",
"(",
"Log",
".",
"Tag",
".",
"Sys",
".",
"LOCKS",
",",
"\"lock-then-delete \"",
"+",
"_key",
"+",
"\... | Will fail if locked by anybody other than 'job_key' | [
"Will",
"fail",
"if",
"locked",
"by",
"anybody",
"other",
"than",
"job_key"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Lockable.java#L110-L119 |
51,898 | h2oai/h2o-2 | src/main/java/water/Lockable.java | Lockable.update | public void update( Key job_key ) {
Log.debug(Log.Tag.Sys.LOCKS,"update write-locked "+_key+" by job "+job_key);
new Update(job_key).invoke(_key);
} | java | public void update( Key job_key ) {
Log.debug(Log.Tag.Sys.LOCKS,"update write-locked "+_key+" by job "+job_key);
new Update(job_key).invoke(_key);
} | [
"public",
"void",
"update",
"(",
"Key",
"job_key",
")",
"{",
"Log",
".",
"debug",
"(",
"Log",
".",
"Tag",
".",
"Sys",
".",
"LOCKS",
",",
"\"update write-locked \"",
"+",
"_key",
"+",
"\" by job \"",
"+",
"job_key",
")",
";",
"new",
"Update",
"(",
"job_... | Atomically set a new version of self | [
"Atomically",
"set",
"a",
"new",
"version",
"of",
"self"
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Lockable.java#L150-L153 |
51,899 | h2oai/h2o-2 | src/main/java/water/Lockable.java | Lockable.unlock | public void unlock( Key job_key ) {
if( _key != null ) {
Log.debug(Log.Tag.Sys.LOCKS,"unlock "+_key+" by job "+job_key);
new Unlock(job_key).invoke(_key);
}
} | java | public void unlock( Key job_key ) {
if( _key != null ) {
Log.debug(Log.Tag.Sys.LOCKS,"unlock "+_key+" by job "+job_key);
new Unlock(job_key).invoke(_key);
}
} | [
"public",
"void",
"unlock",
"(",
"Key",
"job_key",
")",
"{",
"if",
"(",
"_key",
"!=",
"null",
")",
"{",
"Log",
".",
"debug",
"(",
"Log",
".",
"Tag",
".",
"Sys",
".",
"LOCKS",
",",
"\"unlock \"",
"+",
"_key",
"+",
"\" by job \"",
"+",
"job_key",
")"... | Atomically set a new version of self & unlock. | [
"Atomically",
"set",
"a",
"new",
"version",
"of",
"self",
"&",
"unlock",
"."
] | be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1 | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Lockable.java#L173-L178 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.