repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java | UserProfileHandlerImpl.postDelete | private void postDelete(UserProfile userProfile) throws Exception
{
for (UserProfileEventListener listener : listeners)
{
listener.postDelete(userProfile);
}
} | java | private void postDelete(UserProfile userProfile) throws Exception
{
for (UserProfileEventListener listener : listeners)
{
listener.postDelete(userProfile);
}
} | [
"private",
"void",
"postDelete",
"(",
"UserProfile",
"userProfile",
")",
"throws",
"Exception",
"{",
"for",
"(",
"UserProfileEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"postDelete",
"(",
"userProfile",
")",
";",
"}",
"}"
] | Notifying listeners after profile deletion.
@param userProfile
the user profile which is used in delete operation
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"after",
"profile",
"deletion",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java#L459-L465 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.addScripts | protected void addScripts()
{
if (loadPlugins == null || loadPlugins.size() == 0)
{
return;
}
for (GroovyScript2RestLoaderPlugin loadPlugin : loadPlugins)
{
// If no one script configured then skip this item,
// there is no reason to do anything.
if (... | java | protected void addScripts()
{
if (loadPlugins == null || loadPlugins.size() == 0)
{
return;
}
for (GroovyScript2RestLoaderPlugin loadPlugin : loadPlugins)
{
// If no one script configured then skip this item,
// there is no reason to do anything.
if (... | [
"protected",
"void",
"addScripts",
"(",
")",
"{",
"if",
"(",
"loadPlugins",
"==",
"null",
"||",
"loadPlugins",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"for",
"(",
"GroovyScript2RestLoaderPlugin",
"loadPlugin",
":",
"loadPlugins",
")... | Add scripts that specified in configuration. | [
"Add",
"scripts",
"that",
"specified",
"in",
"configuration",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L457-L527 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.createScript | protected Node createScript(Node parent, String name, boolean autoload, InputStream stream) throws Exception
{
Node scriptFile = parent.addNode(name, "nt:file");
Node script = scriptFile.addNode("jcr:content", getNodeType());
script.setProperty("exo:autoload", autoload);
script.setProperty("j... | java | protected Node createScript(Node parent, String name, boolean autoload, InputStream stream) throws Exception
{
Node scriptFile = parent.addNode(name, "nt:file");
Node script = scriptFile.addNode("jcr:content", getNodeType());
script.setProperty("exo:autoload", autoload);
script.setProperty("j... | [
"protected",
"Node",
"createScript",
"(",
"Node",
"parent",
",",
"String",
"name",
",",
"boolean",
"autoload",
",",
"InputStream",
"stream",
")",
"throws",
"Exception",
"{",
"Node",
"scriptFile",
"=",
"parent",
".",
"addNode",
"(",
"name",
",",
"\"nt:file\"",
... | Create JCR node.
@param parent parent node
@param name name of node to be created
@param stream data stream for property jcr:data
@return newly created node
@throws Exception if any errors occurs | [
"Create",
"JCR",
"node",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L538-L547 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.setAttributeSmart | protected void setAttributeSmart(Element element, String attr, String value)
{
if (value == null)
{
element.removeAttribute(attr);
}
else
{
element.setAttribute(attr, value);
}
} | java | protected void setAttributeSmart(Element element, String attr, String value)
{
if (value == null)
{
element.removeAttribute(attr);
}
else
{
element.setAttribute(attr, value);
}
} | [
"protected",
"void",
"setAttributeSmart",
"(",
"Element",
"element",
",",
"String",
"attr",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"element",
".",
"removeAttribute",
"(",
"attr",
")",
";",
"}",
"else",
"{",
"element... | Set attribute value. If value is null the attribute will be removed.
@param element The element to set attribute value
@param attr The attribute name
@param value The value of attribute | [
"Set",
"attribute",
"value",
".",
"If",
"value",
"is",
"null",
"the",
"attribute",
"will",
"be",
"removed",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L681-L691 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.load | @POST
@Path("load/{repository}/{workspace}/{path:.*}")
@RolesAllowed({"administrators"})
public Response load(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path, @DefaultValue("true") @QueryParam("state") boolean state,
@QueryParam("... | java | @POST
@Path("load/{repository}/{workspace}/{path:.*}")
@RolesAllowed({"administrators"})
public Response load(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path, @DefaultValue("true") @QueryParam("state") boolean state,
@QueryParam("... | [
"@",
"POST",
"@",
"Path",
"(",
"\"load/{repository}/{workspace}/{path:.*}\"",
")",
"@",
"RolesAllowed",
"(",
"{",
"\"administrators\"",
"}",
")",
"public",
"Response",
"load",
"(",
"@",
"PathParam",
"(",
"\"repository\"",
")",
"String",
"repository",
",",
"@",
"... | Deploy groovy script as REST service. If this property set to 'true' then
script will be deployed as REST service if 'false' the script will be
undeployed. NOTE is script already deployed and state is
true script will be re-deployed.
@param repository repository name
@param workspace workspace name
@param path the pat... | [
"Deploy",
"groovy",
"script",
"as",
"REST",
"service",
".",
"If",
"this",
"property",
"set",
"to",
"true",
"then",
"script",
"will",
"be",
"deployed",
"as",
"REST",
"service",
"if",
"false",
"the",
"script",
"will",
"be",
"undeployed",
".",
"NOTE",
"is",
... | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L1143-L1161 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.deleteScript | @POST
@Path("delete/{repository}/{workspace}/{path:.*}")
public Response deleteScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path)
{
Session ses = null;
try
{
ses =
sessionProviderService.getSe... | java | @POST
@Path("delete/{repository}/{workspace}/{path:.*}")
public Response deleteScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path)
{
Session ses = null;
try
{
ses =
sessionProviderService.getSe... | [
"@",
"POST",
"@",
"Path",
"(",
"\"delete/{repository}/{workspace}/{path:.*}\"",
")",
"public",
"Response",
"deleteScript",
"(",
"@",
"PathParam",
"(",
"\"repository\"",
")",
"String",
"repository",
",",
"@",
"PathParam",
"(",
"\"workspace\"",
")",
"String",
"workspa... | Remove node that contains groovy script.
@param repository repository name
@param workspace workspace name
@param path JCR path to node that contains script
@LevelAPI Provisional | [
"Remove",
"node",
"that",
"contains",
"groovy",
"script",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L1260-L1294 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.getScript | @POST
@Produces({"script/groovy"})
@Path("src/{repository}/{workspace}/{path:.*}")
public Response getScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path)
{
Session ses = null;
try
{
ses =
se... | java | @POST
@Produces({"script/groovy"})
@Path("src/{repository}/{workspace}/{path:.*}")
public Response getScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path)
{
Session ses = null;
try
{
ses =
se... | [
"@",
"POST",
"@",
"Produces",
"(",
"{",
"\"script/groovy\"",
"}",
")",
"@",
"Path",
"(",
"\"src/{repository}/{workspace}/{path:.*}\"",
")",
"public",
"Response",
"getScript",
"(",
"@",
"PathParam",
"(",
"\"repository\"",
")",
"String",
"repository",
",",
"@",
"P... | Get source code of groovy script.
@param repository repository name
@param workspace workspace name
@param path JCR path to node that contains script
@return groovy script as stream
@response
{code}
"scriptsource" : the source code of groovy script.
{code}
@LevelAPI Provisional | [
"Get",
"source",
"code",
"of",
"groovy",
"script",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L1360-L1395 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.getScriptMetadata | @POST
@Produces({MediaType.APPLICATION_JSON})
@Path("meta/{repository}/{workspace}/{path:.*}")
public Response getScriptMetadata(@PathParam("repository") String repository,
@PathParam("workspace") String workspace, @PathParam("path") String path)
{
Session ses = null;
try
{
... | java | @POST
@Produces({MediaType.APPLICATION_JSON})
@Path("meta/{repository}/{workspace}/{path:.*}")
public Response getScriptMetadata(@PathParam("repository") String repository,
@PathParam("workspace") String workspace, @PathParam("path") String path)
{
Session ses = null;
try
{
... | [
"@",
"POST",
"@",
"Produces",
"(",
"{",
"MediaType",
".",
"APPLICATION_JSON",
"}",
")",
"@",
"Path",
"(",
"\"meta/{repository}/{workspace}/{path:.*}\"",
")",
"public",
"Response",
"getScriptMetadata",
"(",
"@",
"PathParam",
"(",
"\"repository\"",
")",
"String",
"r... | Get groovy script's meta-information.
@param repository repository name
@param workspace workspace name
@param path JCR path to node that contains script
@return groovy script's meta-information
@response
{code:json}
"scriptList" : the groovy script's meta-information
{code}
@LevelAPI Provisional | [
"Get",
"groovy",
"script",
"s",
"meta",
"-",
"information",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L1410-L1450 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.list | @POST
@Produces(MediaType.APPLICATION_JSON)
@Path("list/{repository}/{workspace}")
public Response list(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@QueryParam("name") String name)
{
Session ses = null;
try
{
ses =
sessio... | java | @POST
@Produces(MediaType.APPLICATION_JSON)
@Path("list/{repository}/{workspace}")
public Response list(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@QueryParam("name") String name)
{
Session ses = null;
try
{
ses =
sessio... | [
"@",
"POST",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"list/{repository}/{workspace}\"",
")",
"public",
"Response",
"list",
"(",
"@",
"PathParam",
"(",
"\"repository\"",
")",
"String",
"repository",
",",
"@",
"PathPara... | Returns the list of all groovy-scripts found in workspace.
@param repository repository name
@param workspace workspace name
@param name additional search parameter. If not empty method returns the
list of script names matching wildcard else returns all the
scripts found in workspace.
@return list of groovy services
@... | [
"Returns",
"the",
"list",
"of",
"all",
"groovy",
"-",
"scripts",
"found",
"in",
"workspace",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L1467-L1546 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.getPath | protected static String getPath(String fullPath)
{
int sl = fullPath.lastIndexOf('/');
return sl > 0 ? "/" + fullPath.substring(0, sl) : "/";
} | java | protected static String getPath(String fullPath)
{
int sl = fullPath.lastIndexOf('/');
return sl > 0 ? "/" + fullPath.substring(0, sl) : "/";
} | [
"protected",
"static",
"String",
"getPath",
"(",
"String",
"fullPath",
")",
"{",
"int",
"sl",
"=",
"fullPath",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"sl",
">",
"0",
"?",
"\"/\"",
"+",
"fullPath",
".",
"substring",
"(",
"0",
",",
"sl"... | Extract path to node's parent from full path.
@param fullPath full path to node
@return node's parent path | [
"Extract",
"path",
"to",
"node",
"s",
"parent",
"from",
"full",
"path",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L1622-L1626 | train |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.getName | protected static String getName(String fullPath)
{
int sl = fullPath.lastIndexOf('/');
return sl >= 0 ? fullPath.substring(sl + 1) : fullPath;
} | java | protected static String getName(String fullPath)
{
int sl = fullPath.lastIndexOf('/');
return sl >= 0 ? fullPath.substring(sl + 1) : fullPath;
} | [
"protected",
"static",
"String",
"getName",
"(",
"String",
"fullPath",
")",
"{",
"int",
"sl",
"=",
"fullPath",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"sl",
">=",
"0",
"?",
"fullPath",
".",
"substring",
"(",
"sl",
"+",
"1",
")",
":",
... | Extract node's name from full node path.
@param fullPath full path to node
@return node's name | [
"Extract",
"node",
"s",
"name",
"from",
"full",
"node",
"path",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L1634-L1638 | train |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/HierarchicalProperty.java | HierarchicalProperty.getChild | public HierarchicalProperty getChild(QName name)
{
for (HierarchicalProperty child : children)
{
if (child.getName().equals(name))
return child;
}
return null;
} | java | public HierarchicalProperty getChild(QName name)
{
for (HierarchicalProperty child : children)
{
if (child.getName().equals(name))
return child;
}
return null;
} | [
"public",
"HierarchicalProperty",
"getChild",
"(",
"QName",
"name",
")",
"{",
"for",
"(",
"HierarchicalProperty",
"child",
":",
"children",
")",
"{",
"if",
"(",
"child",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"name",
")",
")",
"return",
"child",
"... | retrieves children property by name.
@param name child name
@return property or null if not found | [
"retrieves",
"children",
"property",
"by",
"name",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/HierarchicalProperty.java#L150-L158 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.md5 | public static String md5(String data, String enc) throws UnsupportedEncodingException
{
try
{
return digest("MD5", data.getBytes(enc));
}
catch (NoSuchAlgorithmException e)
{
throw new InternalError("MD5 digest not available???");
}
} | java | public static String md5(String data, String enc) throws UnsupportedEncodingException
{
try
{
return digest("MD5", data.getBytes(enc));
}
catch (NoSuchAlgorithmException e)
{
throw new InternalError("MD5 digest not available???");
}
} | [
"public",
"static",
"String",
"md5",
"(",
"String",
"data",
",",
"String",
"enc",
")",
"throws",
"UnsupportedEncodingException",
"{",
"try",
"{",
"return",
"digest",
"(",
"\"MD5\"",
",",
"data",
".",
"getBytes",
"(",
"enc",
")",
")",
";",
"}",
"catch",
"... | Calculate an MD5 hash of the string given.
@param data
the data to encode
@param enc
the character encoding to use
@return a hex encoded string of the md5 digested input | [
"Calculate",
"an",
"MD5",
"hash",
"of",
"the",
"string",
"given",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L56-L66 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.explode | public static String[] explode(String str, int ch, boolean respectEmpty)
{
if (str == null || str.length() == 0)
{
return new String[0];
}
ArrayList strings = new ArrayList();
int pos;
int lastpos = 0;
// add snipples
while ((pos = str.indexOf(ch, lastpos)) ... | java | public static String[] explode(String str, int ch, boolean respectEmpty)
{
if (str == null || str.length() == 0)
{
return new String[0];
}
ArrayList strings = new ArrayList();
int pos;
int lastpos = 0;
// add snipples
while ((pos = str.indexOf(ch, lastpos)) ... | [
"public",
"static",
"String",
"[",
"]",
"explode",
"(",
"String",
"str",
",",
"int",
"ch",
",",
"boolean",
"respectEmpty",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"new",
"String... | returns an array of strings decomposed of the original string, split at every occurance of
'ch'.
@param str
the string to decompose
@param ch
the character to use a split pattern
@param respectEmpty
if <code>true</code>, empty elements are generated
@return an array of strings | [
"returns",
"an",
"array",
"of",
"strings",
"decomposed",
"of",
"the",
"original",
"string",
"split",
"at",
"every",
"occurance",
"of",
"ch",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L165-L197 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.implode | public static String implode(String[] arr, String delim)
{
StringBuilder buf = new StringBuilder();
for (int i = 0; i < arr.length; i++)
{
if (i > 0)
{
buf.append(delim);
}
buf.append(arr[i]);
}
return buf.toString();
} | java | public static String implode(String[] arr, String delim)
{
StringBuilder buf = new StringBuilder();
for (int i = 0; i < arr.length; i++)
{
if (i > 0)
{
buf.append(delim);
}
buf.append(arr[i]);
}
return buf.toString();
} | [
"public",
"static",
"String",
"implode",
"(",
"String",
"[",
"]",
"arr",
",",
"String",
"delim",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"length",
";... | Concatenates all strings in the string array using the specified delimiter.
@param arr
@param delim
@return the concatenated string | [
"Concatenates",
"all",
"strings",
"in",
"the",
"string",
"array",
"using",
"the",
"specified",
"delimiter",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L206-L218 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.encodeIllegalXMLCharacters | public static String encodeIllegalXMLCharacters(String text)
{
if (text == null)
{
throw new IllegalArgumentException("null argument");
}
StringBuilder buf = null;
int length = text.length();
int pos = 0;
for (int i = 0; i < length; i++)
{
int ch = te... | java | public static String encodeIllegalXMLCharacters(String text)
{
if (text == null)
{
throw new IllegalArgumentException("null argument");
}
StringBuilder buf = null;
int length = text.length();
int pos = 0;
for (int i = 0; i < length; i++)
{
int ch = te... | [
"public",
"static",
"String",
"encodeIllegalXMLCharacters",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null argument\"",
")",
";",
"}",
"StringBuilder",
"buf",
"=",
"null",
";... | Replaces illegal XML characters in the given string by their corresponding predefined entity
references.
@param text
text to be escaped
@return a string | [
"Replaces",
"illegal",
"XML",
"characters",
"in",
"the",
"given",
"string",
"by",
"their",
"corresponding",
"predefined",
"entity",
"references",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L266-L331 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.getName | public static String getName(String path)
{
int pos = path.lastIndexOf('/');
return pos >= 0 ? path.substring(pos + 1) : "";
} | java | public static String getName(String path)
{
int pos = path.lastIndexOf('/');
return pos >= 0 ? path.substring(pos + 1) : "";
} | [
"public",
"static",
"String",
"getName",
"(",
"String",
"path",
")",
"{",
"int",
"pos",
"=",
"path",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"pos",
">=",
"0",
"?",
"path",
".",
"substring",
"(",
"pos",
"+",
"1",
")",
":",
"\"\"",
"... | Returns the name part of the path
@param path
the path
@return the name part | [
"Returns",
"the",
"name",
"part",
"of",
"the",
"path"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L619-L623 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.isSibling | public static boolean isSibling(String p1, String p2)
{
int pos1 = p1.lastIndexOf('/');
int pos2 = p2.lastIndexOf('/');
return (pos1 == pos2 && pos1 >= 0 && p1.regionMatches(0, p2, 0, pos1));
} | java | public static boolean isSibling(String p1, String p2)
{
int pos1 = p1.lastIndexOf('/');
int pos2 = p2.lastIndexOf('/');
return (pos1 == pos2 && pos1 >= 0 && p1.regionMatches(0, p2, 0, pos1));
} | [
"public",
"static",
"boolean",
"isSibling",
"(",
"String",
"p1",
",",
"String",
"p2",
")",
"{",
"int",
"pos1",
"=",
"p1",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"int",
"pos2",
"=",
"p2",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
... | Determines, if two paths denote hierarchical siblins.
@param p1
first path
@param p2
second path
@return true if on same level, false otherwise | [
"Determines",
"if",
"two",
"paths",
"denote",
"hierarchical",
"siblins",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L699-L704 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AggregateRuleImpl.java | AggregateRuleImpl.getNodeTypeName | private InternalQName getNodeTypeName(Node config) throws IllegalNameException, RepositoryException
{
String ntString = config.getAttributes().getNamedItem("primaryType").getNodeValue();
return resolver.parseJCRName(ntString).getInternalName();
} | java | private InternalQName getNodeTypeName(Node config) throws IllegalNameException, RepositoryException
{
String ntString = config.getAttributes().getNamedItem("primaryType").getNodeValue();
return resolver.parseJCRName(ntString).getInternalName();
} | [
"private",
"InternalQName",
"getNodeTypeName",
"(",
"Node",
"config",
")",
"throws",
"IllegalNameException",
",",
"RepositoryException",
"{",
"String",
"ntString",
"=",
"config",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"primaryType\"",
")",
".",
... | Reads the node type of the root node of the indexing aggregate.
@param config the configuration.
@return the name of the node type.
@throws IllegalNameException if the node type name contains illegal
characters.
@throws RepositoryException | [
"Reads",
"the",
"node",
"type",
"of",
"the",
"root",
"node",
"of",
"the",
"indexing",
"aggregate",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AggregateRuleImpl.java#L194-L198 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.isIndexRecoveryRequired | @SuppressWarnings("unchecked")
private boolean isIndexRecoveryRequired() throws RepositoryException
{
// instantiate filters first, if not initialized
if (recoveryFilters == null)
{
recoveryFilters = new ArrayList<AbstractRecoveryFilter>();
log.info("Initializing RecoveryFilter... | java | @SuppressWarnings("unchecked")
private boolean isIndexRecoveryRequired() throws RepositoryException
{
// instantiate filters first, if not initialized
if (recoveryFilters == null)
{
recoveryFilters = new ArrayList<AbstractRecoveryFilter>();
log.info("Initializing RecoveryFilter... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"isIndexRecoveryRequired",
"(",
")",
"throws",
"RepositoryException",
"{",
"// instantiate filters first, if not initialized",
"if",
"(",
"recoveryFilters",
"==",
"null",
")",
"{",
"recoveryFilters",
... | Invokes all recovery filters from the set
@return true if any filter requires reindexing | [
"Invokes",
"all",
"recovery",
"filters",
"from",
"the",
"set"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L948-L1013 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.executeQuery | public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, Query query,
QPath[] orderProps, boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
waitForResuming();
checkOpen();
workingThreads.incrementAndGet();
try
... | java | public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, Query query,
QPath[] orderProps, boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
waitForResuming();
checkOpen();
workingThreads.incrementAndGet();
try
... | [
"public",
"MultiColumnQueryHits",
"executeQuery",
"(",
"SessionImpl",
"session",
",",
"AbstractQueryImpl",
"queryImpl",
",",
"Query",
"query",
",",
"QPath",
"[",
"]",
"orderProps",
",",
"boolean",
"[",
"]",
"orderSpecs",
",",
"long",
"resultFetchHint",
")",
"throw... | Executes the query on the search index.
@param session
the session that executes the query.
@param queryImpl
the query impl.
@param query
the lucene query.
@param orderProps
name of the properties for sort order.
@param orderSpecs
the order specs for the sort order properties.
<code>true</code> indicates ascending ord... | [
"Executes",
"the",
"query",
"on",
"the",
"search",
"index",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1528-L1575 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.getIndexFormatVersion | public IndexFormatVersion getIndexFormatVersion()
{
if (indexFormatVersion == null)
{
if (getContext().getParentHandler() instanceof SearchIndex)
{
SearchIndex parent = (SearchIndex)getContext().getParentHandler();
if (parent.getIndexFormatVersion().getVersion() ... | java | public IndexFormatVersion getIndexFormatVersion()
{
if (indexFormatVersion == null)
{
if (getContext().getParentHandler() instanceof SearchIndex)
{
SearchIndex parent = (SearchIndex)getContext().getParentHandler();
if (parent.getIndexFormatVersion().getVersion() ... | [
"public",
"IndexFormatVersion",
"getIndexFormatVersion",
"(",
")",
"{",
"if",
"(",
"indexFormatVersion",
"==",
"null",
")",
"{",
"if",
"(",
"getContext",
"(",
")",
".",
"getParentHandler",
"(",
")",
"instanceof",
"SearchIndex",
")",
"{",
"SearchIndex",
"parent",... | Returns the index format version that this search index is able to
support when a query is executed on this index.
@return the index format version for this search index. | [
"Returns",
"the",
"index",
"format",
"version",
"that",
"this",
"search",
"index",
"is",
"able",
"to",
"support",
"when",
"a",
"query",
"is",
"executed",
"on",
"this",
"index",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1690-L1712 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.getIndexReader | protected IndexReader getIndexReader(boolean includeSystemIndex) throws IOException
{
// deny query execution if index in offline mode and allowQuery is false
if (!indexRegister.getDefaultIndex().isOnline() && !allowQuery.get())
{
throw new IndexOfflineIOException("Index is offline");
... | java | protected IndexReader getIndexReader(boolean includeSystemIndex) throws IOException
{
// deny query execution if index in offline mode and allowQuery is false
if (!indexRegister.getDefaultIndex().isOnline() && !allowQuery.get())
{
throw new IndexOfflineIOException("Index is offline");
... | [
"protected",
"IndexReader",
"getIndexReader",
"(",
"boolean",
"includeSystemIndex",
")",
"throws",
"IOException",
"{",
"// deny query execution if index in offline mode and allowQuery is false",
"if",
"(",
"!",
"indexRegister",
".",
"getDefaultIndex",
"(",
")",
".",
"isOnline... | Returns an index reader for this search index. The caller of this method
is responsible for closing the index reader when he is finished using it.
@param includeSystemIndex
if <code>true</code> the index reader will cover the complete
workspace. If <code>false</code> the returned index reader
will not contains any nod... | [
"Returns",
"an",
"index",
"reader",
"for",
"this",
"search",
"index",
".",
"The",
"caller",
"of",
"this",
"method",
"is",
"responsible",
"for",
"closing",
"the",
"index",
"reader",
"when",
"he",
"is",
"finished",
"using",
"it",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1734-L1759 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.createSortFields | protected SortField[] createSortFields(QPath[] orderProps, boolean[] orderSpecs, FieldComparatorSource scs)
throws RepositoryException
{
List<SortField> sortFields = new ArrayList<SortField>();
for (int i = 0; i < orderProps.length; i++)
{
if (orderProps[i].getEntries().length == 1 &... | java | protected SortField[] createSortFields(QPath[] orderProps, boolean[] orderSpecs, FieldComparatorSource scs)
throws RepositoryException
{
List<SortField> sortFields = new ArrayList<SortField>();
for (int i = 0; i < orderProps.length; i++)
{
if (orderProps[i].getEntries().length == 1 &... | [
"protected",
"SortField",
"[",
"]",
"createSortFields",
"(",
"QPath",
"[",
"]",
"orderProps",
",",
"boolean",
"[",
"]",
"orderSpecs",
",",
"FieldComparatorSource",
"scs",
")",
"throws",
"RepositoryException",
"{",
"List",
"<",
"SortField",
">",
"sortFields",
"="... | Creates the SortFields for the order properties.
@param orderProps
the order properties.
@param orderSpecs
the order specs for the properties.
@param scs
{@link FieldComparatorSource} case sensitive or case insensitive comparator
@return an array of sort fields
@throws RepositoryException | [
"Creates",
"the",
"SortFields",
"for",
"the",
"order",
"properties",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1773-L1794 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.createNewIndex | public MultiIndex createNewIndex(String suffix) throws IOException {
IndexInfos indexInfos = new IndexInfos();
IndexUpdateMonitor indexUpdateMonitor = new DefaultIndexUpdateMonitor();
IndexerIoModeHandler modeHandler = new IndexerIoModeHandler(IndexerIoMode.READ_WRITE);
MultiIndex newIndex = ... | java | public MultiIndex createNewIndex(String suffix) throws IOException {
IndexInfos indexInfos = new IndexInfos();
IndexUpdateMonitor indexUpdateMonitor = new DefaultIndexUpdateMonitor();
IndexerIoModeHandler modeHandler = new IndexerIoModeHandler(IndexerIoMode.READ_WRITE);
MultiIndex newIndex = ... | [
"public",
"MultiIndex",
"createNewIndex",
"(",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"IndexInfos",
"indexInfos",
"=",
"new",
"IndexInfos",
"(",
")",
";",
"IndexUpdateMonitor",
"indexUpdateMonitor",
"=",
"new",
"DefaultIndexUpdateMonitor",
"(",
")",
... | Create a new index with the same actual context.
@return MultiIndex the actual index. | [
"Create",
"a",
"new",
"index",
"with",
"the",
"same",
"actual",
"context",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1881-L1891 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.cloneDirectoryManager | protected DirectoryManager cloneDirectoryManager(DirectoryManager directoryManager, String suffix) throws IOException
{
try
{
DirectoryManager df = directoryManager.getClass().newInstance();
df.init(this.path + suffix);
return df;
}
catch (IOException e)
{
... | java | protected DirectoryManager cloneDirectoryManager(DirectoryManager directoryManager, String suffix) throws IOException
{
try
{
DirectoryManager df = directoryManager.getClass().newInstance();
df.init(this.path + suffix);
return df;
}
catch (IOException e)
{
... | [
"protected",
"DirectoryManager",
"cloneDirectoryManager",
"(",
"DirectoryManager",
"directoryManager",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"try",
"{",
"DirectoryManager",
"df",
"=",
"directoryManager",
".",
"getClass",
"(",
")",
".",
"newInstan... | Clone the default Index directory manager
@return an initialized {@link DirectoryManager}.
@throws IOException
if the directory manager cannot be instantiated or an
exception occurs while initializing the manager. | [
"Clone",
"the",
"default",
"Index",
"directory",
"manager"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1991-L2009 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.createSynonymProviderConfigResource | protected InputStream createSynonymProviderConfigResource() throws IOException
{
if (synonymProviderConfigPath != null)
{
InputStream fsr;
// simple sanity check
String separator = PrivilegedSystemHelper.getProperty("file.separator");
if (synonymProviderConfigPath.ends... | java | protected InputStream createSynonymProviderConfigResource() throws IOException
{
if (synonymProviderConfigPath != null)
{
InputStream fsr;
// simple sanity check
String separator = PrivilegedSystemHelper.getProperty("file.separator");
if (synonymProviderConfigPath.ends... | [
"protected",
"InputStream",
"createSynonymProviderConfigResource",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"synonymProviderConfigPath",
"!=",
"null",
")",
"{",
"InputStream",
"fsr",
";",
"// simple sanity check",
"String",
"separator",
"=",
"PrivilegedSystemHel... | Creates a file system resource to the synonym provider configuration.
@return a file system resource or <code>null</code> if no path was
configured.
@throws IOException if an exception occurs accessing the file
system. | [
"Creates",
"a",
"file",
"system",
"resource",
"to",
"the",
"synonym",
"provider",
"configuration",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L2019-L2066 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.createSpellChecker | protected SpellChecker createSpellChecker()
{
// spell checker config
SpellChecker spCheck = null;
if (spellCheckerClass != null)
{
try
{
spCheck = spellCheckerClass.newInstance();
spCheck.init(SearchIndex.this, spellCheckerMinDistance, spellCheckerMo... | java | protected SpellChecker createSpellChecker()
{
// spell checker config
SpellChecker spCheck = null;
if (spellCheckerClass != null)
{
try
{
spCheck = spellCheckerClass.newInstance();
spCheck.init(SearchIndex.this, spellCheckerMinDistance, spellCheckerMo... | [
"protected",
"SpellChecker",
"createSpellChecker",
"(",
")",
"{",
"// spell checker config",
"SpellChecker",
"spCheck",
"=",
"null",
";",
"if",
"(",
"spellCheckerClass",
"!=",
"null",
")",
"{",
"try",
"{",
"spCheck",
"=",
"spellCheckerClass",
".",
"newInstance",
"... | Creates a spell checker for this query handler.
@return the spell checker or <code>null</code> if none is configured or
an error occurs. | [
"Creates",
"a",
"spell",
"checker",
"for",
"this",
"query",
"handler",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L2074-L2099 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.doInitErrorLog | public ErrorLog doInitErrorLog(String path) throws IOException
{
File file = new File(new File(path), ERROR_LOG);
return new ErrorLog(file, errorLogfileSize);
} | java | public ErrorLog doInitErrorLog(String path) throws IOException
{
File file = new File(new File(path), ERROR_LOG);
return new ErrorLog(file, errorLogfileSize);
} | [
"public",
"ErrorLog",
"doInitErrorLog",
"(",
"String",
"path",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"new",
"File",
"(",
"path",
")",
",",
"ERROR_LOG",
")",
";",
"return",
"new",
"ErrorLog",
"(",
"file",
",",
"errorL... | Initialization error log. | [
"Initialization",
"error",
"log",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L3451-L3455 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.waitForResuming | void waitForResuming() throws IOException
{
if (isSuspended.get())
{
try
{
latcher.get().await();
}
catch (InterruptedException e)
{
throw new IOException(e);
}
}
} | java | void waitForResuming() throws IOException
{
if (isSuspended.get())
{
try
{
latcher.get().await();
}
catch (InterruptedException e)
{
throw new IOException(e);
}
}
} | [
"void",
"waitForResuming",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isSuspended",
".",
"get",
"(",
")",
")",
"{",
"try",
"{",
"latcher",
".",
"get",
"(",
")",
".",
"await",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")"... | If component is suspended need to wait resuming and not allow
execute query on closed index.
@throws IOException | [
"If",
"component",
"is",
"suspended",
"need",
"to",
"wait",
"resuming",
"and",
"not",
"allow",
"execute",
"query",
"on",
"closed",
"index",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L3685-L3698 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getUsersStorageNode | Node getUsersStorageNode(Session session) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS);
} | java | Node getUsersStorageNode(Session session) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS);
} | [
"Node",
"getUsersStorageNode",
"(",
"Session",
"session",
")",
"throws",
"PathNotFoundException",
",",
"RepositoryException",
"{",
"return",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"service",
".",
"getStoragePath",
"(",
")",
"+",
"\"/\"",
"+",
"JCROrga... | Returns the node where all users are stored. | [
"Returns",
"the",
"node",
"where",
"all",
"users",
"are",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L131-L134 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getMembershipTypeStorageNode | Node getMembershipTypeStorageNode(Session session) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(service.getStoragePath() + "/"
+ JCROrganizationServiceImpl.STORAGE_JOS_MEMBERSHIP_TYPES);
} | java | Node getMembershipTypeStorageNode(Session session) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(service.getStoragePath() + "/"
+ JCROrganizationServiceImpl.STORAGE_JOS_MEMBERSHIP_TYPES);
} | [
"Node",
"getMembershipTypeStorageNode",
"(",
"Session",
"session",
")",
"throws",
"PathNotFoundException",
",",
"RepositoryException",
"{",
"return",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"service",
".",
"getStoragePath",
"(",
")",
"+",
"\"/\"",
"+",
... | Returns the node where all membership types are stored. | [
"Returns",
"the",
"node",
"where",
"all",
"membership",
"types",
"are",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L139-L143 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getUserNode | Node getUserNode(Session session, String userName) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(getUserNodePath(userName));
} | java | Node getUserNode(Session session, String userName) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(getUserNodePath(userName));
} | [
"Node",
"getUserNode",
"(",
"Session",
"session",
",",
"String",
"userName",
")",
"throws",
"PathNotFoundException",
",",
"RepositoryException",
"{",
"return",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"getUserNodePath",
"(",
"userName",
")",
")",
";",
... | Returns the node where defined user is stored. | [
"Returns",
"the",
"node",
"where",
"defined",
"user",
"is",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L148-L151 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getUserNodePath | String getUserNodePath(String userName) throws RepositoryException
{
return service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS + "/" + userName;
} | java | String getUserNodePath(String userName) throws RepositoryException
{
return service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS + "/" + userName;
} | [
"String",
"getUserNodePath",
"(",
"String",
"userName",
")",
"throws",
"RepositoryException",
"{",
"return",
"service",
".",
"getStoragePath",
"(",
")",
"+",
"\"/\"",
"+",
"JCROrganizationServiceImpl",
".",
"STORAGE_JOS_USERS",
"+",
"\"/\"",
"+",
"userName",
";",
... | Returns the node path where defined user is stored. | [
"Returns",
"the",
"node",
"path",
"where",
"defined",
"user",
"is",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L156-L159 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getMembershipTypeNode | Node getMembershipTypeNode(Session session, String name) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(getMembershipTypeNodePath(name));
} | java | Node getMembershipTypeNode(Session session, String name) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(getMembershipTypeNodePath(name));
} | [
"Node",
"getMembershipTypeNode",
"(",
"Session",
"session",
",",
"String",
"name",
")",
"throws",
"PathNotFoundException",
",",
"RepositoryException",
"{",
"return",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"getMembershipTypeNodePath",
"(",
"name",
")",
"... | Returns the node where defined membership type is stored. | [
"Returns",
"the",
"node",
"where",
"defined",
"membership",
"type",
"is",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L164-L167 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getProfileNode | Node getProfileNode(Session session, String userName) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS + "/"
+ userName + "/" + JCROrganizationServiceImpl.JOS_PROFILE);
} | java | Node getProfileNode(Session session, String userName) throws PathNotFoundException, RepositoryException
{
return (Node)session.getItem(service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS + "/"
+ userName + "/" + JCROrganizationServiceImpl.JOS_PROFILE);
} | [
"Node",
"getProfileNode",
"(",
"Session",
"session",
",",
"String",
"userName",
")",
"throws",
"PathNotFoundException",
",",
"RepositoryException",
"{",
"return",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"service",
".",
"getStoragePath",
"(",
")",
"+",
... | Returns the node where profile of defined user is stored. | [
"Returns",
"the",
"node",
"where",
"profile",
"of",
"defined",
"user",
"is",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L172-L176 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getMembershipTypeNodePath | String getMembershipTypeNodePath(String name) throws RepositoryException
{
return service.getStoragePath()
+ "/"
+ JCROrganizationServiceImpl.STORAGE_JOS_MEMBERSHIP_TYPES
+ "/"
+ (name.equals(MembershipTypeHandler.ANY_MEMBERSHIP_TYPE)
? JCROrganizationServiceImpl... | java | String getMembershipTypeNodePath(String name) throws RepositoryException
{
return service.getStoragePath()
+ "/"
+ JCROrganizationServiceImpl.STORAGE_JOS_MEMBERSHIP_TYPES
+ "/"
+ (name.equals(MembershipTypeHandler.ANY_MEMBERSHIP_TYPE)
? JCROrganizationServiceImpl... | [
"String",
"getMembershipTypeNodePath",
"(",
"String",
"name",
")",
"throws",
"RepositoryException",
"{",
"return",
"service",
".",
"getStoragePath",
"(",
")",
"+",
"\"/\"",
"+",
"JCROrganizationServiceImpl",
".",
"STORAGE_JOS_MEMBERSHIP_TYPES",
"+",
"\"/\"",
"+",
"(",... | Returns the path where defined membership type is stored. | [
"Returns",
"the",
"path",
"where",
"defined",
"membership",
"type",
"is",
"stored",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L206-L214 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.getGroupIds | GroupIds getGroupIds(Node groupNode) throws RepositoryException
{
String storagePath = getGroupStoragePath();
String nodePath = groupNode.getPath();
String groupId = nodePath.substring(storagePath.length());
String parentId = groupId.substring(0, groupId.lastIndexOf("/"));
return new ... | java | GroupIds getGroupIds(Node groupNode) throws RepositoryException
{
String storagePath = getGroupStoragePath();
String nodePath = groupNode.getPath();
String groupId = nodePath.substring(storagePath.length());
String parentId = groupId.substring(0, groupId.lastIndexOf("/"));
return new ... | [
"GroupIds",
"getGroupIds",
"(",
"Node",
"groupNode",
")",
"throws",
"RepositoryException",
"{",
"String",
"storagePath",
"=",
"getGroupStoragePath",
"(",
")",
";",
"String",
"nodePath",
"=",
"groupNode",
".",
"getPath",
"(",
")",
";",
"String",
"groupId",
"=",
... | Evaluate the group identifier and parent group identifier based on group node path. | [
"Evaluate",
"the",
"group",
"identifier",
"and",
"parent",
"group",
"identifier",
"based",
"on",
"group",
"node",
"path",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L219-L228 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java | Utils.splitId | IdComponents splitId(String id) throws IndexOutOfBoundsException
{
String[] membershipIDs = id.split(",");
String groupNodeId = membershipIDs[0];
String userName = membershipIDs[1];
String type = membershipIDs[2];
return new IdComponents(groupNodeId, userName, type);
} | java | IdComponents splitId(String id) throws IndexOutOfBoundsException
{
String[] membershipIDs = id.split(",");
String groupNodeId = membershipIDs[0];
String userName = membershipIDs[1];
String type = membershipIDs[2];
return new IdComponents(groupNodeId, userName, type);
} | [
"IdComponents",
"splitId",
"(",
"String",
"id",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"String",
"[",
"]",
"membershipIDs",
"=",
"id",
".",
"split",
"(",
"\",\"",
")",
";",
"String",
"groupNodeId",
"=",
"membershipIDs",
"[",
"0",
"]",
";",
"String"... | Splits membership identifier into several components. | [
"Splits",
"membership",
"identifier",
"into",
"several",
"components",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/Utils.java#L233-L242 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/Statistics.java | Statistics.printData | public void printData(PrintWriter pw)
{
long lmin = min.get();
if (lmin == Long.MAX_VALUE)
{
lmin = -1;
}
long lmax = max.get();
long ltotal = total.get();
long ltimes = times.get();
float favg = ltimes == 0 ? 0f : (float)ltotal / ltimes;
pw.print(lmin);... | java | public void printData(PrintWriter pw)
{
long lmin = min.get();
if (lmin == Long.MAX_VALUE)
{
lmin = -1;
}
long lmax = max.get();
long ltotal = total.get();
long ltimes = times.get();
float favg = ltimes == 0 ? 0f : (float)ltotal / ltimes;
pw.print(lmin);... | [
"public",
"void",
"printData",
"(",
"PrintWriter",
"pw",
")",
"{",
"long",
"lmin",
"=",
"min",
".",
"get",
"(",
")",
";",
"if",
"(",
"lmin",
"==",
"Long",
".",
"MAX_VALUE",
")",
"{",
"lmin",
"=",
"-",
"1",
";",
"}",
"long",
"lmax",
"=",
"max",
... | Print the current snapshot of the metrics and evaluate the average value | [
"Print",
"the",
"current",
"snapshot",
"of",
"the",
"metrics",
"and",
"evaluate",
"the",
"average",
"value"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/Statistics.java#L159-L179 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/Statistics.java | Statistics.reset | public void reset()
{
min.set(Long.MAX_VALUE);
max.set(0);
total.set(0);
times.set(0);
} | java | public void reset()
{
min.set(Long.MAX_VALUE);
max.set(0);
total.set(0);
times.set(0);
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"min",
".",
"set",
"(",
"Long",
".",
"MAX_VALUE",
")",
";",
"max",
".",
"set",
"(",
"0",
")",
";",
"total",
".",
"set",
"(",
"0",
")",
";",
"times",
".",
"set",
"(",
"0",
")",
";",
"}"
] | Reset the statistics | [
"Reset",
"the",
"statistics"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/Statistics.java#L232-L238 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java | ISPNIndexInfos.refreshIndexes | protected void refreshIndexes(Set<String> set)
{
// do nothing if null is passed
if (set == null)
{
return;
}
setNames(set);
// callback multiIndex to refresh lists
try
{
MultiIndex multiIndex = getMultiIndex();
if (multiIndex != ... | java | protected void refreshIndexes(Set<String> set)
{
// do nothing if null is passed
if (set == null)
{
return;
}
setNames(set);
// callback multiIndex to refresh lists
try
{
MultiIndex multiIndex = getMultiIndex();
if (multiIndex != ... | [
"protected",
"void",
"refreshIndexes",
"(",
"Set",
"<",
"String",
">",
"set",
")",
"{",
"// do nothing if null is passed\r",
"if",
"(",
"set",
"==",
"null",
")",
"{",
"return",
";",
"}",
"setNames",
"(",
"set",
")",
";",
"// callback multiIndex to refresh lists\... | Update index configuration, when it changes on persistent storage
@param set | [
"Update",
"index",
"configuration",
"when",
"it",
"changes",
"on",
"persistent",
"storage"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java#L231-L252 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataTraversingVisitor.java | ItemDataTraversingVisitor.visitChildProperties | protected void visitChildProperties(NodeData node) throws RepositoryException
{
if (isInterrupted())
return;
for (PropertyData data : dataManager.getChildPropertiesData(node))
{
if (isInterrupted())
return;
data.accept(this);
}
} | java | protected void visitChildProperties(NodeData node) throws RepositoryException
{
if (isInterrupted())
return;
for (PropertyData data : dataManager.getChildPropertiesData(node))
{
if (isInterrupted())
return;
data.accept(this);
}
} | [
"protected",
"void",
"visitChildProperties",
"(",
"NodeData",
"node",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"isInterrupted",
"(",
")",
")",
"return",
";",
"for",
"(",
"PropertyData",
"data",
":",
"dataManager",
".",
"getChildPropertiesData",
"(",
... | Visit all child properties. | [
"Visit",
"all",
"child",
"properties",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataTraversingVisitor.java#L111-L121 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataTraversingVisitor.java | ItemDataTraversingVisitor.visitChildNodes | protected void visitChildNodes(NodeData node) throws RepositoryException
{
if (isInterrupted())
return;
for (NodeData data : dataManager.getChildNodesData(node))
{
if (isInterrupted())
return;
data.accept(this);
}
} | java | protected void visitChildNodes(NodeData node) throws RepositoryException
{
if (isInterrupted())
return;
for (NodeData data : dataManager.getChildNodesData(node))
{
if (isInterrupted())
return;
data.accept(this);
}
} | [
"protected",
"void",
"visitChildNodes",
"(",
"NodeData",
"node",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"isInterrupted",
"(",
")",
")",
"return",
";",
"for",
"(",
"NodeData",
"data",
":",
"dataManager",
".",
"getChildNodesData",
"(",
"node",
")"... | Visit all child nodes. | [
"Visit",
"all",
"child",
"nodes",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataTraversingVisitor.java#L126-L136 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/LocationStepQueryNode.java | LocationStepQueryNode.getPredicates | public QueryNode[] getPredicates() {
if (operands == null) {
return EMPTY;
} else {
return (QueryNode[]) operands.toArray(new QueryNode[operands.size()]);
}
} | java | public QueryNode[] getPredicates() {
if (operands == null) {
return EMPTY;
} else {
return (QueryNode[]) operands.toArray(new QueryNode[operands.size()]);
}
} | [
"public",
"QueryNode",
"[",
"]",
"getPredicates",
"(",
")",
"{",
"if",
"(",
"operands",
"==",
"null",
")",
"{",
"return",
"EMPTY",
";",
"}",
"else",
"{",
"return",
"(",
"QueryNode",
"[",
"]",
")",
"operands",
".",
"toArray",
"(",
"new",
"QueryNode",
... | Returns the predicate nodes for this location step. This method may
also return a position predicate.
@return the predicate nodes or an empty array if there are no predicates
for this location step. | [
"Returns",
"the",
"predicate",
"nodes",
"for",
"this",
"location",
"step",
".",
"This",
"method",
"may",
"also",
"return",
"a",
"position",
"predicate",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/LocationStepQueryNode.java#L131-L137 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java | MappedParametrizedObjectEntry.getParameterBoolean | public Boolean getParameterBoolean(String name, Boolean defaultValue)
{
String value = getParameterValue(name, null);
if (value != null)
{
return new Boolean(value);
}
return defaultValue;
} | java | public Boolean getParameterBoolean(String name, Boolean defaultValue)
{
String value = getParameterValue(name, null);
if (value != null)
{
return new Boolean(value);
}
return defaultValue;
} | [
"public",
"Boolean",
"getParameterBoolean",
"(",
"String",
"name",
",",
"Boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getParameterValue",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"new",
"Bool... | Parse named parameter as Boolean.
@param name
parameter name
@param defaultValue
default value
@return boolean value | [
"Parse",
"named",
"parameter",
"as",
"Boolean",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java#L349-L358 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java | HSQLDBSingleDbJDBCConnection.traverseQPath | @Override
protected QPath traverseQPath(String cpid) throws SQLException, InvalidItemStateException, IllegalNameException
{
return traverseQPathSQ(cpid);
} | java | @Override
protected QPath traverseQPath(String cpid) throws SQLException, InvalidItemStateException, IllegalNameException
{
return traverseQPathSQ(cpid);
} | [
"@",
"Override",
"protected",
"QPath",
"traverseQPath",
"(",
"String",
"cpid",
")",
"throws",
"SQLException",
",",
"InvalidItemStateException",
",",
"IllegalNameException",
"{",
"return",
"traverseQPathSQ",
"(",
"cpid",
")",
";",
"}"
] | Use simple queries since it is much faster | [
"Use",
"simple",
"queries",
"since",
"it",
"is",
"much",
"faster"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java#L120-L124 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java | FileValueStorage.prepareRootDir | protected void prepareRootDir(String rootDirPath) throws IOException, RepositoryConfigurationException
{
this.rootDir = new File(rootDirPath);
if (!rootDir.exists())
{
if (rootDir.mkdirs())
{
LOG.info("Value storage directory created: " + rootDir.getAbsolutePath());
... | java | protected void prepareRootDir(String rootDirPath) throws IOException, RepositoryConfigurationException
{
this.rootDir = new File(rootDirPath);
if (!rootDir.exists())
{
if (rootDir.mkdirs())
{
LOG.info("Value storage directory created: " + rootDir.getAbsolutePath());
... | [
"protected",
"void",
"prepareRootDir",
"(",
"String",
"rootDirPath",
")",
"throws",
"IOException",
",",
"RepositoryConfigurationException",
"{",
"this",
".",
"rootDir",
"=",
"new",
"File",
"(",
"rootDirPath",
")",
";",
"if",
"(",
"!",
"rootDir",
".",
"exists",
... | Prepare RootDir.
@param rootDirPath
path
@throws IOException
if error
@throws RepositoryConfigurationException
if confog error | [
"Prepare",
"RootDir",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java#L85-L123 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.addChild | private void addChild(Session session, GroupImpl parent, GroupImpl child, boolean broadcast) throws Exception
{
Node parentNode = utils.getGroupNode(session, parent);
Node groupNode =
parentNode.addNode(child.getGroupName(), JCROrganizationServiceImpl.JOS_HIERARCHY_GROUP_NODETYPE);
String... | java | private void addChild(Session session, GroupImpl parent, GroupImpl child, boolean broadcast) throws Exception
{
Node parentNode = utils.getGroupNode(session, parent);
Node groupNode =
parentNode.addNode(child.getGroupName(), JCROrganizationServiceImpl.JOS_HIERARCHY_GROUP_NODETYPE);
String... | [
"private",
"void",
"addChild",
"(",
"Session",
"session",
",",
"GroupImpl",
"parent",
",",
"GroupImpl",
"child",
",",
"boolean",
"broadcast",
")",
"throws",
"Exception",
"{",
"Node",
"parentNode",
"=",
"utils",
".",
"getGroupNode",
"(",
"session",
",",
"parent... | Adds child group. | [
"Adds",
"child",
"group",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L102-L127 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.findGroups | private Collection<Group> findGroups(Session session, Group parent, boolean recursive) throws Exception
{
List<Group> groups = new ArrayList<Group>();
String parentId = parent == null ? "" : parent.getId();
NodeIterator childNodes = utils.getGroupNode(session, parentId).getNodes();
while (c... | java | private Collection<Group> findGroups(Session session, Group parent, boolean recursive) throws Exception
{
List<Group> groups = new ArrayList<Group>();
String parentId = parent == null ? "" : parent.getId();
NodeIterator childNodes = utils.getGroupNode(session, parentId).getNodes();
while (c... | [
"private",
"Collection",
"<",
"Group",
">",
"findGroups",
"(",
"Session",
"session",
",",
"Group",
"parent",
",",
"boolean",
"recursive",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Group",
">",
"groups",
"=",
"new",
"ArrayList",
"<",
"Group",
">",
"(",... | Find children groups. Parent group is not included in result.
@param recursive
if true, the search should be recursive. It means go down to the tree
until bottom will reach | [
"Find",
"children",
"groups",
".",
"Parent",
"group",
"is",
"not",
"included",
"in",
"result",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L284-L307 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.removeGroup | private Group removeGroup(Session session, Group group, boolean broadcast) throws Exception
{
if (group == null)
{
throw new OrganizationServiceException("Can not remove group, since it is null");
}
Node groupNode = utils.getGroupNode(session, group);
// need to minus one bec... | java | private Group removeGroup(Session session, Group group, boolean broadcast) throws Exception
{
if (group == null)
{
throw new OrganizationServiceException("Can not remove group, since it is null");
}
Node groupNode = utils.getGroupNode(session, group);
// need to minus one bec... | [
"private",
"Group",
"removeGroup",
"(",
"Session",
"session",
",",
"Group",
"group",
",",
"boolean",
"broadcast",
")",
"throws",
"Exception",
"{",
"if",
"(",
"group",
"==",
"null",
")",
"{",
"throw",
"new",
"OrganizationServiceException",
"(",
"\"Can not remove ... | Removes group and all related membership entities. Throws exception if children exist. | [
"Removes",
"group",
"and",
"all",
"related",
"membership",
"entities",
".",
"Throws",
"exception",
"if",
"children",
"exist",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L358-L393 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.removeMemberships | private void removeMemberships(Node groupNode, boolean broadcast) throws RepositoryException
{
NodeIterator refUsers = groupNode.getNode(JCROrganizationServiceImpl.JOS_MEMBERSHIP).getNodes();
while (refUsers.hasNext())
{
refUsers.nextNode().remove();
}
} | java | private void removeMemberships(Node groupNode, boolean broadcast) throws RepositoryException
{
NodeIterator refUsers = groupNode.getNode(JCROrganizationServiceImpl.JOS_MEMBERSHIP).getNodes();
while (refUsers.hasNext())
{
refUsers.nextNode().remove();
}
} | [
"private",
"void",
"removeMemberships",
"(",
"Node",
"groupNode",
",",
"boolean",
"broadcast",
")",
"throws",
"RepositoryException",
"{",
"NodeIterator",
"refUsers",
"=",
"groupNode",
".",
"getNode",
"(",
"JCROrganizationServiceImpl",
".",
"JOS_MEMBERSHIP",
")",
".",
... | Remove all membership entities related to current group. | [
"Remove",
"all",
"membership",
"entities",
"related",
"to",
"current",
"group",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L398-L405 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.migrateGroup | void migrateGroup(Node oldGroupNode) throws Exception
{
String groupName = oldGroupNode.getName();
String desc = utils.readString(oldGroupNode, GroupProperties.JOS_DESCRIPTION);
String label = utils.readString(oldGroupNode, GroupProperties.JOS_LABEL);
String parentId = utils.readString(oldGro... | java | void migrateGroup(Node oldGroupNode) throws Exception
{
String groupName = oldGroupNode.getName();
String desc = utils.readString(oldGroupNode, GroupProperties.JOS_DESCRIPTION);
String label = utils.readString(oldGroupNode, GroupProperties.JOS_LABEL);
String parentId = utils.readString(oldGro... | [
"void",
"migrateGroup",
"(",
"Node",
"oldGroupNode",
")",
"throws",
"Exception",
"{",
"String",
"groupName",
"=",
"oldGroupNode",
".",
"getName",
"(",
")",
";",
"String",
"desc",
"=",
"utils",
".",
"readString",
"(",
"oldGroupNode",
",",
"GroupProperties",
"."... | Method for group migration.
@param oldGroupNode
the node where group properties are stored (from old structure) | [
"Method",
"for",
"group",
"migration",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L443-L462 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.readGroup | private Group readGroup(Node groupNode) throws Exception
{
String groupName = groupNode.getName();
String desc = utils.readString(groupNode, GroupProperties.JOS_DESCRIPTION);
String label = utils.readString(groupNode, GroupProperties.JOS_LABEL);
String parentId = utils.getGroupIds(groupNode).... | java | private Group readGroup(Node groupNode) throws Exception
{
String groupName = groupNode.getName();
String desc = utils.readString(groupNode, GroupProperties.JOS_DESCRIPTION);
String label = utils.readString(groupNode, GroupProperties.JOS_LABEL);
String parentId = utils.getGroupIds(groupNode).... | [
"private",
"Group",
"readGroup",
"(",
"Node",
"groupNode",
")",
"throws",
"Exception",
"{",
"String",
"groupName",
"=",
"groupNode",
".",
"getName",
"(",
")",
";",
"String",
"desc",
"=",
"utils",
".",
"readString",
"(",
"groupNode",
",",
"GroupProperties",
"... | Read group properties from node.
@param groupNode
the node where group properties are stored
@return {@link Group}
@throws OrganizationServiceException
if unexpected exception is occurred during reading | [
"Read",
"group",
"properties",
"from",
"node",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L473-L486 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.writeGroup | private void writeGroup(Group group, Node node) throws OrganizationServiceException
{
try
{
node.setProperty(GroupProperties.JOS_LABEL, group.getLabel());
node.setProperty(GroupProperties.JOS_DESCRIPTION, group.getDescription());
}
catch (RepositoryException e)
{
... | java | private void writeGroup(Group group, Node node) throws OrganizationServiceException
{
try
{
node.setProperty(GroupProperties.JOS_LABEL, group.getLabel());
node.setProperty(GroupProperties.JOS_DESCRIPTION, group.getDescription());
}
catch (RepositoryException e)
{
... | [
"private",
"void",
"writeGroup",
"(",
"Group",
"group",
",",
"Node",
"node",
")",
"throws",
"OrganizationServiceException",
"{",
"try",
"{",
"node",
".",
"setProperty",
"(",
"GroupProperties",
".",
"JOS_LABEL",
",",
"group",
".",
"getLabel",
"(",
")",
")",
"... | Write group properties to the node.
@param groupNode
the node where group properties are stored
@return {@link Group}
@throws OrganizationServiceException
if unexpected exception is occurred during writing | [
"Write",
"group",
"properties",
"to",
"the",
"node",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L497-L508 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.getFromCache | private Group getFromCache(String groupId)
{
return (Group)cache.get(groupId, CacheType.GROUP);
} | java | private Group getFromCache(String groupId)
{
return (Group)cache.get(groupId, CacheType.GROUP);
} | [
"private",
"Group",
"getFromCache",
"(",
"String",
"groupId",
")",
"{",
"return",
"(",
"Group",
")",
"cache",
".",
"get",
"(",
"groupId",
",",
"CacheType",
".",
"GROUP",
")",
";",
"}"
] | Reads group from cache. | [
"Reads",
"group",
"from",
"cache",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L513-L516 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.putInCache | private void putInCache(Group group)
{
cache.put(group.getId(), group, CacheType.GROUP);
} | java | private void putInCache(Group group)
{
cache.put(group.getId(), group, CacheType.GROUP);
} | [
"private",
"void",
"putInCache",
"(",
"Group",
"group",
")",
"{",
"cache",
".",
"put",
"(",
"group",
".",
"getId",
"(",
")",
",",
"group",
",",
"CacheType",
".",
"GROUP",
")",
";",
"}"
] | Puts group in cache. | [
"Puts",
"group",
"in",
"cache",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L521-L524 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.removeAllRelatedFromCache | private void removeAllRelatedFromCache(String groupId)
{
cache.remove(CacheHandler.GROUP_PREFIX + groupId, CacheType.MEMBERSHIP);
} | java | private void removeAllRelatedFromCache(String groupId)
{
cache.remove(CacheHandler.GROUP_PREFIX + groupId, CacheType.MEMBERSHIP);
} | [
"private",
"void",
"removeAllRelatedFromCache",
"(",
"String",
"groupId",
")",
"{",
"cache",
".",
"remove",
"(",
"CacheHandler",
".",
"GROUP_PREFIX",
"+",
"groupId",
",",
"CacheType",
".",
"MEMBERSHIP",
")",
";",
"}"
] | Removes related entities from cache. | [
"Removes",
"related",
"entities",
"from",
"cache",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L537-L540 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.preSave | private void preSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.preSave(group, isNew);
}
} | java | private void preSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.preSave(group, isNew);
}
} | [
"private",
"void",
"preSave",
"(",
"Group",
"group",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"GroupEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"preSave",
"(",
"group",
",",
"isNew",
")",
";",
"}",
... | Notifying listeners before group creation.
@param group
the group which is used in create operation
@param isNew
true, if we have a deal with new group, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"before",
"group",
"creation",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L553-L559 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.postSave | private void postSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.postSave(group, isNew);
}
} | java | private void postSave(Group group, boolean isNew) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.postSave(group, isNew);
}
} | [
"private",
"void",
"postSave",
"(",
"Group",
"group",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"GroupEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"postSave",
"(",
"group",
",",
"isNew",
")",
";",
"}"... | Notifying listeners after group creation.
@param group
the group which is used in create operation
@param isNew
true, if we have a deal with new group, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"after",
"group",
"creation",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L572-L578 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.preDelete | private void preDelete(Group group) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.preDelete(group);
}
} | java | private void preDelete(Group group) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.preDelete(group);
}
} | [
"private",
"void",
"preDelete",
"(",
"Group",
"group",
")",
"throws",
"Exception",
"{",
"for",
"(",
"GroupEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"preDelete",
"(",
"group",
")",
";",
"}",
"}"
] | Notifying listeners before group deletion.
@param group
the group which is used in delete operation
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"before",
"group",
"deletion",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L588-L594 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.postDelete | private void postDelete(Group group) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.postDelete(group);
}
} | java | private void postDelete(Group group) throws Exception
{
for (GroupEventListener listener : listeners)
{
listener.postDelete(group);
}
} | [
"private",
"void",
"postDelete",
"(",
"Group",
"group",
")",
"throws",
"Exception",
"{",
"for",
"(",
"GroupEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"postDelete",
"(",
"group",
")",
";",
"}",
"}"
] | Notifying listeners after group deletion.
@param group
the group which is used in delete operation
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"after",
"group",
"deletion",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L604-L610 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java | DynamicPooledExecutor.execute | public void execute(Runnable command) {
adjustPoolSize();
if (numProcessors == 1) {
// if there is only one processor execute with current thread
command.run();
} else {
try {
executor.execute(command);
} catch (InterruptedException... | java | public void execute(Runnable command) {
adjustPoolSize();
if (numProcessors == 1) {
// if there is only one processor execute with current thread
command.run();
} else {
try {
executor.execute(command);
} catch (InterruptedException... | [
"public",
"void",
"execute",
"(",
"Runnable",
"command",
")",
"{",
"adjustPoolSize",
"(",
")",
";",
"if",
"(",
"numProcessors",
"==",
"1",
")",
"{",
"// if there is only one processor execute with current thread",
"command",
".",
"run",
"(",
")",
";",
"}",
"else... | Executes the given command. This method will block if all threads in the
pool are busy and return only when the command has been accepted. Care
must be taken, that no deadlock occurs when multiple commands are
scheduled for execution. In general commands should not depend on the
execution of other commands!
@param com... | [
"Executes",
"the",
"given",
"command",
".",
"This",
"method",
"will",
"block",
"if",
"all",
"threads",
"in",
"the",
"pool",
"are",
"busy",
"and",
"return",
"only",
"when",
"the",
"command",
"has",
"been",
"accepted",
".",
"Care",
"must",
"be",
"taken",
"... | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java#L73-L86 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java | DynamicPooledExecutor.executeAndWait | public Result[] executeAndWait(Command[] commands) {
Result[] results = new Result[commands.length];
if (numProcessors == 1) {
// optimize for one processor
for (int i = 0; i < commands.length; i++) {
Object obj = null;
InvocationTargetException ex... | java | public Result[] executeAndWait(Command[] commands) {
Result[] results = new Result[commands.length];
if (numProcessors == 1) {
// optimize for one processor
for (int i = 0; i < commands.length; i++) {
Object obj = null;
InvocationTargetException ex... | [
"public",
"Result",
"[",
"]",
"executeAndWait",
"(",
"Command",
"[",
"]",
"commands",
")",
"{",
"Result",
"[",
"]",
"results",
"=",
"new",
"Result",
"[",
"commands",
".",
"length",
"]",
";",
"if",
"(",
"numProcessors",
"==",
"1",
")",
"{",
"// optimize... | Executes a set of commands and waits until all commands have been
executed. The results of the commands are returned in the same order as
the commands.
@param commands the commands to execute.
@return the results. | [
"Executes",
"a",
"set",
"of",
"commands",
"and",
"waits",
"until",
"all",
"commands",
"have",
"been",
"executed",
".",
"The",
"results",
"of",
"the",
"commands",
"are",
"returned",
"in",
"the",
"same",
"order",
"as",
"the",
"commands",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java#L96-L153 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java | DynamicPooledExecutor.adjustPoolSize | private void adjustPoolSize() {
if (lastCheck + 1000 < System.currentTimeMillis()) {
int n = Runtime.getRuntime().availableProcessors();
if (numProcessors != n) {
executor.setMaximumPoolSize(n);
numProcessors = n;
}
lastCheck = Syst... | java | private void adjustPoolSize() {
if (lastCheck + 1000 < System.currentTimeMillis()) {
int n = Runtime.getRuntime().availableProcessors();
if (numProcessors != n) {
executor.setMaximumPoolSize(n);
numProcessors = n;
}
lastCheck = Syst... | [
"private",
"void",
"adjustPoolSize",
"(",
")",
"{",
"if",
"(",
"lastCheck",
"+",
"1000",
"<",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
"{",
"int",
"n",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"availableProcessors",
"(",
")",
";",
"i... | Adjusts the pool size at most once every second. | [
"Adjusts",
"the",
"pool",
"size",
"at",
"most",
"once",
"every",
"second",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java#L158-L167 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.registerListener | private void registerListener(final ChangesLogWrapper logWrapper, TransactionableResourceManager txResourceManager)
throws RepositoryException
{
try
{
// Why calling the listeners non tx aware has been done like this:
// 1. If we call them in the commit phase and we use Arjuna wit... | java | private void registerListener(final ChangesLogWrapper logWrapper, TransactionableResourceManager txResourceManager)
throws RepositoryException
{
try
{
// Why calling the listeners non tx aware has been done like this:
// 1. If we call them in the commit phase and we use Arjuna wit... | [
"private",
"void",
"registerListener",
"(",
"final",
"ChangesLogWrapper",
"logWrapper",
",",
"TransactionableResourceManager",
"txResourceManager",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"// Why calling the listeners non tx aware has been done like this:",
"// 1. If... | This will allow to notify listeners that are not TxAware once the Tx is committed
@param logWrapper
@throws RepositoryException if any error occurs | [
"This",
"will",
"allow",
"to",
"notify",
"listeners",
"that",
"are",
"not",
"TxAware",
"once",
"the",
"Tx",
"is",
"committed"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1210-L1269 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getCachedItemData | protected ItemData getCachedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException
{
return cache.isEnabled() ? cache.get(parentData.getIdentifier(), name, itemType) : null;
} | java | protected ItemData getCachedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException
{
return cache.isEnabled() ? cache.get(parentData.getIdentifier(), name, itemType) : null;
} | [
"protected",
"ItemData",
"getCachedItemData",
"(",
"NodeData",
"parentData",
",",
"QPathEntry",
"name",
",",
"ItemType",
"itemType",
")",
"throws",
"RepositoryException",
"{",
"return",
"cache",
".",
"isEnabled",
"(",
")",
"?",
"cache",
".",
"get",
"(",
"parentD... | Get cached ItemData.
@param parentData
parent
@param name
Item name
@param itemType
item type
@return ItemData
@throws RepositoryException
error | [
"Get",
"cached",
"ItemData",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1284-L1288 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getCachedItemData | protected ItemData getCachedItemData(String identifier) throws RepositoryException
{
return cache.isEnabled() ? cache.get(identifier) : null;
} | java | protected ItemData getCachedItemData(String identifier) throws RepositoryException
{
return cache.isEnabled() ? cache.get(identifier) : null;
} | [
"protected",
"ItemData",
"getCachedItemData",
"(",
"String",
"identifier",
")",
"throws",
"RepositoryException",
"{",
"return",
"cache",
".",
"isEnabled",
"(",
")",
"?",
"cache",
".",
"get",
"(",
"identifier",
")",
":",
"null",
";",
"}"
] | Returns an item from cache by Identifier or null if the item don't cached.
@param identifier
Item id
@return ItemData
@throws RepositoryException
error | [
"Returns",
"an",
"item",
"from",
"cache",
"by",
"Identifier",
"or",
"null",
"if",
"the",
"item",
"don",
"t",
"cached",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1344-L1347 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getChildNodesData | protected List<NodeData> getChildNodesData(final NodeData nodeData, boolean forcePersistentRead)
throws RepositoryException
{
List<NodeData> childNodes = null;
if (!forcePersistentRead && cache.isEnabled())
{
childNodes = cache.getChildNodes(nodeData);
if (childNodes != nul... | java | protected List<NodeData> getChildNodesData(final NodeData nodeData, boolean forcePersistentRead)
throws RepositoryException
{
List<NodeData> childNodes = null;
if (!forcePersistentRead && cache.isEnabled())
{
childNodes = cache.getChildNodes(nodeData);
if (childNodes != nul... | [
"protected",
"List",
"<",
"NodeData",
">",
"getChildNodesData",
"(",
"final",
"NodeData",
"nodeData",
",",
"boolean",
"forcePersistentRead",
")",
"throws",
"RepositoryException",
"{",
"List",
"<",
"NodeData",
">",
"childNodes",
"=",
"null",
";",
"if",
"(",
"!",
... | Get child NodesData.
@param nodeData
parent
@param forcePersistentRead
true if persistent read is required (without cache)
@return List of NodeData
@throws RepositoryException
Repository error | [
"Get",
"child",
"NodesData",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1377-L1423 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getReferencedPropertiesData | protected List<PropertyData> getReferencedPropertiesData(final String identifier) throws RepositoryException
{
List<PropertyData> refProps = null;
if (cache.isEnabled())
{
refProps = cache.getReferencedProperties(identifier);
if (refProps != null)
{
return ref... | java | protected List<PropertyData> getReferencedPropertiesData(final String identifier) throws RepositoryException
{
List<PropertyData> refProps = null;
if (cache.isEnabled())
{
refProps = cache.getReferencedProperties(identifier);
if (refProps != null)
{
return ref... | [
"protected",
"List",
"<",
"PropertyData",
">",
"getReferencedPropertiesData",
"(",
"final",
"String",
"identifier",
")",
"throws",
"RepositoryException",
"{",
"List",
"<",
"PropertyData",
">",
"refProps",
"=",
"null",
";",
"if",
"(",
"cache",
".",
"isEnabled",
"... | Get referenced properties data.
@param identifier
referenceable identifier
@return List of PropertyData
@throws RepositoryException
Repository error | [
"Get",
"referenced",
"properties",
"data",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1626-L1669 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getCachedCleanChildPropertiesData | protected List<PropertyData> getCachedCleanChildPropertiesData(NodeData nodeData)
{
if (cache.isEnabled())
{
List<PropertyData> childProperties = cache.getChildProperties(nodeData);
if (childProperties != null)
{
boolean skip = false;
for (PropertyData ... | java | protected List<PropertyData> getCachedCleanChildPropertiesData(NodeData nodeData)
{
if (cache.isEnabled())
{
List<PropertyData> childProperties = cache.getChildProperties(nodeData);
if (childProperties != null)
{
boolean skip = false;
for (PropertyData ... | [
"protected",
"List",
"<",
"PropertyData",
">",
"getCachedCleanChildPropertiesData",
"(",
"NodeData",
"nodeData",
")",
"{",
"if",
"(",
"cache",
".",
"isEnabled",
"(",
")",
")",
"{",
"List",
"<",
"PropertyData",
">",
"childProperties",
"=",
"cache",
".",
"getChi... | Gets the list of child properties from the cache and checks if one of them
is incomplete, if everything is ok, it returns the list otherwise it returns
null. | [
"Gets",
"the",
"list",
"of",
"child",
"properties",
"from",
"the",
"cache",
"and",
"checks",
"if",
"one",
"of",
"them",
"is",
"incomplete",
"if",
"everything",
"is",
"ok",
"it",
"returns",
"the",
"list",
"otherwise",
"it",
"returns",
"null",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1676-L1699 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getChildPropertiesData | protected List<PropertyData> getChildPropertiesData(final NodeData nodeData, boolean forcePersistentRead)
throws RepositoryException
{
List<PropertyData> childProperties = null;
if (!forcePersistentRead)
{
childProperties = getCachedCleanChildPropertiesData(nodeData);
if (c... | java | protected List<PropertyData> getChildPropertiesData(final NodeData nodeData, boolean forcePersistentRead)
throws RepositoryException
{
List<PropertyData> childProperties = null;
if (!forcePersistentRead)
{
childProperties = getCachedCleanChildPropertiesData(nodeData);
if (c... | [
"protected",
"List",
"<",
"PropertyData",
">",
"getChildPropertiesData",
"(",
"final",
"NodeData",
"nodeData",
",",
"boolean",
"forcePersistentRead",
")",
"throws",
"RepositoryException",
"{",
"List",
"<",
"PropertyData",
">",
"childProperties",
"=",
"null",
";",
"i... | Get child PropertyData.
@param nodeData
parent
@param forcePersistentRead
true if persistent read is required (without cache)
@return List of PropertyData
@throws RepositoryException
Repository error | [
"Get",
"child",
"PropertyData",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1712-L1759 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getPersistedItemData | protected ItemData getPersistedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException
{
ItemData data = super.getItemData(parentData, name, itemType);
if (cache.isEnabled())
{
if (data == null)
{
if (itemType == ItemType.NODE... | java | protected ItemData getPersistedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException
{
ItemData data = super.getItemData(parentData, name, itemType);
if (cache.isEnabled())
{
if (data == null)
{
if (itemType == ItemType.NODE... | [
"protected",
"ItemData",
"getPersistedItemData",
"(",
"NodeData",
"parentData",
",",
"QPathEntry",
"name",
",",
"ItemType",
"itemType",
")",
"throws",
"RepositoryException",
"{",
"ItemData",
"data",
"=",
"super",
".",
"getItemData",
"(",
"parentData",
",",
"name",
... | Get persisted ItemData.
@param parentData
parent
@param name
Item name
@param itemType
item type
@return ItemData
@throws RepositoryException
error | [
"Get",
"persisted",
"ItemData",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1975-L1998 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.initRemoteCommands | private void initRemoteCommands()
{
if (rpcService != null)
{
// register commands
suspend = rpcService.registerCommand(new RemoteCommand()
{
public String getId()
{
return "org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableW... | java | private void initRemoteCommands()
{
if (rpcService != null)
{
// register commands
suspend = rpcService.registerCommand(new RemoteCommand()
{
public String getId()
{
return "org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableW... | [
"private",
"void",
"initRemoteCommands",
"(",
")",
"{",
"if",
"(",
"rpcService",
"!=",
"null",
")",
"{",
"// register commands",
"suspend",
"=",
"rpcService",
".",
"registerCommand",
"(",
"new",
"RemoteCommand",
"(",
")",
"{",
"public",
"String",
"getId",
"(",... | Initialization remote commands. | [
"Initialization",
"remote",
"commands",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2274-L2326 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.unregisterRemoteCommands | private void unregisterRemoteCommands()
{
if (rpcService != null)
{
rpcService.unregisterCommand(suspend);
rpcService.unregisterCommand(resume);
rpcService.unregisterCommand(requestForResponsibleForResuming);
}
} | java | private void unregisterRemoteCommands()
{
if (rpcService != null)
{
rpcService.unregisterCommand(suspend);
rpcService.unregisterCommand(resume);
rpcService.unregisterCommand(requestForResponsibleForResuming);
}
} | [
"private",
"void",
"unregisterRemoteCommands",
"(",
")",
"{",
"if",
"(",
"rpcService",
"!=",
"null",
")",
"{",
"rpcService",
".",
"unregisterCommand",
"(",
"suspend",
")",
";",
"rpcService",
".",
"unregisterCommand",
"(",
"resume",
")",
";",
"rpcService",
".",... | Unregister remote commands. | [
"Unregister",
"remote",
"commands",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2331-L2340 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.initACL | private ItemData initACL(NodeData parent, NodeData node) throws RepositoryException
{
return initACL(parent, node, null);
} | java | private ItemData initACL(NodeData parent, NodeData node) throws RepositoryException
{
return initACL(parent, node, null);
} | [
"private",
"ItemData",
"initACL",
"(",
"NodeData",
"parent",
",",
"NodeData",
"node",
")",
"throws",
"RepositoryException",
"{",
"return",
"initACL",
"(",
"parent",
",",
"node",
",",
"null",
")",
";",
"}"
] | Init ACL of the node.
@param parent
- a parent, can be null (get item by id)
@param node
- an item data
@return - an item data with ACL was initialized
@throws RepositoryException | [
"Init",
"ACL",
"of",
"the",
"node",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2375-L2378 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getACL | private NodeData getACL(String identifier, ACLSearch search) throws RepositoryException
{
final ItemData item = getItemData(identifier, false);
return item != null && item.isNode() ? initACL(null, (NodeData)item, search) : null;
} | java | private NodeData getACL(String identifier, ACLSearch search) throws RepositoryException
{
final ItemData item = getItemData(identifier, false);
return item != null && item.isNode() ? initACL(null, (NodeData)item, search) : null;
} | [
"private",
"NodeData",
"getACL",
"(",
"String",
"identifier",
",",
"ACLSearch",
"search",
")",
"throws",
"RepositoryException",
"{",
"final",
"ItemData",
"item",
"=",
"getItemData",
"(",
"identifier",
",",
"false",
")",
";",
"return",
"item",
"!=",
"null",
"&&... | Find Item by identifier to get the missing ACL information.
@param identifier the id of the node that we are looking for to fill the ACL research
@param search the ACL search describing what we are looking for
@return NodeData, data by identifier | [
"Find",
"Item",
"by",
"identifier",
"to",
"get",
"the",
"missing",
"ACL",
"information",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2536-L2540 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getACLHolders | public List<ACLHolder> getACLHolders() throws RepositoryException
{
WorkspaceStorageConnection conn = dataContainer.openConnection();
try
{
return conn.getACLHolders();
}
finally
{
conn.close();
}
} | java | public List<ACLHolder> getACLHolders() throws RepositoryException
{
WorkspaceStorageConnection conn = dataContainer.openConnection();
try
{
return conn.getACLHolders();
}
finally
{
conn.close();
}
} | [
"public",
"List",
"<",
"ACLHolder",
">",
"getACLHolders",
"(",
")",
"throws",
"RepositoryException",
"{",
"WorkspaceStorageConnection",
"conn",
"=",
"dataContainer",
".",
"openConnection",
"(",
")",
";",
"try",
"{",
"return",
"conn",
".",
"getACLHolders",
"(",
"... | Gets the list of all the ACL holders
@throws RepositoryException if an error occurs | [
"Gets",
"the",
"list",
"of",
"all",
"the",
"ACL",
"holders"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2546-L2557 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.loadFilters | protected boolean loadFilters(final boolean cleanOnFail, boolean asynchronous)
{
if (!filtersSupported.get())
{
if (LOG.isWarnEnabled())
{
LOG.warn("The bloom filters are not supported therefore they cannot be reloaded");
}
return false;
}
filte... | java | protected boolean loadFilters(final boolean cleanOnFail, boolean asynchronous)
{
if (!filtersSupported.get())
{
if (LOG.isWarnEnabled())
{
LOG.warn("The bloom filters are not supported therefore they cannot be reloaded");
}
return false;
}
filte... | [
"protected",
"boolean",
"loadFilters",
"(",
"final",
"boolean",
"cleanOnFail",
",",
"boolean",
"asynchronous",
")",
"{",
"if",
"(",
"!",
"filtersSupported",
".",
"get",
"(",
")",
")",
"{",
"if",
"(",
"LOG",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"LOG"... | Loads the bloom filters
@param cleanOnFail clean everything if an error occurs
@param asynchronous make the bloom filters loading asynchronous
@return <code>true</code> if the filters could be loaded successfully, <code>false</code> otherwise. | [
"Loads",
"the",
"bloom",
"filters"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2640-L2670 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.forceLoad | private boolean forceLoad(PropertyData prop)
{
final List<ValueData> vals = prop.getValues();
for (int i = 0; i < vals.size(); i++)
{
ValueData vd = vals.get(i);
if (!vd.isByteArray())
{
// check if file is correct
FilePersistedValueData fpvd = (Fi... | java | private boolean forceLoad(PropertyData prop)
{
final List<ValueData> vals = prop.getValues();
for (int i = 0; i < vals.size(); i++)
{
ValueData vd = vals.get(i);
if (!vd.isByteArray())
{
// check if file is correct
FilePersistedValueData fpvd = (Fi... | [
"private",
"boolean",
"forceLoad",
"(",
"PropertyData",
"prop",
")",
"{",
"final",
"List",
"<",
"ValueData",
">",
"vals",
"=",
"prop",
".",
"getValues",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vals",
".",
"size",
"(",
")",
... | Check Property BLOB Values if someone has null file.
@param prop PropertyData
@throws RepositoryException
@return <code>true</code> if the Property BLOB Values has null file, <code>false</code> otherwise. | [
"Check",
"Property",
"BLOB",
"Values",
"if",
"someone",
"has",
"null",
"file",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2793-L2816 | train |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MoveCommand.java | MoveCommand.move | public Response move(Session session, String srcPath, String destPath)
{
try
{
session.move(srcPath, destPath);
session.save();
// If the source resource was successfully moved
// to a pre-existing destination resource.
if (itemExisted)
{
... | java | public Response move(Session session, String srcPath, String destPath)
{
try
{
session.move(srcPath, destPath);
session.save();
// If the source resource was successfully moved
// to a pre-existing destination resource.
if (itemExisted)
{
... | [
"public",
"Response",
"move",
"(",
"Session",
"session",
",",
"String",
"srcPath",
",",
"String",
"destPath",
")",
"{",
"try",
"{",
"session",
".",
"move",
"(",
"srcPath",
",",
"destPath",
")",
";",
"session",
".",
"save",
"(",
")",
";",
"// If the sourc... | Webdav Move method implementation.
@param session current session.
@param srcPath source resource path
@param destPath destination resource path
@return the instance of javax.ws.rs.core.Response | [
"Webdav",
"Move",
"method",
"implementation",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MoveCommand.java#L101-L145 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProvider.java | AbstractItemDefinitionAccessProvider.loadPropertyValues | protected List<ValueData> loadPropertyValues(NodeData parentNode, ItemData property , InternalQName propertyName)
throws RepositoryException
{
if(property == null)
{
property = dataManager.getItemData(parentNode, new QPathEntry(propertyName, 1), ItemType.PROPERTY);
}
if (prope... | java | protected List<ValueData> loadPropertyValues(NodeData parentNode, ItemData property , InternalQName propertyName)
throws RepositoryException
{
if(property == null)
{
property = dataManager.getItemData(parentNode, new QPathEntry(propertyName, 1), ItemType.PROPERTY);
}
if (prope... | [
"protected",
"List",
"<",
"ValueData",
">",
"loadPropertyValues",
"(",
"NodeData",
"parentNode",
",",
"ItemData",
"property",
",",
"InternalQName",
"propertyName",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"property",
"==",
"null",
")",
"{",
"property"... | Load values.
@param parentNode
@param propertyName
@return
@throws RepositoryException | [
"Load",
"values",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProvider.java#L70-L85 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/quota/QuotaExecutorService.java | QuotaExecutorService.awaitTasksTermination | protected void awaitTasksTermination()
{
delegated.shutdown();
try
{
delegated.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
}
catch (InterruptedException e)
{
LOG.warn("Termination has been interrupted");
}
} | java | protected void awaitTasksTermination()
{
delegated.shutdown();
try
{
delegated.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
}
catch (InterruptedException e)
{
LOG.warn("Termination has been interrupted");
}
} | [
"protected",
"void",
"awaitTasksTermination",
"(",
")",
"{",
"delegated",
".",
"shutdown",
"(",
")",
";",
"try",
"{",
"delegated",
".",
"awaitTermination",
"(",
"Long",
".",
"MAX_VALUE",
",",
"TimeUnit",
".",
"NANOSECONDS",
")",
";",
"}",
"catch",
"(",
"In... | Awaits until all tasks will be done. | [
"Awaits",
"until",
"all",
"tasks",
"will",
"be",
"done",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/quota/QuotaExecutorService.java#L223-L234 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionRegistry.java | SessionRegistry.closeSessions | public int closeSessions(String workspaceName)
{
int closedSessions = 0;
for (SessionImpl session : sessionsMap.values())
{
if (session.getWorkspace().getName().equals(workspaceName))
{
session.logout();
closedSessions++;
}
}
return c... | java | public int closeSessions(String workspaceName)
{
int closedSessions = 0;
for (SessionImpl session : sessionsMap.values())
{
if (session.getWorkspace().getName().equals(workspaceName))
{
session.logout();
closedSessions++;
}
}
return c... | [
"public",
"int",
"closeSessions",
"(",
"String",
"workspaceName",
")",
"{",
"int",
"closedSessions",
"=",
"0",
";",
"for",
"(",
"SessionImpl",
"session",
":",
"sessionsMap",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"session",
".",
"getWorkspace",
"(",... | closeSessions will be closed the all sessions on specific workspace.
@param workspaceName
the workspace name.
@return int
how many sessions was closed. | [
"closeSessions",
"will",
"be",
"closed",
"the",
"all",
"sessions",
"on",
"specific",
"workspace",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionRegistry.java#L222-L236 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java | BufferedISPNCache.commitTransaction | public void commitTransaction()
{
CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
final TransactionManager tm = getTransactionManager();
try
{
final List<ChangesContainer> containers = changesContainer.getSortedList();
commitChanges(tm, containers);
... | java | public void commitTransaction()
{
CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
final TransactionManager tm = getTransactionManager();
try
{
final List<ChangesContainer> containers = changesContainer.getSortedList();
commitChanges(tm, containers);
... | [
"public",
"void",
"commitTransaction",
"(",
")",
"{",
"CompressedISPNChangesBuffer",
"changesContainer",
"=",
"getChangesBufferSafe",
"(",
")",
";",
"final",
"TransactionManager",
"tm",
"=",
"getTransactionManager",
"(",
")",
";",
"try",
"{",
"final",
"List",
"<",
... | Sort changes and commit data to the cache. | [
"Sort",
"changes",
"and",
"commit",
"data",
"to",
"the",
"cache",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java#L1134-L1148 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java | BufferedISPNCache.setLocal | public void setLocal(boolean local)
{
// start local transaction
if (local && changesList.get() == null)
{
beginTransaction();
}
this.local.set(local);
} | java | public void setLocal(boolean local)
{
// start local transaction
if (local && changesList.get() == null)
{
beginTransaction();
}
this.local.set(local);
} | [
"public",
"void",
"setLocal",
"(",
"boolean",
"local",
")",
"{",
"// start local transaction",
"if",
"(",
"local",
"&&",
"changesList",
".",
"get",
"(",
")",
"==",
"null",
")",
"{",
"beginTransaction",
"(",
")",
";",
"}",
"this",
".",
"local",
".",
"set"... | Creates all ChangesBuffers with given parameter
@param local | [
"Creates",
"all",
"ChangesBuffers",
"with",
"given",
"parameter"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java#L1230-L1238 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java | BufferedISPNCache.getChangesBufferSafe | private CompressedISPNChangesBuffer getChangesBufferSafe()
{
CompressedISPNChangesBuffer changesContainer = changesList.get();
if (changesContainer == null)
{
throw new IllegalStateException("changesContainer should not be empty");
}
return changesContainer;
} | java | private CompressedISPNChangesBuffer getChangesBufferSafe()
{
CompressedISPNChangesBuffer changesContainer = changesList.get();
if (changesContainer == null)
{
throw new IllegalStateException("changesContainer should not be empty");
}
return changesContainer;
} | [
"private",
"CompressedISPNChangesBuffer",
"getChangesBufferSafe",
"(",
")",
"{",
"CompressedISPNChangesBuffer",
"changesContainer",
"=",
"changesList",
".",
"get",
"(",
")",
";",
"if",
"(",
"changesContainer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateExcep... | Tries to get buffer and if it is null throws an exception otherwise returns buffer.
@return | [
"Tries",
"to",
"get",
"buffer",
"and",
"if",
"it",
"is",
"null",
"throws",
"an",
"exception",
"otherwise",
"returns",
"buffer",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java#L1245-L1253 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java | RESTArtifactLoaderService.getResource | @GET
@Path("/{path:.*}/")
public Response getResource(@PathParam("path") String mavenPath, final @Context UriInfo uriInfo,
final @QueryParam("view") String view, final @QueryParam("gadget") String gadget)
{
String resourcePath = mavenRoot + mavenPath; // JCR resource
String shaResourcePath =... | java | @GET
@Path("/{path:.*}/")
public Response getResource(@PathParam("path") String mavenPath, final @Context UriInfo uriInfo,
final @QueryParam("view") String view, final @QueryParam("gadget") String gadget)
{
String resourcePath = mavenRoot + mavenPath; // JCR resource
String shaResourcePath =... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{path:.*}/\"",
")",
"public",
"Response",
"getResource",
"(",
"@",
"PathParam",
"(",
"\"path\"",
")",
"String",
"mavenPath",
",",
"final",
"@",
"Context",
"UriInfo",
"uriInfo",
",",
"final",
"@",
"QueryParam",
"(",
"\"view\"... | Return Response with Maven artifact if it is file or HTML page for browsing if requested URL is
folder.
@param mavenPath
the relative part of requested URL.
@param uriInfo
@param view
@param gadget
@return {@link Response}. | [
"Return",
"Response",
"with",
"Maven",
"artifact",
"if",
"it",
"is",
"file",
"or",
"HTML",
"page",
"for",
"browsing",
"if",
"requested",
"URL",
"is",
"folder",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java#L164-L244 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java | RESTArtifactLoaderService.getRootNodeList | @GET
public Response getRootNodeList(final @Context UriInfo uriInfo, final @QueryParam("view") String view,
final @QueryParam("gadget") String gadget)
{
return getResource("", uriInfo, view, gadget);
} | java | @GET
public Response getRootNodeList(final @Context UriInfo uriInfo, final @QueryParam("view") String view,
final @QueryParam("gadget") String gadget)
{
return getResource("", uriInfo, view, gadget);
} | [
"@",
"GET",
"public",
"Response",
"getRootNodeList",
"(",
"final",
"@",
"Context",
"UriInfo",
"uriInfo",
",",
"final",
"@",
"QueryParam",
"(",
"\"view\"",
")",
"String",
"view",
",",
"final",
"@",
"QueryParam",
"(",
"\"gadget\"",
")",
"String",
"gadget",
")"... | Browsing of root node of Maven repository.
@param uriInfo
@param view
@param gadget
@return {@link Response}. | [
"Browsing",
"of",
"root",
"node",
"of",
"Maven",
"repository",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java#L254-L259 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java | RESTArtifactLoaderService.isFile | private static boolean isFile(Node node) throws RepositoryException
{
if (!node.isNodeType("nt:file"))
{
return false;
}
if (!node.getNode("jcr:content").isNodeType("nt:resource"))
{
return false;
}
return true;
} | java | private static boolean isFile(Node node) throws RepositoryException
{
if (!node.isNodeType("nt:file"))
{
return false;
}
if (!node.getNode("jcr:content").isNodeType("nt:resource"))
{
return false;
}
return true;
} | [
"private",
"static",
"boolean",
"isFile",
"(",
"Node",
"node",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"!",
"node",
".",
"isNodeType",
"(",
"\"nt:file\"",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"node",
".",
"getNode",
... | Check is node represents file.
@param node
the node.
@return true if node represents file false otherwise.
@throws RepositoryException
in JCR errors occur. | [
"Check",
"is",
"node",
"represents",
"file",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java#L270-L281 | train |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java | RESTArtifactLoaderService.downloadArtifact | private Response downloadArtifact(Node node) throws Exception
{
NodeRepresentation nodeRepresentation = nodeRepresentationService.getNodeRepresentation(node, null);
if (node.canAddMixin("exo:mavencounter"))
{
node.addMixin("exo:mavencounter");
node.getSession().save();
}
... | java | private Response downloadArtifact(Node node) throws Exception
{
NodeRepresentation nodeRepresentation = nodeRepresentationService.getNodeRepresentation(node, null);
if (node.canAddMixin("exo:mavencounter"))
{
node.addMixin("exo:mavencounter");
node.getSession().save();
}
... | [
"private",
"Response",
"downloadArtifact",
"(",
"Node",
"node",
")",
"throws",
"Exception",
"{",
"NodeRepresentation",
"nodeRepresentation",
"=",
"nodeRepresentationService",
".",
"getNodeRepresentation",
"(",
"node",
",",
"null",
")",
";",
"if",
"(",
"node",
".",
... | Get content of JCR node.
@param node
the node.
@return @see {@link Response}.
@throws Exception
if any errors occurs. | [
"Get",
"content",
"of",
"JCR",
"node",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/rest/RESTArtifactLoaderService.java#L503-L521 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.registerStatistics | public static void registerStatistics(String category, Statistics global, Map<String, Statistics> allStatistics)
{
if (category == null || category.length() == 0)
{
throw new IllegalArgumentException("The category of the statistics cannot be empty");
}
if (allStatistics == null || al... | java | public static void registerStatistics(String category, Statistics global, Map<String, Statistics> allStatistics)
{
if (category == null || category.length() == 0)
{
throw new IllegalArgumentException("The category of the statistics cannot be empty");
}
if (allStatistics == null || al... | [
"public",
"static",
"void",
"registerStatistics",
"(",
"String",
"category",
",",
"Statistics",
"global",
",",
"Map",
"<",
"String",
",",
"Statistics",
">",
"allStatistics",
")",
"{",
"if",
"(",
"category",
"==",
"null",
"||",
"category",
".",
"length",
"(",... | Register a new category of statistics to manage.
@param category the name of the category of statistics to register.
@param global the global statistics.
@param allStatistics the list of all statistics corresponding to the category. | [
"Register",
"a",
"new",
"category",
"of",
"statistics",
"to",
"manage",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L105-L137 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.startIfNeeded | private static void startIfNeeded()
{
if (!STARTED)
{
synchronized (JCRStatisticsManager.class)
{
if (!STARTED)
{
addTriggers();
ExoContainer container = ExoContainerContext.getTopContainer();
ManagementContext ctx = n... | java | private static void startIfNeeded()
{
if (!STARTED)
{
synchronized (JCRStatisticsManager.class)
{
if (!STARTED)
{
addTriggers();
ExoContainer container = ExoContainerContext.getTopContainer();
ManagementContext ctx = n... | [
"private",
"static",
"void",
"startIfNeeded",
"(",
")",
"{",
"if",
"(",
"!",
"STARTED",
")",
"{",
"synchronized",
"(",
"JCRStatisticsManager",
".",
"class",
")",
"{",
"if",
"(",
"!",
"STARTED",
")",
"{",
"addTriggers",
"(",
")",
";",
"ExoContainer",
"con... | Starts the manager if needed | [
"Starts",
"the",
"manager",
"if",
"needed"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L182-L209 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.addTriggers | private static void addTriggers()
{
if (!PERSISTENCE_ENABLED)
{
return;
}
Runtime.getRuntime().addShutdownHook(new Thread("JCRStatisticsManager-Hook")
{
@Override
public void run()
{
printData();
}
});
Thread t = new T... | java | private static void addTriggers()
{
if (!PERSISTENCE_ENABLED)
{
return;
}
Runtime.getRuntime().addShutdownHook(new Thread("JCRStatisticsManager-Hook")
{
@Override
public void run()
{
printData();
}
});
Thread t = new T... | [
"private",
"static",
"void",
"addTriggers",
"(",
")",
"{",
"if",
"(",
"!",
"PERSISTENCE_ENABLED",
")",
"{",
"return",
";",
"}",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"addShutdownHook",
"(",
"new",
"Thread",
"(",
"\"JCRStatisticsManager-Hook\"",
")",
"... | Add all the triggers that will keep the file up to date only if the persistence
is enabled. | [
"Add",
"all",
"the",
"triggers",
"that",
"will",
"keep",
"the",
"file",
"up",
"to",
"date",
"only",
"if",
"the",
"persistence",
"is",
"enabled",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L215-L250 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.printData | private static void printData()
{
Map<String, StatisticsContext> tmpContexts = CONTEXTS;
for (StatisticsContext context : tmpContexts.values())
{
printData(context);
}
} | java | private static void printData()
{
Map<String, StatisticsContext> tmpContexts = CONTEXTS;
for (StatisticsContext context : tmpContexts.values())
{
printData(context);
}
} | [
"private",
"static",
"void",
"printData",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"StatisticsContext",
">",
"tmpContexts",
"=",
"CONTEXTS",
";",
"for",
"(",
"StatisticsContext",
"context",
":",
"tmpContexts",
".",
"values",
"(",
")",
")",
"{",
"printData",... | Add one line of data to all the csv files. | [
"Add",
"one",
"line",
"of",
"data",
"to",
"all",
"the",
"csv",
"files",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L286-L293 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.printData | private static void printData(StatisticsContext context)
{
if (context.writer == null)
{
return;
}
boolean first = true;
if (context.global != null)
{
context.global.printData(context.writer);
first = false;
}
for (Statistics s : context.allS... | java | private static void printData(StatisticsContext context)
{
if (context.writer == null)
{
return;
}
boolean first = true;
if (context.global != null)
{
context.global.printData(context.writer);
first = false;
}
for (Statistics s : context.allS... | [
"private",
"static",
"void",
"printData",
"(",
"StatisticsContext",
"context",
")",
"{",
"if",
"(",
"context",
".",
"writer",
"==",
"null",
")",
"{",
"return",
";",
"}",
"boolean",
"first",
"=",
"true",
";",
"if",
"(",
"context",
".",
"global",
"!=",
"... | Add one line of data to the csv file related to the given context. | [
"Add",
"one",
"line",
"of",
"data",
"to",
"the",
"csv",
"file",
"related",
"to",
"the",
"given",
"context",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L298-L324 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.getContext | private static StatisticsContext getContext(String category)
{
if (category == null)
{
return null;
}
return CONTEXTS.get(category);
} | java | private static StatisticsContext getContext(String category)
{
if (category == null)
{
return null;
}
return CONTEXTS.get(category);
} | [
"private",
"static",
"StatisticsContext",
"getContext",
"(",
"String",
"category",
")",
"{",
"if",
"(",
"category",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"CONTEXTS",
".",
"get",
"(",
"category",
")",
";",
"}"
] | Retrieve statistics context of the given category.
@return the related {@link StatisticsContext}, <code>null</code> otherwise. | [
"Retrieve",
"statistics",
"context",
"of",
"the",
"given",
"category",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L330-L337 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.formatName | static String formatName(String name)
{
return name == null ? null : name.replaceAll(" ", "").replaceAll("[,;]", ", ");
} | java | static String formatName(String name)
{
return name == null ? null : name.replaceAll(" ", "").replaceAll("[,;]", ", ");
} | [
"static",
"String",
"formatName",
"(",
"String",
"name",
")",
"{",
"return",
"name",
"==",
"null",
"?",
"null",
":",
"name",
".",
"replaceAll",
"(",
"\" \"",
",",
"\"\"",
")",
".",
"replaceAll",
"(",
"\"[,;]\"",
",",
"\", \"",
")",
";",
"}"
] | Format the name of the statistics in the target format
@param name the name of the statistics requested
@return the formated statistics name | [
"Format",
"the",
"name",
"of",
"the",
"statistics",
"in",
"the",
"target",
"format"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L344-L347 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.getStatistics | private static Statistics getStatistics(String category, String name)
{
StatisticsContext context = getContext(category);
if (context == null)
{
return null;
}
// Format the name
name = formatName(name);
if (name == null)
{
return null;
}
... | java | private static Statistics getStatistics(String category, String name)
{
StatisticsContext context = getContext(category);
if (context == null)
{
return null;
}
// Format the name
name = formatName(name);
if (name == null)
{
return null;
}
... | [
"private",
"static",
"Statistics",
"getStatistics",
"(",
"String",
"category",
",",
"String",
"name",
")",
"{",
"StatisticsContext",
"context",
"=",
"getContext",
"(",
"category",
")",
";",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
"null",
";",... | Retrieve statistics of the given category and name.
@return the related {@link Statistics}, <code>null</code> otherwise. | [
"Retrieve",
"statistics",
"of",
"the",
"given",
"category",
"and",
"name",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L353-L376 | train |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.resetAll | @Managed
@ManagedDescription("Reset all the statistics.")
public static void resetAll(
@ManagedDescription("The name of the category of the statistics")
@ManagedName("categoryName") String category)
{
StatisticsContext context = getContext(category);
if (context != null)
{
... | java | @Managed
@ManagedDescription("Reset all the statistics.")
public static void resetAll(
@ManagedDescription("The name of the category of the statistics")
@ManagedName("categoryName") String category)
{
StatisticsContext context = getContext(category);
if (context != null)
{
... | [
"@",
"Managed",
"@",
"ManagedDescription",
"(",
"\"Reset all the statistics.\"",
")",
"public",
"static",
"void",
"resetAll",
"(",
"@",
"ManagedDescription",
"(",
"\"The name of the category of the statistics\"",
")",
"@",
"ManagedName",
"(",
"\"categoryName\"",
")",
"Str... | Allows to reset all the statistics corresponding to the given category.
@param category | [
"Allows",
"to",
"reset",
"all",
"the",
"statistics",
"corresponding",
"to",
"the",
"given",
"category",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L482-L493 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.