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
sequence | docstring
stringlengths 3
16k
| docstring_tokens
sequence | sha
stringlengths 40
40
| url
stringlengths 105
339
| partition
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java | PartialMatch.remove | void remove(PatternWrapper pattern, Conjunction selector, MatchTarget object,
InternTable subExpr, OrdinalPosition parentId) throws MatchingException {
if (tc.isEntryEnabled())
tc.entry(this,cclass, "remove", new Object[]{pattern,selector,object,subExpr});
switch (pattern.getState()) {
case PatternWrapper.FINAL_EXACT:
exactChild = exactChild.remove(selector, object, subExpr, parentId);
break;
case PatternWrapper.FINAL_MANY:
if(hasMidClauses(pattern))
{
// We have multiple multi-level wildcarding and need to work with the
// matchManyChildren list
MatchManyWrapper wrapper = findMatchManyWrapper(pattern);
// if we couldn't find the wrapper, throw an exception
if (wrapper == null)
throw new MatchingException();
ContentMatcher next = wrapper.matcher;
ContentMatcher newNext =
(ContentMatcher) next.remove(selector, object, subExpr, parentId);
if (newNext == null)
matchManyChildren.remove(wrapper);
else if (newNext != next)
{
MatchManyWrapper newWrapper = new MatchManyWrapper(pattern, newNext);
matchManyChildren.add(newWrapper);
}
}
else
{
// Simpler case where there is a single multi-level wildcard
singleMatchManyChild =
singleMatchManyChild.remove(selector, object, subExpr, parentId);
}
break;
case PatternWrapper.PREFIX_CHARS:
case PatternWrapper.SUFFIX_CHARS:
char[] chars = pattern.getChars();
for (PartialMatch pm = this ;; pm = pm.next) {
if (pm == null)
throw new MatchingException();
if (Arrays.equals(chars, pm.key)) {
pm.remove(pattern, selector, object, subExpr, parentId);
break;
}
}
break;
case PatternWrapper.SKIP_ONE_PREFIX:
case PatternWrapper.SKIP_ONE_SUFFIX:
pattern.advance();
matchOneChild.remove(pattern, selector, object, subExpr, parentId);
if (matchOneChild.isEmptyChain())
matchOneChild = null;
break;
case PatternWrapper.SWITCH_TO_SUFFIX:
pattern.advance();
suffix.remove(pattern, selector, object, subExpr, parentId);
if (suffix.isEmptyChain())
suffix = null;
break;
}
if (key.length == 0)
cleanChain();
if (tc.isEntryEnabled())
tc.exit(this,cclass, "remove");
} | java | void remove(PatternWrapper pattern, Conjunction selector, MatchTarget object,
InternTable subExpr, OrdinalPosition parentId) throws MatchingException {
if (tc.isEntryEnabled())
tc.entry(this,cclass, "remove", new Object[]{pattern,selector,object,subExpr});
switch (pattern.getState()) {
case PatternWrapper.FINAL_EXACT:
exactChild = exactChild.remove(selector, object, subExpr, parentId);
break;
case PatternWrapper.FINAL_MANY:
if(hasMidClauses(pattern))
{
// We have multiple multi-level wildcarding and need to work with the
// matchManyChildren list
MatchManyWrapper wrapper = findMatchManyWrapper(pattern);
// if we couldn't find the wrapper, throw an exception
if (wrapper == null)
throw new MatchingException();
ContentMatcher next = wrapper.matcher;
ContentMatcher newNext =
(ContentMatcher) next.remove(selector, object, subExpr, parentId);
if (newNext == null)
matchManyChildren.remove(wrapper);
else if (newNext != next)
{
MatchManyWrapper newWrapper = new MatchManyWrapper(pattern, newNext);
matchManyChildren.add(newWrapper);
}
}
else
{
// Simpler case where there is a single multi-level wildcard
singleMatchManyChild =
singleMatchManyChild.remove(selector, object, subExpr, parentId);
}
break;
case PatternWrapper.PREFIX_CHARS:
case PatternWrapper.SUFFIX_CHARS:
char[] chars = pattern.getChars();
for (PartialMatch pm = this ;; pm = pm.next) {
if (pm == null)
throw new MatchingException();
if (Arrays.equals(chars, pm.key)) {
pm.remove(pattern, selector, object, subExpr, parentId);
break;
}
}
break;
case PatternWrapper.SKIP_ONE_PREFIX:
case PatternWrapper.SKIP_ONE_SUFFIX:
pattern.advance();
matchOneChild.remove(pattern, selector, object, subExpr, parentId);
if (matchOneChild.isEmptyChain())
matchOneChild = null;
break;
case PatternWrapper.SWITCH_TO_SUFFIX:
pattern.advance();
suffix.remove(pattern, selector, object, subExpr, parentId);
if (suffix.isEmptyChain())
suffix = null;
break;
}
if (key.length == 0)
cleanChain();
if (tc.isEntryEnabled())
tc.exit(this,cclass, "remove");
} | [
"void",
"remove",
"(",
"PatternWrapper",
"pattern",
",",
"Conjunction",
"selector",
",",
"MatchTarget",
"object",
",",
"InternTable",
"subExpr",
",",
"OrdinalPosition",
"parentId",
")",
"throws",
"MatchingException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"entry",
"(",
"this",
",",
"cclass",
",",
"\"remove\"",
",",
"new",
"Object",
"[",
"]",
"{",
"pattern",
",",
"selector",
",",
"object",
",",
"subExpr",
"}",
")",
";",
"switch",
"(",
"pattern",
".",
"getState",
"(",
")",
")",
"{",
"case",
"PatternWrapper",
".",
"FINAL_EXACT",
":",
"exactChild",
"=",
"exactChild",
".",
"remove",
"(",
"selector",
",",
"object",
",",
"subExpr",
",",
"parentId",
")",
";",
"break",
";",
"case",
"PatternWrapper",
".",
"FINAL_MANY",
":",
"if",
"(",
"hasMidClauses",
"(",
"pattern",
")",
")",
"{",
"// We have multiple multi-level wildcarding and need to work with the",
"// matchManyChildren list",
"MatchManyWrapper",
"wrapper",
"=",
"findMatchManyWrapper",
"(",
"pattern",
")",
";",
"// if we couldn't find the wrapper, throw an exception ",
"if",
"(",
"wrapper",
"==",
"null",
")",
"throw",
"new",
"MatchingException",
"(",
")",
";",
"ContentMatcher",
"next",
"=",
"wrapper",
".",
"matcher",
";",
"ContentMatcher",
"newNext",
"=",
"(",
"ContentMatcher",
")",
"next",
".",
"remove",
"(",
"selector",
",",
"object",
",",
"subExpr",
",",
"parentId",
")",
";",
"if",
"(",
"newNext",
"==",
"null",
")",
"matchManyChildren",
".",
"remove",
"(",
"wrapper",
")",
";",
"else",
"if",
"(",
"newNext",
"!=",
"next",
")",
"{",
"MatchManyWrapper",
"newWrapper",
"=",
"new",
"MatchManyWrapper",
"(",
"pattern",
",",
"newNext",
")",
";",
"matchManyChildren",
".",
"add",
"(",
"newWrapper",
")",
";",
"}",
"}",
"else",
"{",
"// Simpler case where there is a single multi-level wildcard",
"singleMatchManyChild",
"=",
"singleMatchManyChild",
".",
"remove",
"(",
"selector",
",",
"object",
",",
"subExpr",
",",
"parentId",
")",
";",
"}",
"break",
";",
"case",
"PatternWrapper",
".",
"PREFIX_CHARS",
":",
"case",
"PatternWrapper",
".",
"SUFFIX_CHARS",
":",
"char",
"[",
"]",
"chars",
"=",
"pattern",
".",
"getChars",
"(",
")",
";",
"for",
"(",
"PartialMatch",
"pm",
"=",
"this",
";",
";",
"pm",
"=",
"pm",
".",
"next",
")",
"{",
"if",
"(",
"pm",
"==",
"null",
")",
"throw",
"new",
"MatchingException",
"(",
")",
";",
"if",
"(",
"Arrays",
".",
"equals",
"(",
"chars",
",",
"pm",
".",
"key",
")",
")",
"{",
"pm",
".",
"remove",
"(",
"pattern",
",",
"selector",
",",
"object",
",",
"subExpr",
",",
"parentId",
")",
";",
"break",
";",
"}",
"}",
"break",
";",
"case",
"PatternWrapper",
".",
"SKIP_ONE_PREFIX",
":",
"case",
"PatternWrapper",
".",
"SKIP_ONE_SUFFIX",
":",
"pattern",
".",
"advance",
"(",
")",
";",
"matchOneChild",
".",
"remove",
"(",
"pattern",
",",
"selector",
",",
"object",
",",
"subExpr",
",",
"parentId",
")",
";",
"if",
"(",
"matchOneChild",
".",
"isEmptyChain",
"(",
")",
")",
"matchOneChild",
"=",
"null",
";",
"break",
";",
"case",
"PatternWrapper",
".",
"SWITCH_TO_SUFFIX",
":",
"pattern",
".",
"advance",
"(",
")",
";",
"suffix",
".",
"remove",
"(",
"pattern",
",",
"selector",
",",
"object",
",",
"subExpr",
",",
"parentId",
")",
";",
"if",
"(",
"suffix",
".",
"isEmptyChain",
"(",
")",
")",
"suffix",
"=",
"null",
";",
"break",
";",
"}",
"if",
"(",
"key",
".",
"length",
"==",
"0",
")",
"cleanChain",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"remove\"",
")",
";",
"}"
] | Remove a Pattern or part thereof from this PartialMatch or its down-chain peers
@param pattern the Pattern being considered, wrapped in a PatternWrapper
@param selector the Conjunction from the original ContentMatcher.remove
@param object the MatchTarget from the original ContentMatcher.remove
@param subExpr the InternTable from the original ContentMatcher.remove | [
"Remove",
"a",
"Pattern",
"or",
"part",
"thereof",
"from",
"this",
"PartialMatch",
"or",
"its",
"down",
"-",
"chain",
"peers"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java#L321-L387 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java | PartialMatch.get | void get(char[] chars, int start, int length, boolean invert, MatchSpaceKey msg,
EvalCache cache, Object contextValue, SearchResults result)
throws MatchingException, BadMessageFormatMatchingException {
if (tc.isEntryEnabled())
tc.entry(this,cclass, "get", new Object[]{chars,new Integer(start),new Integer(length),
new Boolean(invert),msg,cache,result});
examineMatches:
for (PartialMatch pm = this; pm != null && length >= pm.key.length; pm = pm.next) {
int origin = invert ? (start + length - pm.key.length) : start;
for (int i = 0; i < pm.key.length; i++)
if (pm.key[i] != chars[origin + i])
continue examineMatches;
// A match on pm; either it exhausts chars (exact) or only part thereof
if (length == pm.key.length) {
// An exact match fires both exactChild and matchManyChild
if (pm.exactChild != null)
pm.exactChild.get(null, msg, cache, contextValue, result);
// Process just the default MatchManyChild
if (pm.singleMatchManyChild != null)
pm.singleMatchManyChild.get(null, msg, cache, contextValue, result);
}
else
if (!invert)
pm.doPartialGet(chars, start + pm.key.length, length-pm.key.length, false,
msg, cache, contextValue, result);
else
pm.doPartialGet(chars, start, length-pm.key.length, true, msg, cache, contextValue, result);
}
if (tc.isEntryEnabled())
tc.exit(this,cclass, "get");
} | java | void get(char[] chars, int start, int length, boolean invert, MatchSpaceKey msg,
EvalCache cache, Object contextValue, SearchResults result)
throws MatchingException, BadMessageFormatMatchingException {
if (tc.isEntryEnabled())
tc.entry(this,cclass, "get", new Object[]{chars,new Integer(start),new Integer(length),
new Boolean(invert),msg,cache,result});
examineMatches:
for (PartialMatch pm = this; pm != null && length >= pm.key.length; pm = pm.next) {
int origin = invert ? (start + length - pm.key.length) : start;
for (int i = 0; i < pm.key.length; i++)
if (pm.key[i] != chars[origin + i])
continue examineMatches;
// A match on pm; either it exhausts chars (exact) or only part thereof
if (length == pm.key.length) {
// An exact match fires both exactChild and matchManyChild
if (pm.exactChild != null)
pm.exactChild.get(null, msg, cache, contextValue, result);
// Process just the default MatchManyChild
if (pm.singleMatchManyChild != null)
pm.singleMatchManyChild.get(null, msg, cache, contextValue, result);
}
else
if (!invert)
pm.doPartialGet(chars, start + pm.key.length, length-pm.key.length, false,
msg, cache, contextValue, result);
else
pm.doPartialGet(chars, start, length-pm.key.length, true, msg, cache, contextValue, result);
}
if (tc.isEntryEnabled())
tc.exit(this,cclass, "get");
} | [
"void",
"get",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"start",
",",
"int",
"length",
",",
"boolean",
"invert",
",",
"MatchSpaceKey",
"msg",
",",
"EvalCache",
"cache",
",",
"Object",
"contextValue",
",",
"SearchResults",
"result",
")",
"throws",
"MatchingException",
",",
"BadMessageFormatMatchingException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"entry",
"(",
"this",
",",
"cclass",
",",
"\"get\"",
",",
"new",
"Object",
"[",
"]",
"{",
"chars",
",",
"new",
"Integer",
"(",
"start",
")",
",",
"new",
"Integer",
"(",
"length",
")",
",",
"new",
"Boolean",
"(",
"invert",
")",
",",
"msg",
",",
"cache",
",",
"result",
"}",
")",
";",
"examineMatches",
":",
"for",
"(",
"PartialMatch",
"pm",
"=",
"this",
";",
"pm",
"!=",
"null",
"&&",
"length",
">=",
"pm",
".",
"key",
".",
"length",
";",
"pm",
"=",
"pm",
".",
"next",
")",
"{",
"int",
"origin",
"=",
"invert",
"?",
"(",
"start",
"+",
"length",
"-",
"pm",
".",
"key",
".",
"length",
")",
":",
"start",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pm",
".",
"key",
".",
"length",
";",
"i",
"++",
")",
"if",
"(",
"pm",
".",
"key",
"[",
"i",
"]",
"!=",
"chars",
"[",
"origin",
"+",
"i",
"]",
")",
"continue",
"examineMatches",
";",
"// A match on pm; either it exhausts chars (exact) or only part thereof",
"if",
"(",
"length",
"==",
"pm",
".",
"key",
".",
"length",
")",
"{",
"// An exact match fires both exactChild and matchManyChild",
"if",
"(",
"pm",
".",
"exactChild",
"!=",
"null",
")",
"pm",
".",
"exactChild",
".",
"get",
"(",
"null",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"// Process just the default MatchManyChild",
"if",
"(",
"pm",
".",
"singleMatchManyChild",
"!=",
"null",
")",
"pm",
".",
"singleMatchManyChild",
".",
"get",
"(",
"null",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"}",
"else",
"if",
"(",
"!",
"invert",
")",
"pm",
".",
"doPartialGet",
"(",
"chars",
",",
"start",
"+",
"pm",
".",
"key",
".",
"length",
",",
"length",
"-",
"pm",
".",
"key",
".",
"length",
",",
"false",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"else",
"pm",
".",
"doPartialGet",
"(",
"chars",
",",
"start",
",",
"length",
"-",
"pm",
".",
"key",
".",
"length",
",",
"true",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"get\"",
")",
";",
"}"
] | Perform get operation on this PartialMatch and its descendents
@param chars the array of characters containing the value of the Identifier
@param start the start character within chars
@param length the number of characters to consider within chars
@param invert perform suffix matching (examine the end of the range first)
@param msg the MatchSpaceKey to be passed to ContentMatchers lower in the tree
@param cache the EvalCache to be passed to ContentMatchers lower in the tree
@param result the SearchResults to accumulate any results | [
"Perform",
"get",
"operation",
"on",
"this",
"PartialMatch",
"and",
"its",
"descendents"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java#L398-L428 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java | PartialMatch.doPartialGet | void doPartialGet(char[] chars, int start, int length, boolean invert, MatchSpaceKey msg,
EvalCache cache, Object contextValue, SearchResults result)
throws MatchingException, BadMessageFormatMatchingException {
if (tc.isEntryEnabled())
tc.entry(this,cclass, "doPartialGet", new Object[] {chars,new Integer(start),
new Integer(length),new Boolean(invert),msg,cache,result});
if (matchOneChild != null)
if (!invert)
matchOneChild.get(chars, start+1, length-1, false, msg, cache, contextValue, result);
else
matchOneChild.get(chars, start, length-1, true, msg, cache, contextValue, result);
if (suffix != null)
suffix.get(chars, start, length, true, msg, cache, contextValue, result);
getFromManyChildMatchers(chars, start, length, msg, cache, contextValue, result);
if (tc.isEntryEnabled())
tc.exit(this,cclass, "doPartialGet");
} | java | void doPartialGet(char[] chars, int start, int length, boolean invert, MatchSpaceKey msg,
EvalCache cache, Object contextValue, SearchResults result)
throws MatchingException, BadMessageFormatMatchingException {
if (tc.isEntryEnabled())
tc.entry(this,cclass, "doPartialGet", new Object[] {chars,new Integer(start),
new Integer(length),new Boolean(invert),msg,cache,result});
if (matchOneChild != null)
if (!invert)
matchOneChild.get(chars, start+1, length-1, false, msg, cache, contextValue, result);
else
matchOneChild.get(chars, start, length-1, true, msg, cache, contextValue, result);
if (suffix != null)
suffix.get(chars, start, length, true, msg, cache, contextValue, result);
getFromManyChildMatchers(chars, start, length, msg, cache, contextValue, result);
if (tc.isEntryEnabled())
tc.exit(this,cclass, "doPartialGet");
} | [
"void",
"doPartialGet",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"start",
",",
"int",
"length",
",",
"boolean",
"invert",
",",
"MatchSpaceKey",
"msg",
",",
"EvalCache",
"cache",
",",
"Object",
"contextValue",
",",
"SearchResults",
"result",
")",
"throws",
"MatchingException",
",",
"BadMessageFormatMatchingException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"entry",
"(",
"this",
",",
"cclass",
",",
"\"doPartialGet\"",
",",
"new",
"Object",
"[",
"]",
"{",
"chars",
",",
"new",
"Integer",
"(",
"start",
")",
",",
"new",
"Integer",
"(",
"length",
")",
",",
"new",
"Boolean",
"(",
"invert",
")",
",",
"msg",
",",
"cache",
",",
"result",
"}",
")",
";",
"if",
"(",
"matchOneChild",
"!=",
"null",
")",
"if",
"(",
"!",
"invert",
")",
"matchOneChild",
".",
"get",
"(",
"chars",
",",
"start",
"+",
"1",
",",
"length",
"-",
"1",
",",
"false",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"else",
"matchOneChild",
".",
"get",
"(",
"chars",
",",
"start",
",",
"length",
"-",
"1",
",",
"true",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"if",
"(",
"suffix",
"!=",
"null",
")",
"suffix",
".",
"get",
"(",
"chars",
",",
"start",
",",
"length",
",",
"true",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"getFromManyChildMatchers",
"(",
"chars",
",",
"start",
",",
"length",
",",
"msg",
",",
"cache",
",",
"contextValue",
",",
"result",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"doPartialGet\"",
")",
";",
"}"
] | Take action when a portion of a String matches this PartialMatch but is not
exhausted by it
@param chars the characters containing the value
@param start the start of the range of characters remaining after the partial match
@param length the number of characters remaining after the partial match (> 0)
@param invert perform suffix matching (examine the end of the range first)
@param msg MatchSpaceKey to be passed to lower ContentMatchers
@param cache EvalCache to be passed to lower ContentMatchers
@param result SearchResults to be passed to lower ContentMatchers | [
"Take",
"action",
"when",
"a",
"portion",
"of",
"a",
"String",
"matches",
"this",
"PartialMatch",
"but",
"is",
"not",
"exhausted",
"by",
"it"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java#L440-L456 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java | PartialMatch.findMatchManyWrapper | private MatchManyWrapper findMatchManyWrapper(PatternWrapper pattern)
{
MatchManyWrapper wrapper = null;
if (matchManyChildren != null)
{
// Iterate over the matchManyChildren
Iterator iter = matchManyChildren.iterator();
while(iter.hasNext())
{
MatchManyWrapper nextElement = (MatchManyWrapper) iter.next();
PatternWrapper nextPattern = nextElement.pattern;
if(nextPattern.equals(pattern))
{
// We're done, we've found the matching pattern
wrapper = nextElement;
break;
}
} // eof while more children in the list
}
return wrapper;
} | java | private MatchManyWrapper findMatchManyWrapper(PatternWrapper pattern)
{
MatchManyWrapper wrapper = null;
if (matchManyChildren != null)
{
// Iterate over the matchManyChildren
Iterator iter = matchManyChildren.iterator();
while(iter.hasNext())
{
MatchManyWrapper nextElement = (MatchManyWrapper) iter.next();
PatternWrapper nextPattern = nextElement.pattern;
if(nextPattern.equals(pattern))
{
// We're done, we've found the matching pattern
wrapper = nextElement;
break;
}
} // eof while more children in the list
}
return wrapper;
} | [
"private",
"MatchManyWrapper",
"findMatchManyWrapper",
"(",
"PatternWrapper",
"pattern",
")",
"{",
"MatchManyWrapper",
"wrapper",
"=",
"null",
";",
"if",
"(",
"matchManyChildren",
"!=",
"null",
")",
"{",
"// Iterate over the matchManyChildren",
"Iterator",
"iter",
"=",
"matchManyChildren",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"MatchManyWrapper",
"nextElement",
"=",
"(",
"MatchManyWrapper",
")",
"iter",
".",
"next",
"(",
")",
";",
"PatternWrapper",
"nextPattern",
"=",
"nextElement",
".",
"pattern",
";",
"if",
"(",
"nextPattern",
".",
"equals",
"(",
"pattern",
")",
")",
"{",
"// We're done, we've found the matching pattern",
"wrapper",
"=",
"nextElement",
";",
"break",
";",
"}",
"}",
"// eof while more children in the list",
"}",
"return",
"wrapper",
";",
"}"
] | Locates a wrapped pattern+matcher pair where we've been give a pattern.
@param pattern
@return | [
"Locates",
"a",
"wrapped",
"pattern",
"+",
"matcher",
"pair",
"where",
"we",
"ve",
"been",
"give",
"a",
"pattern",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java#L514-L535 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatelessBeanO.java | StatelessBeanO.getCallerPrincipal | @Override
public Principal getCallerPrincipal() {
synchronized (this) {
if ((state == PRE_CREATE) || (state == CREATING) || (!allowRollbackOnly))
throw new IllegalStateException();
}
return super.getCallerPrincipal();
} | java | @Override
public Principal getCallerPrincipal() {
synchronized (this) {
if ((state == PRE_CREATE) || (state == CREATING) || (!allowRollbackOnly))
throw new IllegalStateException();
}
return super.getCallerPrincipal();
} | [
"@",
"Override",
"public",
"Principal",
"getCallerPrincipal",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"(",
"state",
"==",
"PRE_CREATE",
")",
"||",
"(",
"state",
"==",
"CREATING",
")",
"||",
"(",
"!",
"allowRollbackOnly",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"return",
"super",
".",
"getCallerPrincipal",
"(",
")",
";",
"}"
] | getCallerPrincipal is invalid if called within the setSessionContext
method | [
"getCallerPrincipal",
"is",
"invalid",
"if",
"called",
"within",
"the",
"setSessionContext",
"method"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatelessBeanO.java#L883-L892 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/MQLinkPubSubBridgeItemStream.java | MQLinkPubSubBridgeItemStream.getMQLinkHandler | public MQLinkHandler getMQLinkHandler()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getMQLinkHandler");
SibTr.exit(tc, "getMQLinkHandler", _mqLinkHandler);
}
return _mqLinkHandler;
} | java | public MQLinkHandler getMQLinkHandler()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getMQLinkHandler");
SibTr.exit(tc, "getMQLinkHandler", _mqLinkHandler);
}
return _mqLinkHandler;
} | [
"public",
"MQLinkHandler",
"getMQLinkHandler",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getMQLinkHandler\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getMQLinkHandler\"",
",",
"_mqLinkHandler",
")",
";",
"}",
"return",
"_mqLinkHandler",
";",
"}"
] | Returns the MQLinkHandler.
@return String | [
"Returns",
"the",
"MQLinkHandler",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/MQLinkPubSubBridgeItemStream.java#L101-L109 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/MQLinkPubSubBridgeItemStream.java | MQLinkPubSubBridgeItemStream.markAsToBeDeleted | public void markAsToBeDeleted(Transaction transaction) throws SIResourceException
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "markAsToBeDeleted", transaction);
toBeDeleted = Boolean.TRUE;
try
{
requestUpdate(transaction);
}
catch (MessageStoreException e)
{
// MessageStoreException shouldn't occur so FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.store.itemstreams.MQLinkPubSubBridgeItemStream.markAsToBeDeleted",
"1:151:1.16",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "markAsToBeDeleted", e);
throw new SIResourceException(e);
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "markAsToBeDeleted");
return;
} | java | public void markAsToBeDeleted(Transaction transaction) throws SIResourceException
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "markAsToBeDeleted", transaction);
toBeDeleted = Boolean.TRUE;
try
{
requestUpdate(transaction);
}
catch (MessageStoreException e)
{
// MessageStoreException shouldn't occur so FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.store.itemstreams.MQLinkPubSubBridgeItemStream.markAsToBeDeleted",
"1:151:1.16",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "markAsToBeDeleted", e);
throw new SIResourceException(e);
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "markAsToBeDeleted");
return;
} | [
"public",
"void",
"markAsToBeDeleted",
"(",
"Transaction",
"transaction",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"markAsToBeDeleted\"",
",",
"transaction",
")",
";",
"toBeDeleted",
"=",
"Boolean",
".",
"TRUE",
";",
"try",
"{",
"requestUpdate",
"(",
"transaction",
")",
";",
"}",
"catch",
"(",
"MessageStoreException",
"e",
")",
"{",
"// MessageStoreException shouldn't occur so FFDC.",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.store.itemstreams.MQLinkPubSubBridgeItemStream.markAsToBeDeleted\"",
",",
"\"1:151:1.16\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"markAsToBeDeleted\"",
",",
"e",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"e",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"markAsToBeDeleted\"",
")",
";",
"return",
";",
"}"
] | Mark this itemstream as awaiting deletion and harden the indicator
@throws SIStoreException | [
"Mark",
"this",
"itemstream",
"as",
"awaiting",
"deletion",
"and",
"harden",
"the",
"indicator"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/MQLinkPubSubBridgeItemStream.java#L114-L146 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java | NavigationHandlerImpl.getNavigationCase | public NavigationCase getNavigationCase(FacesContext facesContext, String fromAction, String outcome)
{
NavigationContext navigationContext = new NavigationContext();
try
{
return getNavigationCommand(facesContext, navigationContext, fromAction, outcome, null);
}
finally
{
navigationContext.finish(facesContext);
}
} | java | public NavigationCase getNavigationCase(FacesContext facesContext, String fromAction, String outcome)
{
NavigationContext navigationContext = new NavigationContext();
try
{
return getNavigationCommand(facesContext, navigationContext, fromAction, outcome, null);
}
finally
{
navigationContext.finish(facesContext);
}
} | [
"public",
"NavigationCase",
"getNavigationCase",
"(",
"FacesContext",
"facesContext",
",",
"String",
"fromAction",
",",
"String",
"outcome",
")",
"{",
"NavigationContext",
"navigationContext",
"=",
"new",
"NavigationContext",
"(",
")",
";",
"try",
"{",
"return",
"getNavigationCommand",
"(",
"facesContext",
",",
"navigationContext",
",",
"fromAction",
",",
"outcome",
",",
"null",
")",
";",
"}",
"finally",
"{",
"navigationContext",
".",
"finish",
"(",
"facesContext",
")",
";",
"}",
"}"
] | Returns the navigation case that applies for the given action and outcome | [
"Returns",
"the",
"navigation",
"case",
"that",
"applies",
"for",
"the",
"given",
"action",
"and",
"outcome"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java#L389-L400 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java | NavigationHandlerImpl.createNavigationCase | private NavigationCase createNavigationCase(String fromViewId, String outcome, String toViewId)
{
return new NavigationCase(fromViewId, null, outcome, null, toViewId, null, false, false);
} | java | private NavigationCase createNavigationCase(String fromViewId, String outcome, String toViewId)
{
return new NavigationCase(fromViewId, null, outcome, null, toViewId, null, false, false);
} | [
"private",
"NavigationCase",
"createNavigationCase",
"(",
"String",
"fromViewId",
",",
"String",
"outcome",
",",
"String",
"toViewId",
")",
"{",
"return",
"new",
"NavigationCase",
"(",
"fromViewId",
",",
"null",
",",
"outcome",
",",
"null",
",",
"toViewId",
",",
"null",
",",
"false",
",",
"false",
")",
";",
"}"
] | Derive a NavigationCase from a flow node.
@param flowNode
@return | [
"Derive",
"a",
"NavigationCase",
"from",
"a",
"flow",
"node",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java#L941-L944 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java | NavigationHandlerImpl.getViewId | public String getViewId(FacesContext context, String fromAction, String outcome)
{
return this.getNavigationCase(context, fromAction, outcome).getToViewId(context);
} | java | public String getViewId(FacesContext context, String fromAction, String outcome)
{
return this.getNavigationCase(context, fromAction, outcome).getToViewId(context);
} | [
"public",
"String",
"getViewId",
"(",
"FacesContext",
"context",
",",
"String",
"fromAction",
",",
"String",
"outcome",
")",
"{",
"return",
"this",
".",
"getNavigationCase",
"(",
"context",
",",
"fromAction",
",",
"outcome",
")",
".",
"getToViewId",
"(",
"context",
")",
";",
"}"
] | Returns the view ID that would be created for the given action and outcome | [
"Returns",
"the",
"view",
"ID",
"that",
"would",
"be",
"created",
"for",
"the",
"given",
"action",
"and",
"outcome"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java#L1155-L1158 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.sse.3.2/src/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java | SseEventSourceImpl.handleRetry | @FFDCIgnore({NumberFormatException.class, IllegalArgumentException.class, ParseException.class})
private long handleRetry(String retryValue) {
// RETRY_AFTER is a String that can either correspond to seconds (long)
// or a HTTP-Date (which can be one of 7 variations)"
if (!(retryValue.contains(":"))) {
// Must be a long since all dates include ":"
try {
Long retryLong = Long.valueOf(retryValue);
//The RETRY_AFTER value is in seconds so change units
return TimeUnit.MILLISECONDS.convert(retryLong.longValue(), TimeUnit.SECONDS);
} catch (NumberFormatException e) {
LOG.fine("SSE RETRY_AFTER Incorrect time value: " + e);
}
} else {
char[] retryValueArray = retryValue.toCharArray();
//handle date
try {
SimpleDateFormat sdf = null;
// Determine the appropriate HTTP-Date pattern
if (retryValueArray[3] == ',') {
sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z"); // RTC 822, updated by RFC 1123
} else if (retryValueArray[6] == ',') {
sdf = new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[7] == ',') {
sdf = new SimpleDateFormat("EEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[8] == ',') {
sdf = new SimpleDateFormat("EEEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[9] == ',') {
sdf = new SimpleDateFormat("EEEEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[8] == ',') {
sdf = new SimpleDateFormat("EEEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[8] == ' ') {
sdf = new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy"); // ANSI C's asctime() format
} else {
sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy"); // ANSI C's asctime() format
}
Date retryDate = sdf.parse(retryValue);
long retryTime = retryDate.getTime();
long now = System.currentTimeMillis();
long delayTime = retryTime - now;
if (delayTime > 0) {
return delayTime;//HTTP Date is in milliseconds
}
LOG.fine("SSE RETRY_AFTER Date value represents a time already past");
} catch (IllegalArgumentException ex) {
LOG.fine("SSE RETRY_AFTER Date value format incorrect: " + ex);
} catch (ParseException e2) {
LOG.fine("SSE RETRY_AFTER Date value cannot be parsed: " + e2);
}
}
return -1L;
} | java | @FFDCIgnore({NumberFormatException.class, IllegalArgumentException.class, ParseException.class})
private long handleRetry(String retryValue) {
// RETRY_AFTER is a String that can either correspond to seconds (long)
// or a HTTP-Date (which can be one of 7 variations)"
if (!(retryValue.contains(":"))) {
// Must be a long since all dates include ":"
try {
Long retryLong = Long.valueOf(retryValue);
//The RETRY_AFTER value is in seconds so change units
return TimeUnit.MILLISECONDS.convert(retryLong.longValue(), TimeUnit.SECONDS);
} catch (NumberFormatException e) {
LOG.fine("SSE RETRY_AFTER Incorrect time value: " + e);
}
} else {
char[] retryValueArray = retryValue.toCharArray();
//handle date
try {
SimpleDateFormat sdf = null;
// Determine the appropriate HTTP-Date pattern
if (retryValueArray[3] == ',') {
sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z"); // RTC 822, updated by RFC 1123
} else if (retryValueArray[6] == ',') {
sdf = new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[7] == ',') {
sdf = new SimpleDateFormat("EEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[8] == ',') {
sdf = new SimpleDateFormat("EEEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[9] == ',') {
sdf = new SimpleDateFormat("EEEEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[8] == ',') {
sdf = new SimpleDateFormat("EEEEEEEE, dd-MMM-yy HH:mm:ss z"); // RFC 850, obsoleted by RFC 1036
} else if (retryValueArray[8] == ' ') {
sdf = new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy"); // ANSI C's asctime() format
} else {
sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy"); // ANSI C's asctime() format
}
Date retryDate = sdf.parse(retryValue);
long retryTime = retryDate.getTime();
long now = System.currentTimeMillis();
long delayTime = retryTime - now;
if (delayTime > 0) {
return delayTime;//HTTP Date is in milliseconds
}
LOG.fine("SSE RETRY_AFTER Date value represents a time already past");
} catch (IllegalArgumentException ex) {
LOG.fine("SSE RETRY_AFTER Date value format incorrect: " + ex);
} catch (ParseException e2) {
LOG.fine("SSE RETRY_AFTER Date value cannot be parsed: " + e2);
}
}
return -1L;
} | [
"@",
"FFDCIgnore",
"(",
"{",
"NumberFormatException",
".",
"class",
",",
"IllegalArgumentException",
".",
"class",
",",
"ParseException",
".",
"class",
"}",
")",
"private",
"long",
"handleRetry",
"(",
"String",
"retryValue",
")",
"{",
"// RETRY_AFTER is a String that can either correspond to seconds (long) ",
"// or a HTTP-Date (which can be one of 7 variations)\"",
"if",
"(",
"!",
"(",
"retryValue",
".",
"contains",
"(",
"\":\"",
")",
")",
")",
"{",
"// Must be a long since all dates include \":\"",
"try",
"{",
"Long",
"retryLong",
"=",
"Long",
".",
"valueOf",
"(",
"retryValue",
")",
";",
"//The RETRY_AFTER value is in seconds so change units",
"return",
"TimeUnit",
".",
"MILLISECONDS",
".",
"convert",
"(",
"retryLong",
".",
"longValue",
"(",
")",
",",
"TimeUnit",
".",
"SECONDS",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"LOG",
".",
"fine",
"(",
"\"SSE RETRY_AFTER Incorrect time value: \"",
"+",
"e",
")",
";",
"}",
"}",
"else",
"{",
"char",
"[",
"]",
"retryValueArray",
"=",
"retryValue",
".",
"toCharArray",
"(",
")",
";",
"//handle date",
"try",
"{",
"SimpleDateFormat",
"sdf",
"=",
"null",
";",
"// Determine the appropriate HTTP-Date pattern",
"if",
"(",
"retryValueArray",
"[",
"3",
"]",
"==",
"'",
"'",
")",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEE, dd MMM yyyy HH:mm:ss z\"",
")",
";",
"// RTC 822, updated by RFC 1123",
"}",
"else",
"if",
"(",
"retryValueArray",
"[",
"6",
"]",
"==",
"'",
"'",
")",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEEEEE, dd-MMM-yy HH:mm:ss z\"",
")",
";",
"// RFC 850, obsoleted by RFC 1036",
"}",
"else",
"if",
"(",
"retryValueArray",
"[",
"7",
"]",
"==",
"'",
"'",
")",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEEEEEE, dd-MMM-yy HH:mm:ss z\"",
")",
";",
"// RFC 850, obsoleted by RFC 1036",
"}",
"else",
"if",
"(",
"retryValueArray",
"[",
"8",
"]",
"==",
"'",
"'",
")",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEEEEEEE, dd-MMM-yy HH:mm:ss z\"",
")",
";",
"// RFC 850, obsoleted by RFC 1036",
"}",
"else",
"if",
"(",
"retryValueArray",
"[",
"9",
"]",
"==",
"'",
"'",
")",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEEEEEEEE, dd-MMM-yy HH:mm:ss z\"",
")",
";",
"// RFC 850, obsoleted by RFC 1036",
"}",
"else",
"if",
"(",
"retryValueArray",
"[",
"8",
"]",
"==",
"'",
"'",
")",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEEEEEEE, dd-MMM-yy HH:mm:ss z\"",
")",
";",
"// RFC 850, obsoleted by RFC 1036",
"}",
"else",
"if",
"(",
"retryValueArray",
"[",
"8",
"]",
"==",
"'",
"'",
")",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEE MMM d HH:mm:ss yyyy\"",
")",
";",
"// ANSI C's asctime() format",
"}",
"else",
"{",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"EEE MMM dd HH:mm:ss yyyy\"",
")",
";",
"// ANSI C's asctime() format",
"}",
"Date",
"retryDate",
"=",
"sdf",
".",
"parse",
"(",
"retryValue",
")",
";",
"long",
"retryTime",
"=",
"retryDate",
".",
"getTime",
"(",
")",
";",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"delayTime",
"=",
"retryTime",
"-",
"now",
";",
"if",
"(",
"delayTime",
">",
"0",
")",
"{",
"return",
"delayTime",
";",
"//HTTP Date is in milliseconds",
"}",
"LOG",
".",
"fine",
"(",
"\"SSE RETRY_AFTER Date value represents a time already past\"",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"ex",
")",
"{",
"LOG",
".",
"fine",
"(",
"\"SSE RETRY_AFTER Date value format incorrect: \"",
"+",
"ex",
")",
";",
"}",
"catch",
"(",
"ParseException",
"e2",
")",
"{",
"LOG",
".",
"fine",
"(",
"\"SSE RETRY_AFTER Date value cannot be parsed: \"",
"+",
"e2",
")",
";",
"}",
"}",
"return",
"-",
"1L",
";",
"}"
] | return the milliseconds to delay before reconnecting; -1 means don't reconnect | [
"return",
"the",
"milliseconds",
"to",
"delay",
"before",
"reconnecting",
";",
"-",
"1",
"means",
"don",
"t",
"reconnect"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.sse.3.2/src/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java#L319-L374 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.WASInstallDirectory | public static final void WASInstallDirectory(String WASInstallDirectory)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "WASInstallDirectory", WASInstallDirectory);
_WASInstallDirectory = WASInstallDirectory;
if (tc.isEntryEnabled())
Tr.exit(tc, "WASInstallDirectory");
} | java | public static final void WASInstallDirectory(String WASInstallDirectory)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "WASInstallDirectory", WASInstallDirectory);
_WASInstallDirectory = WASInstallDirectory;
if (tc.isEntryEnabled())
Tr.exit(tc, "WASInstallDirectory");
} | [
"public",
"static",
"final",
"void",
"WASInstallDirectory",
"(",
"String",
"WASInstallDirectory",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"WASInstallDirectory\"",
",",
"WASInstallDirectory",
")",
";",
"_WASInstallDirectory",
"=",
"WASInstallDirectory",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"WASInstallDirectory\"",
")",
";",
"}"
] | Sets the WAS install directory.
@param WASInstallDirectory The WAS install directory | [
"Sets",
"the",
"WAS",
"install",
"directory",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L149-L158 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.cellName | public static final void cellName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "cellName", name);
_cellName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "cellName");
} | java | public static final void cellName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "cellName", name);
_cellName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "cellName");
} | [
"public",
"static",
"final",
"void",
"cellName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"cellName\"",
",",
"name",
")",
";",
"_cellName",
"=",
"name",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"cellName\"",
")",
";",
"}"
] | Sets the name of the cell in which the current server resides
@param name The name of the WAS cell. | [
"Sets",
"the",
"name",
"of",
"the",
"cell",
"in",
"which",
"the",
"current",
"server",
"resides"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L185-L194 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.clusterName | public static final void clusterName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "clusterName", name);
_clusterName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "clusterName");
} | java | public static final void clusterName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "clusterName", name);
_clusterName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "clusterName");
} | [
"public",
"static",
"final",
"void",
"clusterName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"clusterName\"",
",",
"name",
")",
";",
"_clusterName",
"=",
"name",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"clusterName\"",
")",
";",
"}"
] | Sets the name of the cluster in which the current server resides
@param name The name of the WAS cluster | [
"Sets",
"the",
"name",
"of",
"the",
"cluster",
"in",
"which",
"the",
"current",
"server",
"resides"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L221-L230 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.nodeName | public static final void nodeName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "nodeName", name);
_nodeName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "nodeName");
} | java | public static final void nodeName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "nodeName", name);
_nodeName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "nodeName");
} | [
"public",
"static",
"final",
"void",
"nodeName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"nodeName\"",
",",
"name",
")",
";",
"_nodeName",
"=",
"name",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"nodeName\"",
")",
";",
"}"
] | Sets the name of the node in which the current server resides
@param name The node name | [
"Sets",
"the",
"name",
"of",
"the",
"node",
"in",
"which",
"the",
"current",
"server",
"resides"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L257-L266 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.serverName | public static final void serverName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "serverName", name);
_serverName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "serverName");
} | java | public static final void serverName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "serverName", name);
_serverName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "serverName");
} | [
"public",
"static",
"final",
"void",
"serverName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"serverName\"",
",",
"name",
")",
";",
"_serverName",
"=",
"name",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"serverName\"",
")",
";",
"}"
] | Sets the name of the current WAS server
@param name The name of the WAS server | [
"Sets",
"the",
"name",
"of",
"the",
"current",
"WAS",
"server"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L293-L302 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.serverShortName | public static final void serverShortName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "serverShortName", name);
_serverShortName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "serverShortName");
} | java | public static final void serverShortName(String name)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "serverShortName", name);
_serverShortName = name;
if (tc.isEntryEnabled())
Tr.exit(tc, "serverShortName");
} | [
"public",
"static",
"final",
"void",
"serverShortName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"serverShortName\"",
",",
"name",
")",
";",
"_serverShortName",
"=",
"name",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"serverShortName\"",
")",
";",
"}"
] | Sets the short name of the current WAS server
@param name The short name of the WAS server | [
"Sets",
"the",
"short",
"name",
"of",
"the",
"current",
"WAS",
"server"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L329-L338 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.uuid | public static final void uuid(String uuid)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "uuid", uuid);
_uuid = uuid;
if (tc.isEntryEnabled())
Tr.exit(tc, "uuid");
} | java | public static final void uuid(String uuid)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "uuid", uuid);
_uuid = uuid;
if (tc.isEntryEnabled())
Tr.exit(tc, "uuid");
} | [
"public",
"static",
"final",
"void",
"uuid",
"(",
"String",
"uuid",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"uuid\"",
",",
"uuid",
")",
";",
"_uuid",
"=",
"uuid",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"uuid\"",
")",
";",
"}"
] | Sets the UUID of the current WAS server
@param name The UUID of the WAS server | [
"Sets",
"the",
"UUID",
"of",
"the",
"current",
"WAS",
"server"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L365-L374 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.fqServerName | public static final String fqServerName()
{
if (tc.isEntryEnabled())
Tr.entry(tc, "fqServerName");
String fqServerName = _serverName; // RLSUtils.FQHAMCompatibleServerName(_cellName,_nodeName,_serverName); tWAS
if (tc.isEntryEnabled())
Tr.exit(tc, "fqServerName", fqServerName);
return fqServerName;
} | java | public static final String fqServerName()
{
if (tc.isEntryEnabled())
Tr.entry(tc, "fqServerName");
String fqServerName = _serverName; // RLSUtils.FQHAMCompatibleServerName(_cellName,_nodeName,_serverName); tWAS
if (tc.isEntryEnabled())
Tr.exit(tc, "fqServerName", fqServerName);
return fqServerName;
} | [
"public",
"static",
"final",
"String",
"fqServerName",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"fqServerName\"",
")",
";",
"String",
"fqServerName",
"=",
"_serverName",
";",
"// RLSUtils.FQHAMCompatibleServerName(_cellName,_nodeName,_serverName); tWAS",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"fqServerName\"",
",",
"fqServerName",
")",
";",
"return",
"fqServerName",
";",
"}"
] | Gets the fully qualified name of the current WAS server
@return String The fully qualified name of the WAS server | [
"Gets",
"the",
"fully",
"qualified",
"name",
"of",
"the",
"current",
"WAS",
"server"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L401-L411 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.HAEnabled | public static final void HAEnabled(boolean HAEnabled)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "HAEnabled", new Boolean(HAEnabled));
_HAEnabled = HAEnabled;
if (tc.isEntryEnabled())
Tr.exit(tc, "HAEnabled");
} | java | public static final void HAEnabled(boolean HAEnabled)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "HAEnabled", new Boolean(HAEnabled));
_HAEnabled = HAEnabled;
if (tc.isEntryEnabled())
Tr.exit(tc, "HAEnabled");
} | [
"public",
"static",
"final",
"void",
"HAEnabled",
"(",
"boolean",
"HAEnabled",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"HAEnabled\"",
",",
"new",
"Boolean",
"(",
"HAEnabled",
")",
")",
";",
"_HAEnabled",
"=",
"HAEnabled",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"HAEnabled\"",
")",
";",
"}"
] | Sets the HAEnabled flag
@param HAEnabled The HAEnabled flag | [
"Sets",
"the",
"HAEnabled",
"flag"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L453-L462 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.localFailureScope | public static final void localFailureScope(FailureScope localFailureScope)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "localFailureScope", localFailureScope);
_localFailureScope = localFailureScope;
if (tc.isEntryEnabled())
Tr.exit(tc, "localFailureScope");
} | java | public static final void localFailureScope(FailureScope localFailureScope)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "localFailureScope", localFailureScope);
_localFailureScope = localFailureScope;
if (tc.isEntryEnabled())
Tr.exit(tc, "localFailureScope");
} | [
"public",
"static",
"final",
"void",
"localFailureScope",
"(",
"FailureScope",
"localFailureScope",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"localFailureScope\"",
",",
"localFailureScope",
")",
";",
"_localFailureScope",
"=",
"localFailureScope",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"localFailureScope\"",
")",
";",
"}"
] | Sets the local FailureScope reference.
@param localFailureScope The local FailureScope | [
"Sets",
"the",
"local",
"FailureScope",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L489-L498 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.isZOS | public static final boolean isZOS()
{
if (tc.isEntryEnabled())
Tr.entry(tc, "isZOS");
if (tc.isEntryEnabled())
Tr.exit(tc, "isZOS", new Boolean(_isZOS));
return _isZOS;
} | java | public static final boolean isZOS()
{
if (tc.isEntryEnabled())
Tr.entry(tc, "isZOS");
if (tc.isEntryEnabled())
Tr.exit(tc, "isZOS", new Boolean(_isZOS));
return _isZOS;
} | [
"public",
"static",
"final",
"boolean",
"isZOS",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"isZOS\"",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"isZOS\"",
",",
"new",
"Boolean",
"(",
"_isZOS",
")",
")",
";",
"return",
"_isZOS",
";",
"}"
] | Gets the isZOS flag.
@return boolean Flag to indicate if this is a zOS platform. | [
"Gets",
"the",
"isZOS",
"flag",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L544-L551 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java | Configuration.useFileLocking | public static final void useFileLocking(boolean useFileLocking)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "useFileLocking", new Boolean(useFileLocking));
_useFileLocking = useFileLocking;
if (tc.isEntryEnabled())
Tr.exit(tc, "useFileLocking");
} | java | public static final void useFileLocking(boolean useFileLocking)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "useFileLocking", new Boolean(useFileLocking));
_useFileLocking = useFileLocking;
if (tc.isEntryEnabled())
Tr.exit(tc, "useFileLocking");
} | [
"public",
"static",
"final",
"void",
"useFileLocking",
"(",
"boolean",
"useFileLocking",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"useFileLocking\"",
",",
"new",
"Boolean",
"(",
"useFileLocking",
")",
")",
";",
"_useFileLocking",
"=",
"useFileLocking",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"useFileLocking\"",
")",
";",
"}"
] | Sets the useFileLocking flag. | [
"Sets",
"the",
"useFileLocking",
"flag",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L559-L568 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java | AppBndAuthorizationTableService.registerDefaultDelegationProvider | private void registerDefaultDelegationProvider(ComponentContext cc) {
defaultDelegationProvider = new DefaultDelegationProvider();
defaultDelegationProvider.setSecurityService(securityServiceRef.getService());
defaultDelegationProvider.setIdentityStoreHandlerService(identityStoreHandlerServiceRef);
BundleContext bc = cc.getBundleContext();
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put("type", "defaultProvider");
defaultDelegationProviderReg = bc.registerService(DelegationProvider.class,
defaultDelegationProvider,
props);
} | java | private void registerDefaultDelegationProvider(ComponentContext cc) {
defaultDelegationProvider = new DefaultDelegationProvider();
defaultDelegationProvider.setSecurityService(securityServiceRef.getService());
defaultDelegationProvider.setIdentityStoreHandlerService(identityStoreHandlerServiceRef);
BundleContext bc = cc.getBundleContext();
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put("type", "defaultProvider");
defaultDelegationProviderReg = bc.registerService(DelegationProvider.class,
defaultDelegationProvider,
props);
} | [
"private",
"void",
"registerDefaultDelegationProvider",
"(",
"ComponentContext",
"cc",
")",
"{",
"defaultDelegationProvider",
"=",
"new",
"DefaultDelegationProvider",
"(",
")",
";",
"defaultDelegationProvider",
".",
"setSecurityService",
"(",
"securityServiceRef",
".",
"getService",
"(",
")",
")",
";",
"defaultDelegationProvider",
".",
"setIdentityStoreHandlerService",
"(",
"identityStoreHandlerServiceRef",
")",
";",
"BundleContext",
"bc",
"=",
"cc",
".",
"getBundleContext",
"(",
")",
";",
"Dictionary",
"<",
"String",
",",
"Object",
">",
"props",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"props",
".",
"put",
"(",
"\"type\"",
",",
"\"defaultProvider\"",
")",
";",
"defaultDelegationProviderReg",
"=",
"bc",
".",
"registerService",
"(",
"DelegationProvider",
".",
"class",
",",
"defaultDelegationProvider",
",",
"props",
")",
";",
"}"
] | Register the webcontainer's default delegation provider.
@param cc | [
"Register",
"the",
"webcontainer",
"s",
"default",
"delegation",
"provider",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java#L165-L175 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java | AppBndAuthorizationTableService.updateMapForSpecialSubject | private Map<String, RoleSet> updateMapForSpecialSubject(String appName,
Map<String, RoleSet> specialSubjectToRolesMap,
String specialSubjectName) {
RoleSet computedRoles = RoleSet.EMPTY_ROLESET;
Set<String> rolesForSubject = new HashSet<String>();
//TODO what if the appName is not present in the map?
for (SecurityRole role : resourceToAuthzInfoMap.get(appName).securityRoles) {
String roleName = role.getName();
for (SpecialSubject specialSubject : role.getSpecialSubjects()) {
String specialSubjectNameFromRole = specialSubject.getType().toString();
if (specialSubjectName.equals(specialSubjectNameFromRole)) {
rolesForSubject.add(roleName);
}
}
}
if (!rolesForSubject.isEmpty()) {
computedRoles = new RoleSet(rolesForSubject);
}
specialSubjectToRolesMap.put(specialSubjectName, computedRoles);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Added the following subject to role mapping for application: " + appName + ".",
specialSubjectName, computedRoles);
}
return specialSubjectToRolesMap;
} | java | private Map<String, RoleSet> updateMapForSpecialSubject(String appName,
Map<String, RoleSet> specialSubjectToRolesMap,
String specialSubjectName) {
RoleSet computedRoles = RoleSet.EMPTY_ROLESET;
Set<String> rolesForSubject = new HashSet<String>();
//TODO what if the appName is not present in the map?
for (SecurityRole role : resourceToAuthzInfoMap.get(appName).securityRoles) {
String roleName = role.getName();
for (SpecialSubject specialSubject : role.getSpecialSubjects()) {
String specialSubjectNameFromRole = specialSubject.getType().toString();
if (specialSubjectName.equals(specialSubjectNameFromRole)) {
rolesForSubject.add(roleName);
}
}
}
if (!rolesForSubject.isEmpty()) {
computedRoles = new RoleSet(rolesForSubject);
}
specialSubjectToRolesMap.put(specialSubjectName, computedRoles);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Added the following subject to role mapping for application: " + appName + ".",
specialSubjectName, computedRoles);
}
return specialSubjectToRolesMap;
} | [
"private",
"Map",
"<",
"String",
",",
"RoleSet",
">",
"updateMapForSpecialSubject",
"(",
"String",
"appName",
",",
"Map",
"<",
"String",
",",
"RoleSet",
">",
"specialSubjectToRolesMap",
",",
"String",
"specialSubjectName",
")",
"{",
"RoleSet",
"computedRoles",
"=",
"RoleSet",
".",
"EMPTY_ROLESET",
";",
"Set",
"<",
"String",
">",
"rolesForSubject",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"//TODO what if the appName is not present in the map?",
"for",
"(",
"SecurityRole",
"role",
":",
"resourceToAuthzInfoMap",
".",
"get",
"(",
"appName",
")",
".",
"securityRoles",
")",
"{",
"String",
"roleName",
"=",
"role",
".",
"getName",
"(",
")",
";",
"for",
"(",
"SpecialSubject",
"specialSubject",
":",
"role",
".",
"getSpecialSubjects",
"(",
")",
")",
"{",
"String",
"specialSubjectNameFromRole",
"=",
"specialSubject",
".",
"getType",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"specialSubjectName",
".",
"equals",
"(",
"specialSubjectNameFromRole",
")",
")",
"{",
"rolesForSubject",
".",
"add",
"(",
"roleName",
")",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"rolesForSubject",
".",
"isEmpty",
"(",
")",
")",
"{",
"computedRoles",
"=",
"new",
"RoleSet",
"(",
"rolesForSubject",
")",
";",
"}",
"specialSubjectToRolesMap",
".",
"put",
"(",
"specialSubjectName",
",",
"computedRoles",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Added the following subject to role mapping for application: \"",
"+",
"appName",
"+",
"\".\"",
",",
"specialSubjectName",
",",
"computedRoles",
")",
";",
"}",
"return",
"specialSubjectToRolesMap",
";",
"}"
] | Parse the security-role entries to look for the specified special
subject, and update the subject-to-roles mapping with the result.
If the special subject was not found, an empty list is added to
the subject-to-roles map. Otherwise, the list contains the set of
roles mapped to the special subject.
@param appName the name of the application, this is the key used when
updating the subject-to-role map
@param specialSubjectToRolesMap the subject-to-role mapping,
key: appName, value: list of roles (possibly empty)
@param specialSubjectName the string representing the special subject
to look for. It can be one of these values:
EVERYONE
ALL_AUTHENTICATED_USERS
ALL_AUTHENTICATED_IN_TRUSTED_REALMS
@param secRoles the security-role entries, previously read either
from server.xml or ibm-application.bnd.xmi/xml
@return the updated subject-to-roles map | [
"Parse",
"the",
"security",
"-",
"role",
"entries",
"to",
"look",
"for",
"the",
"specified",
"special",
"subject",
"and",
"update",
"the",
"subject",
"-",
"to",
"-",
"roles",
"mapping",
"with",
"the",
"result",
".",
"If",
"the",
"special",
"subject",
"was",
"not",
"found",
"an",
"empty",
"list",
"is",
"added",
"to",
"the",
"subject",
"-",
"to",
"-",
"roles",
"map",
".",
"Otherwise",
"the",
"list",
"contains",
"the",
"set",
"of",
"roles",
"mapped",
"to",
"the",
"special",
"subject",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java#L281-L311 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java | AppBndAuthorizationTableService.getMissingAccessId | @FFDCIgnore(EntryNotFoundException.class)
private String getMissingAccessId(com.ibm.ws.javaee.dd.appbnd.Subject subjectFromArchive) {
String subjectType = null;
try {
SecurityService securityService = securityServiceRef.getService();
UserRegistryService userRegistryService = securityService.getUserRegistryService();
if (!userRegistryService.isUserRegistryConfigured())
return null;
UserRegistry userRegistry = userRegistryService.getUserRegistry();
String realm = userRegistry.getRealm();
if (subjectFromArchive instanceof Group) {
subjectType = "group";
String groupUniqueId = userRegistry.getUniqueGroupId(subjectFromArchive.getName());
return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_GROUP, realm, groupUniqueId);
} else if (subjectFromArchive instanceof User) {
subjectType = "user";
String uniqueId = userRegistry.getUniqueUserId(subjectFromArchive.getName());
return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_USER, realm, uniqueId);
}
} catch (EntryNotFoundException e) {
if (TraceComponent.isAnyTracingEnabled()) {
if (tc.isEventEnabled()) {
Tr.event(tc, "No entry found for " + subjectType + " "
+ subjectFromArchive.getName() + " found in user registry. Unable to create access ID.");
}
if (tc.isDebugEnabled()) {
Tr.debug(tc, "EntryNotFoundException details:", e);
}
}
} catch (RegistryException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unexpected exception getting the accessId for "
+ subjectFromArchive.getName() + ": " + e);
}
}
return null;
} | java | @FFDCIgnore(EntryNotFoundException.class)
private String getMissingAccessId(com.ibm.ws.javaee.dd.appbnd.Subject subjectFromArchive) {
String subjectType = null;
try {
SecurityService securityService = securityServiceRef.getService();
UserRegistryService userRegistryService = securityService.getUserRegistryService();
if (!userRegistryService.isUserRegistryConfigured())
return null;
UserRegistry userRegistry = userRegistryService.getUserRegistry();
String realm = userRegistry.getRealm();
if (subjectFromArchive instanceof Group) {
subjectType = "group";
String groupUniqueId = userRegistry.getUniqueGroupId(subjectFromArchive.getName());
return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_GROUP, realm, groupUniqueId);
} else if (subjectFromArchive instanceof User) {
subjectType = "user";
String uniqueId = userRegistry.getUniqueUserId(subjectFromArchive.getName());
return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_USER, realm, uniqueId);
}
} catch (EntryNotFoundException e) {
if (TraceComponent.isAnyTracingEnabled()) {
if (tc.isEventEnabled()) {
Tr.event(tc, "No entry found for " + subjectType + " "
+ subjectFromArchive.getName() + " found in user registry. Unable to create access ID.");
}
if (tc.isDebugEnabled()) {
Tr.debug(tc, "EntryNotFoundException details:", e);
}
}
} catch (RegistryException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unexpected exception getting the accessId for "
+ subjectFromArchive.getName() + ": " + e);
}
}
return null;
} | [
"@",
"FFDCIgnore",
"(",
"EntryNotFoundException",
".",
"class",
")",
"private",
"String",
"getMissingAccessId",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"javaee",
".",
"dd",
".",
"appbnd",
".",
"Subject",
"subjectFromArchive",
")",
"{",
"String",
"subjectType",
"=",
"null",
";",
"try",
"{",
"SecurityService",
"securityService",
"=",
"securityServiceRef",
".",
"getService",
"(",
")",
";",
"UserRegistryService",
"userRegistryService",
"=",
"securityService",
".",
"getUserRegistryService",
"(",
")",
";",
"if",
"(",
"!",
"userRegistryService",
".",
"isUserRegistryConfigured",
"(",
")",
")",
"return",
"null",
";",
"UserRegistry",
"userRegistry",
"=",
"userRegistryService",
".",
"getUserRegistry",
"(",
")",
";",
"String",
"realm",
"=",
"userRegistry",
".",
"getRealm",
"(",
")",
";",
"if",
"(",
"subjectFromArchive",
"instanceof",
"Group",
")",
"{",
"subjectType",
"=",
"\"group\"",
";",
"String",
"groupUniqueId",
"=",
"userRegistry",
".",
"getUniqueGroupId",
"(",
"subjectFromArchive",
".",
"getName",
"(",
")",
")",
";",
"return",
"AccessIdUtil",
".",
"createAccessId",
"(",
"AccessIdUtil",
".",
"TYPE_GROUP",
",",
"realm",
",",
"groupUniqueId",
")",
";",
"}",
"else",
"if",
"(",
"subjectFromArchive",
"instanceof",
"User",
")",
"{",
"subjectType",
"=",
"\"user\"",
";",
"String",
"uniqueId",
"=",
"userRegistry",
".",
"getUniqueUserId",
"(",
"subjectFromArchive",
".",
"getName",
"(",
")",
")",
";",
"return",
"AccessIdUtil",
".",
"createAccessId",
"(",
"AccessIdUtil",
".",
"TYPE_USER",
",",
"realm",
",",
"uniqueId",
")",
";",
"}",
"}",
"catch",
"(",
"EntryNotFoundException",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
")",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"No entry found for \"",
"+",
"subjectType",
"+",
"\" \"",
"+",
"subjectFromArchive",
".",
"getName",
"(",
")",
"+",
"\" found in user registry. Unable to create access ID.\"",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"EntryNotFoundException details:\"",
",",
"e",
")",
";",
"}",
"}",
"}",
"catch",
"(",
"RegistryException",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Unexpected exception getting the accessId for \"",
"+",
"subjectFromArchive",
".",
"getName",
"(",
")",
"+",
"\": \"",
"+",
"e",
")",
";",
"}",
"}",
"return",
"null",
";",
"}"
] | Get the access id for a user or group in the bindings config by looking up
the user registry.
@param subject the Subject object in the bindings config, can be User or Group
@return the access id of the Subject specified in the bindings config,
otherwise null when a registry error occurs or the entry is not found | [
"Get",
"the",
"access",
"id",
"for",
"a",
"user",
"or",
"group",
"in",
"the",
"bindings",
"config",
"by",
"looking",
"up",
"the",
"user",
"registry",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java#L336-L372 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java | AppBndAuthorizationTableService.updateMissingUserAccessId | private String updateMissingUserAccessId(AuthzTableContainer maps, User user, String userNameFromRole) {
String accessIdFromRole;
accessIdFromRole = getMissingAccessId(user);
if (accessIdFromRole != null) {
maps.userToAccessIdMap.put(userNameFromRole, accessIdFromRole);
} else {
// Unable to compute the accessId, store an invalid access ID indicate this
maps.userToAccessIdMap.put(userNameFromRole, INVALID_ACCESS_ID);
}
return accessIdFromRole;
} | java | private String updateMissingUserAccessId(AuthzTableContainer maps, User user, String userNameFromRole) {
String accessIdFromRole;
accessIdFromRole = getMissingAccessId(user);
if (accessIdFromRole != null) {
maps.userToAccessIdMap.put(userNameFromRole, accessIdFromRole);
} else {
// Unable to compute the accessId, store an invalid access ID indicate this
maps.userToAccessIdMap.put(userNameFromRole, INVALID_ACCESS_ID);
}
return accessIdFromRole;
} | [
"private",
"String",
"updateMissingUserAccessId",
"(",
"AuthzTableContainer",
"maps",
",",
"User",
"user",
",",
"String",
"userNameFromRole",
")",
"{",
"String",
"accessIdFromRole",
";",
"accessIdFromRole",
"=",
"getMissingAccessId",
"(",
"user",
")",
";",
"if",
"(",
"accessIdFromRole",
"!=",
"null",
")",
"{",
"maps",
".",
"userToAccessIdMap",
".",
"put",
"(",
"userNameFromRole",
",",
"accessIdFromRole",
")",
";",
"}",
"else",
"{",
"// Unable to compute the accessId, store an invalid access ID indicate this",
"maps",
".",
"userToAccessIdMap",
".",
"put",
"(",
"userNameFromRole",
",",
"INVALID_ACCESS_ID",
")",
";",
"}",
"return",
"accessIdFromRole",
";",
"}"
] | Update the map for the specified user name. If the accessID is
successfully computed, the map will be updated with the accessID.
If the accessID can not be computed due to the user not being found,
INVALID_ACCESS_ID will be stored.
@param maps
@param user
@param userNameFromRole
@return | [
"Update",
"the",
"map",
"for",
"the",
"specified",
"user",
"name",
".",
"If",
"the",
"accessID",
"is",
"successfully",
"computed",
"the",
"map",
"will",
"be",
"updated",
"with",
"the",
"accessID",
".",
"If",
"the",
"accessID",
"can",
"not",
"be",
"computed",
"due",
"to",
"the",
"user",
"not",
"being",
"found",
"INVALID_ACCESS_ID",
"will",
"be",
"stored",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java#L385-L395 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java | AppBndAuthorizationTableService.updateMissingGroupAccessId | private String updateMissingGroupAccessId(AuthzTableContainer maps, Group group, String groupNameFromRole) {
String accessIdFromRole;
accessIdFromRole = getMissingAccessId(group);
if (accessIdFromRole != null) {
maps.groupToAccessIdMap.put(groupNameFromRole, accessIdFromRole);
} else {
// Unable to compute the accessId, store an invalid access ID indicate this
// and avoid future attempts
maps.groupToAccessIdMap.put(groupNameFromRole, INVALID_ACCESS_ID);
}
return accessIdFromRole;
} | java | private String updateMissingGroupAccessId(AuthzTableContainer maps, Group group, String groupNameFromRole) {
String accessIdFromRole;
accessIdFromRole = getMissingAccessId(group);
if (accessIdFromRole != null) {
maps.groupToAccessIdMap.put(groupNameFromRole, accessIdFromRole);
} else {
// Unable to compute the accessId, store an invalid access ID indicate this
// and avoid future attempts
maps.groupToAccessIdMap.put(groupNameFromRole, INVALID_ACCESS_ID);
}
return accessIdFromRole;
} | [
"private",
"String",
"updateMissingGroupAccessId",
"(",
"AuthzTableContainer",
"maps",
",",
"Group",
"group",
",",
"String",
"groupNameFromRole",
")",
"{",
"String",
"accessIdFromRole",
";",
"accessIdFromRole",
"=",
"getMissingAccessId",
"(",
"group",
")",
";",
"if",
"(",
"accessIdFromRole",
"!=",
"null",
")",
"{",
"maps",
".",
"groupToAccessIdMap",
".",
"put",
"(",
"groupNameFromRole",
",",
"accessIdFromRole",
")",
";",
"}",
"else",
"{",
"// Unable to compute the accessId, store an invalid access ID indicate this",
"// and avoid future attempts",
"maps",
".",
"groupToAccessIdMap",
".",
"put",
"(",
"groupNameFromRole",
",",
"INVALID_ACCESS_ID",
")",
";",
"}",
"return",
"accessIdFromRole",
";",
"}"
] | Update the map for the specified group name. If the accessID is
successfully computed, the map will be updated with the accessID.
If the accessID can not be computed due to the user not being found,
INVALID_ACCESS_ID will be stored.
@param maps
@param group
@param groupNameFromRole
@return | [
"Update",
"the",
"map",
"for",
"the",
"specified",
"group",
"name",
".",
"If",
"the",
"accessID",
"is",
"successfully",
"computed",
"the",
"map",
"will",
"be",
"updated",
"with",
"the",
"accessID",
".",
"If",
"the",
"accessID",
"can",
"not",
"be",
"computed",
"due",
"to",
"the",
"user",
"not",
"being",
"found",
"INVALID_ACCESS_ID",
"will",
"be",
"stored",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java#L408-L419 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.fireProgressEvent | private void fireProgressEvent(int state, int progress, String messageKey, RepositoryResource installResource) throws InstallException {
String resourceName = null;
if (installResource instanceof EsaResource) {
EsaResource esar = ((EsaResource) installResource);
if (esar.getVisibility().equals(Visibility.PUBLIC) || esar.getVisibility().equals(Visibility.INSTALL)) {
resourceName = (esar.getShortName() == null) ? installResource.getName() : esar.getShortName();
} else if (!firePublicAssetOnly && messageKey.equals("STATE_DOWNLOADING")) {
messageKey = "STATE_DOWNLOADING_DEPENDENCY";
resourceName = "";
} else {
return;
}
}
if (installResource instanceof SampleResource) {
SampleResource sr = ((SampleResource) installResource);
resourceName = sr.getShortName() == null ? installResource.getName() : sr.getShortName();
} else {
resourceName = installResource.getName();
}
fireProgressEvent(state, progress,
Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(messageKey, resourceName));
} | java | private void fireProgressEvent(int state, int progress, String messageKey, RepositoryResource installResource) throws InstallException {
String resourceName = null;
if (installResource instanceof EsaResource) {
EsaResource esar = ((EsaResource) installResource);
if (esar.getVisibility().equals(Visibility.PUBLIC) || esar.getVisibility().equals(Visibility.INSTALL)) {
resourceName = (esar.getShortName() == null) ? installResource.getName() : esar.getShortName();
} else if (!firePublicAssetOnly && messageKey.equals("STATE_DOWNLOADING")) {
messageKey = "STATE_DOWNLOADING_DEPENDENCY";
resourceName = "";
} else {
return;
}
}
if (installResource instanceof SampleResource) {
SampleResource sr = ((SampleResource) installResource);
resourceName = sr.getShortName() == null ? installResource.getName() : sr.getShortName();
} else {
resourceName = installResource.getName();
}
fireProgressEvent(state, progress,
Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(messageKey, resourceName));
} | [
"private",
"void",
"fireProgressEvent",
"(",
"int",
"state",
",",
"int",
"progress",
",",
"String",
"messageKey",
",",
"RepositoryResource",
"installResource",
")",
"throws",
"InstallException",
"{",
"String",
"resourceName",
"=",
"null",
";",
"if",
"(",
"installResource",
"instanceof",
"EsaResource",
")",
"{",
"EsaResource",
"esar",
"=",
"(",
"(",
"EsaResource",
")",
"installResource",
")",
";",
"if",
"(",
"esar",
".",
"getVisibility",
"(",
")",
".",
"equals",
"(",
"Visibility",
".",
"PUBLIC",
")",
"||",
"esar",
".",
"getVisibility",
"(",
")",
".",
"equals",
"(",
"Visibility",
".",
"INSTALL",
")",
")",
"{",
"resourceName",
"=",
"(",
"esar",
".",
"getShortName",
"(",
")",
"==",
"null",
")",
"?",
"installResource",
".",
"getName",
"(",
")",
":",
"esar",
".",
"getShortName",
"(",
")",
";",
"}",
"else",
"if",
"(",
"!",
"firePublicAssetOnly",
"&&",
"messageKey",
".",
"equals",
"(",
"\"STATE_DOWNLOADING\"",
")",
")",
"{",
"messageKey",
"=",
"\"STATE_DOWNLOADING_DEPENDENCY\"",
";",
"resourceName",
"=",
"\"\"",
";",
"}",
"else",
"{",
"return",
";",
"}",
"}",
"if",
"(",
"installResource",
"instanceof",
"SampleResource",
")",
"{",
"SampleResource",
"sr",
"=",
"(",
"(",
"SampleResource",
")",
"installResource",
")",
";",
"resourceName",
"=",
"sr",
".",
"getShortName",
"(",
")",
"==",
"null",
"?",
"installResource",
".",
"getName",
"(",
")",
":",
"sr",
".",
"getShortName",
"(",
")",
";",
"}",
"else",
"{",
"resourceName",
"=",
"installResource",
".",
"getName",
"(",
")",
";",
"}",
"fireProgressEvent",
"(",
"state",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"messageKey",
",",
"resourceName",
")",
")",
";",
"}"
] | Fires a progress event message to be displayed
@param state the state integer
@param progress the progress integer
@param messageKey the message key
@param installResource the resource necessitating the progress event
@throws InstallException | [
"Fires",
"a",
"progress",
"event",
"message",
"to",
"be",
"displayed"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L168-L189 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.fireInstallProgressEvent | public void fireInstallProgressEvent(int progress, InstallAsset installAsset) throws InstallException {
if (installAsset.isServerPackage())
fireProgressEvent(InstallProgressEvent.DEPLOY, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DEPLOYING", installAsset.toString()), true);
else if (installAsset.isFeature()) {
ESAAsset esaa = ((ESAAsset) installAsset);
if (esaa.isPublic()) {
String resourceName = (esaa.getShortName() == null) ? esaa.getDisplayName() : esaa.getShortName();
fireProgressEvent(InstallProgressEvent.INSTALL, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_INSTALLING", resourceName), true);
} else if (!firePublicAssetOnly) {
fireProgressEvent(InstallProgressEvent.INSTALL, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_INSTALLING_DEPENDENCY"), true);
}
} else {
fireProgressEvent(InstallProgressEvent.INSTALL, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_INSTALLING", installAsset.toString()), true);
}
} | java | public void fireInstallProgressEvent(int progress, InstallAsset installAsset) throws InstallException {
if (installAsset.isServerPackage())
fireProgressEvent(InstallProgressEvent.DEPLOY, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DEPLOYING", installAsset.toString()), true);
else if (installAsset.isFeature()) {
ESAAsset esaa = ((ESAAsset) installAsset);
if (esaa.isPublic()) {
String resourceName = (esaa.getShortName() == null) ? esaa.getDisplayName() : esaa.getShortName();
fireProgressEvent(InstallProgressEvent.INSTALL, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_INSTALLING", resourceName), true);
} else if (!firePublicAssetOnly) {
fireProgressEvent(InstallProgressEvent.INSTALL, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_INSTALLING_DEPENDENCY"), true);
}
} else {
fireProgressEvent(InstallProgressEvent.INSTALL, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_INSTALLING", installAsset.toString()), true);
}
} | [
"public",
"void",
"fireInstallProgressEvent",
"(",
"int",
"progress",
",",
"InstallAsset",
"installAsset",
")",
"throws",
"InstallException",
"{",
"if",
"(",
"installAsset",
".",
"isServerPackage",
"(",
")",
")",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"DEPLOY",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_DEPLOYING\"",
",",
"installAsset",
".",
"toString",
"(",
")",
")",
",",
"true",
")",
";",
"else",
"if",
"(",
"installAsset",
".",
"isFeature",
"(",
")",
")",
"{",
"ESAAsset",
"esaa",
"=",
"(",
"(",
"ESAAsset",
")",
"installAsset",
")",
";",
"if",
"(",
"esaa",
".",
"isPublic",
"(",
")",
")",
"{",
"String",
"resourceName",
"=",
"(",
"esaa",
".",
"getShortName",
"(",
")",
"==",
"null",
")",
"?",
"esaa",
".",
"getDisplayName",
"(",
")",
":",
"esaa",
".",
"getShortName",
"(",
")",
";",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"INSTALL",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_INSTALLING\"",
",",
"resourceName",
")",
",",
"true",
")",
";",
"}",
"else",
"if",
"(",
"!",
"firePublicAssetOnly",
")",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"INSTALL",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_INSTALLING_DEPENDENCY\"",
")",
",",
"true",
")",
";",
"}",
"}",
"else",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"INSTALL",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_INSTALLING\"",
",",
"installAsset",
".",
"toString",
"(",
")",
")",
",",
"true",
")",
";",
"}",
"}"
] | Fires an install progress event to be displayed
@param progress the progress integer
@param installAsset the install asset necessitating the progress event
@throws InstallException | [
"Fires",
"an",
"install",
"progress",
"event",
"to",
"be",
"displayed"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L198-L212 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.fireDownloadProgressEvent | public void fireDownloadProgressEvent(int progress, RepositoryResource installResource) throws InstallException {
if (installResource.getType().equals(ResourceType.FEATURE)) {
Visibility v = ((EsaResource) installResource).getVisibility();
if (v.equals(Visibility.PUBLIC) || v.equals(Visibility.INSTALL)) {
EsaResource esar = (EsaResource) installResource;
String resourceName = (esar.getShortName() == null) ? installResource.getName() : esar.getShortName();
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DOWNLOADING", resourceName), true);
} else if (!firePublicAssetOnly) {
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DOWNLOADING_DEPENDENCY"), true);
}
} else if (installResource.getType().equals(ResourceType.PRODUCTSAMPLE) ||
installResource.getType().equals(ResourceType.OPENSOURCE)) {
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DOWNLOADING", installResource.getName()), true);
}
} | java | public void fireDownloadProgressEvent(int progress, RepositoryResource installResource) throws InstallException {
if (installResource.getType().equals(ResourceType.FEATURE)) {
Visibility v = ((EsaResource) installResource).getVisibility();
if (v.equals(Visibility.PUBLIC) || v.equals(Visibility.INSTALL)) {
EsaResource esar = (EsaResource) installResource;
String resourceName = (esar.getShortName() == null) ? installResource.getName() : esar.getShortName();
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DOWNLOADING", resourceName), true);
} else if (!firePublicAssetOnly) {
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DOWNLOADING_DEPENDENCY"), true);
}
} else if (installResource.getType().equals(ResourceType.PRODUCTSAMPLE) ||
installResource.getType().equals(ResourceType.OPENSOURCE)) {
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_DOWNLOADING", installResource.getName()), true);
}
} | [
"public",
"void",
"fireDownloadProgressEvent",
"(",
"int",
"progress",
",",
"RepositoryResource",
"installResource",
")",
"throws",
"InstallException",
"{",
"if",
"(",
"installResource",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"ResourceType",
".",
"FEATURE",
")",
")",
"{",
"Visibility",
"v",
"=",
"(",
"(",
"EsaResource",
")",
"installResource",
")",
".",
"getVisibility",
"(",
")",
";",
"if",
"(",
"v",
".",
"equals",
"(",
"Visibility",
".",
"PUBLIC",
")",
"||",
"v",
".",
"equals",
"(",
"Visibility",
".",
"INSTALL",
")",
")",
"{",
"EsaResource",
"esar",
"=",
"(",
"EsaResource",
")",
"installResource",
";",
"String",
"resourceName",
"=",
"(",
"esar",
".",
"getShortName",
"(",
")",
"==",
"null",
")",
"?",
"installResource",
".",
"getName",
"(",
")",
":",
"esar",
".",
"getShortName",
"(",
")",
";",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"DOWNLOAD",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_DOWNLOADING\"",
",",
"resourceName",
")",
",",
"true",
")",
";",
"}",
"else",
"if",
"(",
"!",
"firePublicAssetOnly",
")",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"DOWNLOAD",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_DOWNLOADING_DEPENDENCY\"",
")",
",",
"true",
")",
";",
"}",
"}",
"else",
"if",
"(",
"installResource",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"ResourceType",
".",
"PRODUCTSAMPLE",
")",
"||",
"installResource",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"ResourceType",
".",
"OPENSOURCE",
")",
")",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"DOWNLOAD",
",",
"progress",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_DOWNLOADING\"",
",",
"installResource",
".",
"getName",
"(",
")",
")",
",",
"true",
")",
";",
"}",
"}"
] | Fires a download progress event to be displayed
@param progress the progress integer
@param installResource the install resource necessitating the progress event
@throws InstallException | [
"Fires",
"a",
"download",
"progress",
"event",
"to",
"be",
"displayed"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L221-L235 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installFeatures | public void installFeatures(Collection<String> featureNames, String toExtension, boolean acceptLicense, String userId, String password) throws InstallException {
installFeatures(featureNames, toExtension, acceptLicense, userId, password, 1);
} | java | public void installFeatures(Collection<String> featureNames, String toExtension, boolean acceptLicense, String userId, String password) throws InstallException {
installFeatures(featureNames, toExtension, acceptLicense, userId, password, 1);
} | [
"public",
"void",
"installFeatures",
"(",
"Collection",
"<",
"String",
">",
"featureNames",
",",
"String",
"toExtension",
",",
"boolean",
"acceptLicense",
",",
"String",
"userId",
",",
"String",
"password",
")",
"throws",
"InstallException",
"{",
"installFeatures",
"(",
"featureNames",
",",
"toExtension",
",",
"acceptLicense",
",",
"userId",
",",
"password",
",",
"1",
")",
";",
"}"
] | Installs the specified features
@param featureNames collection of feature names to be installed
@param toExtension location of a product extension
@param acceptLicense if license is accepted
@param userId userId for repository
@param password password for repository
@throws InstallException | [
"Installs",
"the",
"specified",
"features"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L258-L260 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installFeature | public void installFeature(String esaLocation, String toExtension, boolean acceptLicense) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
String feature = getResolveDirector().resolve(esaLocation, toExtension, product.getInstalledFeatures(), installAssets, 10, 40);
if (installAssets.isEmpty()) {
throw ExceptionUtils.create(Messages.PROVISIONER_MESSAGES.getLogMessage("tool.feature.exists", feature), InstallException.ALREADY_EXISTS);
}
this.installAssets = new ArrayList<List<InstallAsset>>(1);
this.installAssets.add(installAssets);
} | java | public void installFeature(String esaLocation, String toExtension, boolean acceptLicense) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
String feature = getResolveDirector().resolve(esaLocation, toExtension, product.getInstalledFeatures(), installAssets, 10, 40);
if (installAssets.isEmpty()) {
throw ExceptionUtils.create(Messages.PROVISIONER_MESSAGES.getLogMessage("tool.feature.exists", feature), InstallException.ALREADY_EXISTS);
}
this.installAssets = new ArrayList<List<InstallAsset>>(1);
this.installAssets.add(installAssets);
} | [
"public",
"void",
"installFeature",
"(",
"String",
"esaLocation",
",",
"String",
"toExtension",
",",
"boolean",
"acceptLicense",
")",
"throws",
"InstallException",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CHECK",
",",
"1",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_CHECKING\"",
")",
")",
";",
"ArrayList",
"<",
"InstallAsset",
">",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"InstallAsset",
">",
"(",
")",
";",
"String",
"feature",
"=",
"getResolveDirector",
"(",
")",
".",
"resolve",
"(",
"esaLocation",
",",
"toExtension",
",",
"product",
".",
"getInstalledFeatures",
"(",
")",
",",
"installAssets",
",",
"10",
",",
"40",
")",
";",
"if",
"(",
"installAssets",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"Messages",
".",
"PROVISIONER_MESSAGES",
".",
"getLogMessage",
"(",
"\"tool.feature.exists\"",
",",
"feature",
")",
",",
"InstallException",
".",
"ALREADY_EXISTS",
")",
";",
"}",
"this",
".",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"InstallAsset",
">",
">",
"(",
"1",
")",
";",
"this",
".",
"installAssets",
".",
"add",
"(",
"installAssets",
")",
";",
"}"
] | Installs the feature found in the given esa location
@param esaLocation location of esa
@param toExtension location of a product extension
@param acceptLicense if license is accepted
@throws InstallException | [
"Installs",
"the",
"feature",
"found",
"in",
"the",
"given",
"esa",
"location"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L374-L383 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installFeatureNoResolve | public void installFeatureNoResolve(String esaLocation, String toExtension, boolean acceptLicense) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
ArrayList<InstallAsset> singleFeatureInstall = new ArrayList<InstallAsset>();
InstallAsset esa = null;
try {
esa = new ESAAsset(new File(esaLocation), toExtension, false);
} catch (ZipException e) {
throw ExceptionUtils.create(Messages.PROVISIONER_MESSAGES.getLogMessage("tool.install.download.esa", esaLocation, e.getMessage()),
InstallException.BAD_ARGUMENT);
} catch (IOException e) {
throw ExceptionUtils.create(Messages.PROVISIONER_MESSAGES.getLogMessage("tool.install.download.esa", esaLocation, e.getMessage()),
InstallException.BAD_ARGUMENT);
}
singleFeatureInstall.add(esa);
this.installAssets = new ArrayList<List<InstallAsset>>(1);
this.installAssets.add(singleFeatureInstall);
} | java | public void installFeatureNoResolve(String esaLocation, String toExtension, boolean acceptLicense) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
ArrayList<InstallAsset> singleFeatureInstall = new ArrayList<InstallAsset>();
InstallAsset esa = null;
try {
esa = new ESAAsset(new File(esaLocation), toExtension, false);
} catch (ZipException e) {
throw ExceptionUtils.create(Messages.PROVISIONER_MESSAGES.getLogMessage("tool.install.download.esa", esaLocation, e.getMessage()),
InstallException.BAD_ARGUMENT);
} catch (IOException e) {
throw ExceptionUtils.create(Messages.PROVISIONER_MESSAGES.getLogMessage("tool.install.download.esa", esaLocation, e.getMessage()),
InstallException.BAD_ARGUMENT);
}
singleFeatureInstall.add(esa);
this.installAssets = new ArrayList<List<InstallAsset>>(1);
this.installAssets.add(singleFeatureInstall);
} | [
"public",
"void",
"installFeatureNoResolve",
"(",
"String",
"esaLocation",
",",
"String",
"toExtension",
",",
"boolean",
"acceptLicense",
")",
"throws",
"InstallException",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CHECK",
",",
"1",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_CHECKING\"",
")",
")",
";",
"ArrayList",
"<",
"InstallAsset",
">",
"singleFeatureInstall",
"=",
"new",
"ArrayList",
"<",
"InstallAsset",
">",
"(",
")",
";",
"InstallAsset",
"esa",
"=",
"null",
";",
"try",
"{",
"esa",
"=",
"new",
"ESAAsset",
"(",
"new",
"File",
"(",
"esaLocation",
")",
",",
"toExtension",
",",
"false",
")",
";",
"}",
"catch",
"(",
"ZipException",
"e",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"Messages",
".",
"PROVISIONER_MESSAGES",
".",
"getLogMessage",
"(",
"\"tool.install.download.esa\"",
",",
"esaLocation",
",",
"e",
".",
"getMessage",
"(",
")",
")",
",",
"InstallException",
".",
"BAD_ARGUMENT",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"Messages",
".",
"PROVISIONER_MESSAGES",
".",
"getLogMessage",
"(",
"\"tool.install.download.esa\"",
",",
"esaLocation",
",",
"e",
".",
"getMessage",
"(",
")",
")",
",",
"InstallException",
".",
"BAD_ARGUMENT",
")",
";",
"}",
"singleFeatureInstall",
".",
"add",
"(",
"esa",
")",
";",
"this",
".",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"InstallAsset",
">",
">",
"(",
"1",
")",
";",
"this",
".",
"installAssets",
".",
"add",
"(",
"singleFeatureInstall",
")",
";",
"}"
] | Installs the feature found in the given esa location without resolving dependencies
@param esaLocation location of esa
@param toExtension location of a product extension
@param acceptLicense if license is accepted
@throws InstallException | [
"Installs",
"the",
"feature",
"found",
"in",
"the",
"given",
"esa",
"location",
"without",
"resolving",
"dependencies"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L393-L409 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installFeature | public void installFeature(Collection<String> featureIds, File fromDir, String toExtension, boolean acceptLicense, boolean offlineOnly) throws InstallException {
//fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
this.installAssets = new ArrayList<List<InstallAsset>>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
ArrayList<String> unresolvedFeatures = new ArrayList<String>();
Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, toExtension);
getResolveDirector().resolve(featureIds, fromDir, toExtension, offlineOnly, installAssets, unresolvedFeatures);
if (!offlineOnly && !unresolvedFeatures.isEmpty()) {
log(Level.FINEST, "installFeature() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath());
installFeatures(unresolvedFeatures, toExtension, acceptLicense, null, null, 5);
}
if (!installAssets.isEmpty()) {
getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets);
this.installAssets.add(installAssets);
}
if (this.installAssets.isEmpty()) {
throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ALREADY_INSTALLED", featureIds.toString());
}
} | java | public void installFeature(Collection<String> featureIds, File fromDir, String toExtension, boolean acceptLicense, boolean offlineOnly) throws InstallException {
//fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
this.installAssets = new ArrayList<List<InstallAsset>>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
ArrayList<String> unresolvedFeatures = new ArrayList<String>();
Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, toExtension);
getResolveDirector().resolve(featureIds, fromDir, toExtension, offlineOnly, installAssets, unresolvedFeatures);
if (!offlineOnly && !unresolvedFeatures.isEmpty()) {
log(Level.FINEST, "installFeature() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath());
installFeatures(unresolvedFeatures, toExtension, acceptLicense, null, null, 5);
}
if (!installAssets.isEmpty()) {
getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets);
this.installAssets.add(installAssets);
}
if (this.installAssets.isEmpty()) {
throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ALREADY_INSTALLED", featureIds.toString());
}
} | [
"public",
"void",
"installFeature",
"(",
"Collection",
"<",
"String",
">",
"featureIds",
",",
"File",
"fromDir",
",",
"String",
"toExtension",
",",
"boolean",
"acceptLicense",
",",
"boolean",
"offlineOnly",
")",
"throws",
"InstallException",
"{",
"//fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(\"STATE_CHECKING\"));",
"this",
".",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"InstallAsset",
">",
">",
"(",
")",
";",
"ArrayList",
"<",
"InstallAsset",
">",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"InstallAsset",
">",
"(",
")",
";",
"ArrayList",
"<",
"String",
">",
"unresolvedFeatures",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collection",
"<",
"ESAAsset",
">",
"autoFeatures",
"=",
"getResolveDirector",
"(",
")",
".",
"getAutoFeature",
"(",
"fromDir",
",",
"toExtension",
")",
";",
"getResolveDirector",
"(",
")",
".",
"resolve",
"(",
"featureIds",
",",
"fromDir",
",",
"toExtension",
",",
"offlineOnly",
",",
"installAssets",
",",
"unresolvedFeatures",
")",
";",
"if",
"(",
"!",
"offlineOnly",
"&&",
"!",
"unresolvedFeatures",
".",
"isEmpty",
"(",
")",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"installFeature() determined unresolved features: \"",
"+",
"unresolvedFeatures",
".",
"toString",
"(",
")",
"+",
"\" from \"",
"+",
"fromDir",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"installFeatures",
"(",
"unresolvedFeatures",
",",
"toExtension",
",",
"acceptLicense",
",",
"null",
",",
"null",
",",
"5",
")",
";",
"}",
"if",
"(",
"!",
"installAssets",
".",
"isEmpty",
"(",
")",
")",
"{",
"getResolveDirector",
"(",
")",
".",
"resolveAutoFeatures",
"(",
"autoFeatures",
",",
"installAssets",
")",
";",
"this",
".",
"installAssets",
".",
"add",
"(",
"installAssets",
")",
";",
"}",
"if",
"(",
"this",
".",
"installAssets",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"InstallException",
".",
"ALREADY_EXISTS",
",",
"\"ALREADY_INSTALLED\"",
",",
"featureIds",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | Installs the features found in the inputed featureIds collection
@param featureIds the feature ids
@param fromDir where the features are located
@param toExtension location of a product extension
@param acceptLicense if license is accepted
@param offlineOnly if features should be installed from local source only
@throws InstallException | [
"Installs",
"the",
"features",
"found",
"in",
"the",
"inputed",
"featureIds",
"collection"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L421-L439 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.resolveServerPackage | public ServerPackageAsset resolveServerPackage(File archiveFile) throws InstallException {
ServerPackageAsset spa = (ServerPackageJarAsset.validType(archiveFile.getAbsolutePath().toLowerCase())) ? new ServerPackageJarAsset(archiveFile, false) : new ServerPackageZipAsset(archiveFile, false);
this.installAssets = new ArrayList<List<InstallAsset>>();
this.installAssets.add(Arrays.asList((InstallAsset) spa));
return spa;
} | java | public ServerPackageAsset resolveServerPackage(File archiveFile) throws InstallException {
ServerPackageAsset spa = (ServerPackageJarAsset.validType(archiveFile.getAbsolutePath().toLowerCase())) ? new ServerPackageJarAsset(archiveFile, false) : new ServerPackageZipAsset(archiveFile, false);
this.installAssets = new ArrayList<List<InstallAsset>>();
this.installAssets.add(Arrays.asList((InstallAsset) spa));
return spa;
} | [
"public",
"ServerPackageAsset",
"resolveServerPackage",
"(",
"File",
"archiveFile",
")",
"throws",
"InstallException",
"{",
"ServerPackageAsset",
"spa",
"=",
"(",
"ServerPackageJarAsset",
".",
"validType",
"(",
"archiveFile",
".",
"getAbsolutePath",
"(",
")",
".",
"toLowerCase",
"(",
")",
")",
")",
"?",
"new",
"ServerPackageJarAsset",
"(",
"archiveFile",
",",
"false",
")",
":",
"new",
"ServerPackageZipAsset",
"(",
"archiveFile",
",",
"false",
")",
";",
"this",
".",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"InstallAsset",
">",
">",
"(",
")",
";",
"this",
".",
"installAssets",
".",
"add",
"(",
"Arrays",
".",
"asList",
"(",
"(",
"InstallAsset",
")",
"spa",
")",
")",
";",
"return",
"spa",
";",
"}"
] | Creates a new server package asset from the inputed archive file
@param archiveFile the archive file containing the asset
@return a new ServerPackageAsset from the archive file
@throws InstallException | [
"Creates",
"a",
"new",
"server",
"package",
"asset",
"from",
"the",
"inputed",
"archive",
"file"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L448-L455 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getServerFeaturesToInstall | public Collection<String> getServerFeaturesToInstall(Set<ServerAsset> servers, boolean offlineOnly) throws InstallException, IOException {
Set<String> features = new TreeSet<String>();
Set<String> serverNames = new HashSet<String>(servers.size());
Set<String> allServerNames = new HashSet<String>(servers.size());
for (ServerAsset sa : servers) {
Collection<String> requiredFeatures = sa.getRequiredFeatures();
if (!requiredFeatures.isEmpty()) {
logger.log(Level.FINEST, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DEPLOY_SERVER_FEATURES",
sa.getServerName(),
InstallUtils.getFeatureListOutput(requiredFeatures)));
features.addAll(requiredFeatures);
serverNames.add(sa.getServerName());
}
allServerNames.add(sa.getServerName());
}
Collection<String> featuresToInstall = getFeaturesToInstall(features, offlineOnly);
if (!featuresToInstall.isEmpty()) {
logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DEPLOY_ADDITIONAL_FEATURES_REQUIRED",
serverNames, featuresToInstall));
} else {
logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DEPLOY_NO_ADDITIONAL_FEATURES_REQUIRED",
allServerNames));
}
return featuresToInstall;
} | java | public Collection<String> getServerFeaturesToInstall(Set<ServerAsset> servers, boolean offlineOnly) throws InstallException, IOException {
Set<String> features = new TreeSet<String>();
Set<String> serverNames = new HashSet<String>(servers.size());
Set<String> allServerNames = new HashSet<String>(servers.size());
for (ServerAsset sa : servers) {
Collection<String> requiredFeatures = sa.getRequiredFeatures();
if (!requiredFeatures.isEmpty()) {
logger.log(Level.FINEST, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DEPLOY_SERVER_FEATURES",
sa.getServerName(),
InstallUtils.getFeatureListOutput(requiredFeatures)));
features.addAll(requiredFeatures);
serverNames.add(sa.getServerName());
}
allServerNames.add(sa.getServerName());
}
Collection<String> featuresToInstall = getFeaturesToInstall(features, offlineOnly);
if (!featuresToInstall.isEmpty()) {
logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DEPLOY_ADDITIONAL_FEATURES_REQUIRED",
serverNames, featuresToInstall));
} else {
logger.log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_DEPLOY_NO_ADDITIONAL_FEATURES_REQUIRED",
allServerNames));
}
return featuresToInstall;
} | [
"public",
"Collection",
"<",
"String",
">",
"getServerFeaturesToInstall",
"(",
"Set",
"<",
"ServerAsset",
">",
"servers",
",",
"boolean",
"offlineOnly",
")",
"throws",
"InstallException",
",",
"IOException",
"{",
"Set",
"<",
"String",
">",
"features",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
")",
";",
"Set",
"<",
"String",
">",
"serverNames",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"servers",
".",
"size",
"(",
")",
")",
";",
"Set",
"<",
"String",
">",
"allServerNames",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"servers",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"ServerAsset",
"sa",
":",
"servers",
")",
"{",
"Collection",
"<",
"String",
">",
"requiredFeatures",
"=",
"sa",
".",
"getRequiredFeatures",
"(",
")",
";",
"if",
"(",
"!",
"requiredFeatures",
".",
"isEmpty",
"(",
")",
")",
"{",
"logger",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"LOG_DEPLOY_SERVER_FEATURES\"",
",",
"sa",
".",
"getServerName",
"(",
")",
",",
"InstallUtils",
".",
"getFeatureListOutput",
"(",
"requiredFeatures",
")",
")",
")",
";",
"features",
".",
"addAll",
"(",
"requiredFeatures",
")",
";",
"serverNames",
".",
"add",
"(",
"sa",
".",
"getServerName",
"(",
")",
")",
";",
"}",
"allServerNames",
".",
"add",
"(",
"sa",
".",
"getServerName",
"(",
")",
")",
";",
"}",
"Collection",
"<",
"String",
">",
"featuresToInstall",
"=",
"getFeaturesToInstall",
"(",
"features",
",",
"offlineOnly",
")",
";",
"if",
"(",
"!",
"featuresToInstall",
".",
"isEmpty",
"(",
")",
")",
"{",
"logger",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"LOG_DEPLOY_ADDITIONAL_FEATURES_REQUIRED\"",
",",
"serverNames",
",",
"featuresToInstall",
")",
")",
";",
"}",
"else",
"{",
"logger",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"LOG_DEPLOY_NO_ADDITIONAL_FEATURES_REQUIRED\"",
",",
"allServerNames",
")",
")",
";",
"}",
"return",
"featuresToInstall",
";",
"}"
] | Creates a collection of features required for all servers in the inputed set.
@param servers set of ServerAssets
@param offlineOnly if features should be only retrieved locally
@return Collection of server feature names to install
@throws InstallException
@throws IOException | [
"Creates",
"a",
"collection",
"of",
"features",
"required",
"for",
"all",
"servers",
"in",
"the",
"inputed",
"set",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L466-L497 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installFixes | public void installFixes(Collection<String> fixes, String userId, String password) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
List<String> fixesToInstall = new ArrayList<String>(fixes.size());
for (String fix : fixes) {
fixesToInstall.add(fix);
}
RepositoryConnectionList loginInfo = getResolveDirector().getRepositoryConnectionList(null, userId, password, this.getClass().getCanonicalName() + ".installFixes");
Resolver resolver = new Resolver(loginInfo);
List<IfixResource> ifixResources = resolver.resolveFixResources(fixesToInstall);
if (ifixResources.isEmpty())
throw ExceptionUtils.createByKey("ERROR_FAILED_TO_RESOLVE_IFIX", InstallUtils.getFeatureListOutput(fixes));
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
int progress = 10;
int interval = 40 / ifixResources.size();
for (IfixResource fix : ifixResources) {
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, "STATE_DOWNLOADING", fix);
progress += interval;
File d;
try {
d = InstallUtils.download(this.product.getInstallTempDir(), fix);
} catch (InstallException e) {
throw e;
} catch (Exception e) {
throw ExceptionUtils.createByKey(e, "ERROR_FAILED_TO_DOWNLOAD_IFIX", fix.getName(), this.product.getInstallTempDir().getAbsolutePath());
}
try {
installAssets.add(new FixAsset(fix.getName(), d, true));
} catch (Exception e) {
throw ExceptionUtils.createByKey(e, "ERROR_INVALID_IFIX", fix.getName());
}
}
this.installAssets = new ArrayList<List<InstallAsset>>(1);
this.installAssets.add(installAssets);
} | java | public void installFixes(Collection<String> fixes, String userId, String password) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
List<String> fixesToInstall = new ArrayList<String>(fixes.size());
for (String fix : fixes) {
fixesToInstall.add(fix);
}
RepositoryConnectionList loginInfo = getResolveDirector().getRepositoryConnectionList(null, userId, password, this.getClass().getCanonicalName() + ".installFixes");
Resolver resolver = new Resolver(loginInfo);
List<IfixResource> ifixResources = resolver.resolveFixResources(fixesToInstall);
if (ifixResources.isEmpty())
throw ExceptionUtils.createByKey("ERROR_FAILED_TO_RESOLVE_IFIX", InstallUtils.getFeatureListOutput(fixes));
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
int progress = 10;
int interval = 40 / ifixResources.size();
for (IfixResource fix : ifixResources) {
fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, "STATE_DOWNLOADING", fix);
progress += interval;
File d;
try {
d = InstallUtils.download(this.product.getInstallTempDir(), fix);
} catch (InstallException e) {
throw e;
} catch (Exception e) {
throw ExceptionUtils.createByKey(e, "ERROR_FAILED_TO_DOWNLOAD_IFIX", fix.getName(), this.product.getInstallTempDir().getAbsolutePath());
}
try {
installAssets.add(new FixAsset(fix.getName(), d, true));
} catch (Exception e) {
throw ExceptionUtils.createByKey(e, "ERROR_INVALID_IFIX", fix.getName());
}
}
this.installAssets = new ArrayList<List<InstallAsset>>(1);
this.installAssets.add(installAssets);
} | [
"public",
"void",
"installFixes",
"(",
"Collection",
"<",
"String",
">",
"fixes",
",",
"String",
"userId",
",",
"String",
"password",
")",
"throws",
"InstallException",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CHECK",
",",
"1",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_CHECKING\"",
")",
")",
";",
"List",
"<",
"String",
">",
"fixesToInstall",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"fixes",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"String",
"fix",
":",
"fixes",
")",
"{",
"fixesToInstall",
".",
"add",
"(",
"fix",
")",
";",
"}",
"RepositoryConnectionList",
"loginInfo",
"=",
"getResolveDirector",
"(",
")",
".",
"getRepositoryConnectionList",
"(",
"null",
",",
"userId",
",",
"password",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
"+",
"\".installFixes\"",
")",
";",
"Resolver",
"resolver",
"=",
"new",
"Resolver",
"(",
"loginInfo",
")",
";",
"List",
"<",
"IfixResource",
">",
"ifixResources",
"=",
"resolver",
".",
"resolveFixResources",
"(",
"fixesToInstall",
")",
";",
"if",
"(",
"ifixResources",
".",
"isEmpty",
"(",
")",
")",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"\"ERROR_FAILED_TO_RESOLVE_IFIX\"",
",",
"InstallUtils",
".",
"getFeatureListOutput",
"(",
"fixes",
")",
")",
";",
"ArrayList",
"<",
"InstallAsset",
">",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"InstallAsset",
">",
"(",
")",
";",
"int",
"progress",
"=",
"10",
";",
"int",
"interval",
"=",
"40",
"/",
"ifixResources",
".",
"size",
"(",
")",
";",
"for",
"(",
"IfixResource",
"fix",
":",
"ifixResources",
")",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"DOWNLOAD",
",",
"progress",
",",
"\"STATE_DOWNLOADING\"",
",",
"fix",
")",
";",
"progress",
"+=",
"interval",
";",
"File",
"d",
";",
"try",
"{",
"d",
"=",
"InstallUtils",
".",
"download",
"(",
"this",
".",
"product",
".",
"getInstallTempDir",
"(",
")",
",",
"fix",
")",
";",
"}",
"catch",
"(",
"InstallException",
"e",
")",
"{",
"throw",
"e",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"e",
",",
"\"ERROR_FAILED_TO_DOWNLOAD_IFIX\"",
",",
"fix",
".",
"getName",
"(",
")",
",",
"this",
".",
"product",
".",
"getInstallTempDir",
"(",
")",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"}",
"try",
"{",
"installAssets",
".",
"add",
"(",
"new",
"FixAsset",
"(",
"fix",
".",
"getName",
"(",
")",
",",
"d",
",",
"true",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"e",
",",
"\"ERROR_INVALID_IFIX\"",
",",
"fix",
".",
"getName",
"(",
")",
")",
";",
"}",
"}",
"this",
".",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"InstallAsset",
">",
">",
"(",
"1",
")",
";",
"this",
".",
"installAssets",
".",
"add",
"(",
"installAssets",
")",
";",
"}"
] | Set Director to install the specified fixes including the following tasks
- determine to install the fix or not
- call Resolver to resolve the required fixes
- call Massive Client to download the assets
@param strings | [
"Set",
"Director",
"to",
"install",
"the",
"specified",
"fixes",
"including",
"the",
"following",
"tasks",
"-",
"determine",
"to",
"install",
"the",
"fix",
"or",
"not",
"-",
"call",
"Resolver",
"to",
"resolve",
"the",
"required",
"fixes",
"-",
"call",
"Massive",
"Client",
"to",
"download",
"the",
"assets"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L507-L543 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getFeatureLicense | public Set<InstallLicense> getFeatureLicense(Collection<String> featureIds, File fromDir, String toExtension, boolean offlineOnly, Locale locale) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
ArrayList<String> unresolvedFeatures = new ArrayList<String>();
Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, toExtension);
getResolveDirector().resolve(featureIds, fromDir, toExtension, offlineOnly, installAssets, unresolvedFeatures);
if (!offlineOnly && !unresolvedFeatures.isEmpty()) {
log(Level.FINEST, "getFeatureLicense() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath());
licenses = getFeatureLicense(unresolvedFeatures, locale, null, null);
}
if (installAssets.isEmpty()) {
return licenses;
}
getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets);
Map<String, InstallLicenseImpl> licenseIds = new HashMap<String, InstallLicenseImpl>();
for (InstallAsset installAsset : installAssets) {
if (installAsset.isFeature()) {
ESAAsset esa = (ESAAsset) installAsset;
if (esa.isPublic()) {
ExeInstallAction.incrementNumOfLocalFeatures();
}
LicenseProvider lp = esa.getLicenseProvider(locale);
String licenseId = esa.getLicenseId();
if (licenseId != null && !licenseId.isEmpty()) {
InstallLicenseImpl ili = licenseIds.get(licenseId);
if (ili == null) {
ili = new InstallLicenseImpl(licenseId, null, lp);
licenseIds.put(licenseId, ili);
}
ili.addFeature(esa.getProvideFeature());
}
}
}
licenses.addAll(licenseIds.values());
return licenses;
} | java | public Set<InstallLicense> getFeatureLicense(Collection<String> featureIds, File fromDir, String toExtension, boolean offlineOnly, Locale locale) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
ArrayList<String> unresolvedFeatures = new ArrayList<String>();
Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, toExtension);
getResolveDirector().resolve(featureIds, fromDir, toExtension, offlineOnly, installAssets, unresolvedFeatures);
if (!offlineOnly && !unresolvedFeatures.isEmpty()) {
log(Level.FINEST, "getFeatureLicense() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath());
licenses = getFeatureLicense(unresolvedFeatures, locale, null, null);
}
if (installAssets.isEmpty()) {
return licenses;
}
getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets);
Map<String, InstallLicenseImpl> licenseIds = new HashMap<String, InstallLicenseImpl>();
for (InstallAsset installAsset : installAssets) {
if (installAsset.isFeature()) {
ESAAsset esa = (ESAAsset) installAsset;
if (esa.isPublic()) {
ExeInstallAction.incrementNumOfLocalFeatures();
}
LicenseProvider lp = esa.getLicenseProvider(locale);
String licenseId = esa.getLicenseId();
if (licenseId != null && !licenseId.isEmpty()) {
InstallLicenseImpl ili = licenseIds.get(licenseId);
if (ili == null) {
ili = new InstallLicenseImpl(licenseId, null, lp);
licenseIds.put(licenseId, ili);
}
ili.addFeature(esa.getProvideFeature());
}
}
}
licenses.addAll(licenseIds.values());
return licenses;
} | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getFeatureLicense",
"(",
"Collection",
"<",
"String",
">",
"featureIds",
",",
"File",
"fromDir",
",",
"String",
"toExtension",
",",
"boolean",
"offlineOnly",
",",
"Locale",
"locale",
")",
"throws",
"InstallException",
"{",
"Set",
"<",
"InstallLicense",
">",
"licenses",
"=",
"new",
"HashSet",
"<",
"InstallLicense",
">",
"(",
")",
";",
"ArrayList",
"<",
"InstallAsset",
">",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"InstallAsset",
">",
"(",
")",
";",
"ArrayList",
"<",
"String",
">",
"unresolvedFeatures",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collection",
"<",
"ESAAsset",
">",
"autoFeatures",
"=",
"getResolveDirector",
"(",
")",
".",
"getAutoFeature",
"(",
"fromDir",
",",
"toExtension",
")",
";",
"getResolveDirector",
"(",
")",
".",
"resolve",
"(",
"featureIds",
",",
"fromDir",
",",
"toExtension",
",",
"offlineOnly",
",",
"installAssets",
",",
"unresolvedFeatures",
")",
";",
"if",
"(",
"!",
"offlineOnly",
"&&",
"!",
"unresolvedFeatures",
".",
"isEmpty",
"(",
")",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"getFeatureLicense() determined unresolved features: \"",
"+",
"unresolvedFeatures",
".",
"toString",
"(",
")",
"+",
"\" from \"",
"+",
"fromDir",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"licenses",
"=",
"getFeatureLicense",
"(",
"unresolvedFeatures",
",",
"locale",
",",
"null",
",",
"null",
")",
";",
"}",
"if",
"(",
"installAssets",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"licenses",
";",
"}",
"getResolveDirector",
"(",
")",
".",
"resolveAutoFeatures",
"(",
"autoFeatures",
",",
"installAssets",
")",
";",
"Map",
"<",
"String",
",",
"InstallLicenseImpl",
">",
"licenseIds",
"=",
"new",
"HashMap",
"<",
"String",
",",
"InstallLicenseImpl",
">",
"(",
")",
";",
"for",
"(",
"InstallAsset",
"installAsset",
":",
"installAssets",
")",
"{",
"if",
"(",
"installAsset",
".",
"isFeature",
"(",
")",
")",
"{",
"ESAAsset",
"esa",
"=",
"(",
"ESAAsset",
")",
"installAsset",
";",
"if",
"(",
"esa",
".",
"isPublic",
"(",
")",
")",
"{",
"ExeInstallAction",
".",
"incrementNumOfLocalFeatures",
"(",
")",
";",
"}",
"LicenseProvider",
"lp",
"=",
"esa",
".",
"getLicenseProvider",
"(",
"locale",
")",
";",
"String",
"licenseId",
"=",
"esa",
".",
"getLicenseId",
"(",
")",
";",
"if",
"(",
"licenseId",
"!=",
"null",
"&&",
"!",
"licenseId",
".",
"isEmpty",
"(",
")",
")",
"{",
"InstallLicenseImpl",
"ili",
"=",
"licenseIds",
".",
"get",
"(",
"licenseId",
")",
";",
"if",
"(",
"ili",
"==",
"null",
")",
"{",
"ili",
"=",
"new",
"InstallLicenseImpl",
"(",
"licenseId",
",",
"null",
",",
"lp",
")",
";",
"licenseIds",
".",
"put",
"(",
"licenseId",
",",
"ili",
")",
";",
"}",
"ili",
".",
"addFeature",
"(",
"esa",
".",
"getProvideFeature",
"(",
")",
")",
";",
"}",
"}",
"}",
"licenses",
".",
"addAll",
"(",
"licenseIds",
".",
"values",
"(",
")",
")",
";",
"return",
"licenses",
";",
"}"
] | Creates a set of install licenses for all features to be installed
@param featureIds collection of feature ids as strings to get the licenses from
@param fromDir the directory of the features
@param toExtension location of a product extension
@param offlineOnly if features should be only retrieved locally
@param locale Locale for the licenses
@return Set of InstallLicenses
@throws InstallException | [
"Creates",
"a",
"set",
"of",
"install",
"licenses",
"for",
"all",
"features",
"to",
"be",
"installed"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L556-L591 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getFeatureLicense | public Set<InstallLicense> getFeatureLicense(String esaLocation, Locale locale) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
getResolveDirector().resolve(esaLocation, "", product.getInstalledFeatures(), installAssets, 10, 40);
if (installAssets.isEmpty()) {
return licenses;
}
Map<String, InstallLicenseImpl> licenseIds = new HashMap<String, InstallLicenseImpl>();
for (InstallAsset installAsset : installAssets) {
if (installAsset.isFeature()) {
ESAAsset esa = (ESAAsset) installAsset;
LicenseProvider lp = esa.getLicenseProvider(locale);
String licenseId = esa.getLicenseId();
if (licenseId != null && !licenseId.isEmpty()) {
InstallLicenseImpl ili = licenseIds.get(licenseId);
if (ili == null) {
ili = new InstallLicenseImpl(licenseId, null, lp);
licenseIds.put(licenseId, ili);
}
ili.addFeature(esa.getProvideFeature());
}
}
}
licenses.addAll(licenseIds.values());
return licenses;
} | java | public Set<InstallLicense> getFeatureLicense(String esaLocation, Locale locale) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
getResolveDirector().resolve(esaLocation, "", product.getInstalledFeatures(), installAssets, 10, 40);
if (installAssets.isEmpty()) {
return licenses;
}
Map<String, InstallLicenseImpl> licenseIds = new HashMap<String, InstallLicenseImpl>();
for (InstallAsset installAsset : installAssets) {
if (installAsset.isFeature()) {
ESAAsset esa = (ESAAsset) installAsset;
LicenseProvider lp = esa.getLicenseProvider(locale);
String licenseId = esa.getLicenseId();
if (licenseId != null && !licenseId.isEmpty()) {
InstallLicenseImpl ili = licenseIds.get(licenseId);
if (ili == null) {
ili = new InstallLicenseImpl(licenseId, null, lp);
licenseIds.put(licenseId, ili);
}
ili.addFeature(esa.getProvideFeature());
}
}
}
licenses.addAll(licenseIds.values());
return licenses;
} | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getFeatureLicense",
"(",
"String",
"esaLocation",
",",
"Locale",
"locale",
")",
"throws",
"InstallException",
"{",
"Set",
"<",
"InstallLicense",
">",
"licenses",
"=",
"new",
"HashSet",
"<",
"InstallLicense",
">",
"(",
")",
";",
"ArrayList",
"<",
"InstallAsset",
">",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"InstallAsset",
">",
"(",
")",
";",
"getResolveDirector",
"(",
")",
".",
"resolve",
"(",
"esaLocation",
",",
"\"\"",
",",
"product",
".",
"getInstalledFeatures",
"(",
")",
",",
"installAssets",
",",
"10",
",",
"40",
")",
";",
"if",
"(",
"installAssets",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"licenses",
";",
"}",
"Map",
"<",
"String",
",",
"InstallLicenseImpl",
">",
"licenseIds",
"=",
"new",
"HashMap",
"<",
"String",
",",
"InstallLicenseImpl",
">",
"(",
")",
";",
"for",
"(",
"InstallAsset",
"installAsset",
":",
"installAssets",
")",
"{",
"if",
"(",
"installAsset",
".",
"isFeature",
"(",
")",
")",
"{",
"ESAAsset",
"esa",
"=",
"(",
"ESAAsset",
")",
"installAsset",
";",
"LicenseProvider",
"lp",
"=",
"esa",
".",
"getLicenseProvider",
"(",
"locale",
")",
";",
"String",
"licenseId",
"=",
"esa",
".",
"getLicenseId",
"(",
")",
";",
"if",
"(",
"licenseId",
"!=",
"null",
"&&",
"!",
"licenseId",
".",
"isEmpty",
"(",
")",
")",
"{",
"InstallLicenseImpl",
"ili",
"=",
"licenseIds",
".",
"get",
"(",
"licenseId",
")",
";",
"if",
"(",
"ili",
"==",
"null",
")",
"{",
"ili",
"=",
"new",
"InstallLicenseImpl",
"(",
"licenseId",
",",
"null",
",",
"lp",
")",
";",
"licenseIds",
".",
"put",
"(",
"licenseId",
",",
"ili",
")",
";",
"}",
"ili",
".",
"addFeature",
"(",
"esa",
".",
"getProvideFeature",
"(",
")",
")",
";",
"}",
"}",
"}",
"licenses",
".",
"addAll",
"(",
"licenseIds",
".",
"values",
"(",
")",
")",
";",
"return",
"licenses",
";",
"}"
] | Gets the licenses for the specified esa location.
@param esaLocation location of esa
@param locale Locale for the license
@return A set of InstallLicenses for the features at the esa location
@throws InstallException | [
"Gets",
"the",
"licenses",
"for",
"the",
"specified",
"esa",
"location",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L601-L627 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getFeatureLicense | public Set<InstallLicense> getFeatureLicense(Collection<String> featureNames, Locale locale, String userId, String password) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
if (featureNames == null || featureNames.isEmpty())
return licenses;
Map<String, List<List<RepositoryResource>>> installResources = getResolveDirector().resolveMap(featureNames, DownloadOption.required, userId, password);
if (isEmpty(installResources)) {
this.installAssets = new ArrayList<List<InstallAsset>>(0);
return licenses;
}
return getFeatureLicense(locale, installResources);
} | java | public Set<InstallLicense> getFeatureLicense(Collection<String> featureNames, Locale locale, String userId, String password) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
if (featureNames == null || featureNames.isEmpty())
return licenses;
Map<String, List<List<RepositoryResource>>> installResources = getResolveDirector().resolveMap(featureNames, DownloadOption.required, userId, password);
if (isEmpty(installResources)) {
this.installAssets = new ArrayList<List<InstallAsset>>(0);
return licenses;
}
return getFeatureLicense(locale, installResources);
} | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getFeatureLicense",
"(",
"Collection",
"<",
"String",
">",
"featureNames",
",",
"Locale",
"locale",
",",
"String",
"userId",
",",
"String",
"password",
")",
"throws",
"InstallException",
"{",
"Set",
"<",
"InstallLicense",
">",
"licenses",
"=",
"new",
"HashSet",
"<",
"InstallLicense",
">",
"(",
")",
";",
"if",
"(",
"featureNames",
"==",
"null",
"||",
"featureNames",
".",
"isEmpty",
"(",
")",
")",
"return",
"licenses",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
">",
"installResources",
"=",
"getResolveDirector",
"(",
")",
".",
"resolveMap",
"(",
"featureNames",
",",
"DownloadOption",
".",
"required",
",",
"userId",
",",
"password",
")",
";",
"if",
"(",
"isEmpty",
"(",
"installResources",
")",
")",
"{",
"this",
".",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"InstallAsset",
">",
">",
"(",
"0",
")",
";",
"return",
"licenses",
";",
"}",
"return",
"getFeatureLicense",
"(",
"locale",
",",
"installResources",
")",
";",
"}"
] | Gets the licenses for the specified feature names
@param featureNames a collection of the feature names
@param locale Locale for the licenses
@param userId userId for the repository
@param password password for the repository
@return A set of installLicenses for the featuresNames
@throws InstallException | [
"Gets",
"the",
"licenses",
"for",
"the",
"specified",
"feature",
"names"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L639-L651 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getServerPackageFeatureLicense | public Set<InstallLicense> getServerPackageFeatureLicense(File archive, boolean offlineOnly, Locale locale) throws InstallException {
String aName = archive.getAbsolutePath().toLowerCase();
ServerPackageAsset spa = null;
if (ServerPackageZipAsset.validType(aName)) {
spa = new ServerPackageZipAsset(archive, false);
} else if (ServerPackageJarAsset.validType(aName)) {
spa = new ServerPackageJarAsset(archive, false);
} else {
return new HashSet<InstallLicense>();
}
return getFeatureLicense(spa.getRequiredFeatures(), locale, null, null);
} | java | public Set<InstallLicense> getServerPackageFeatureLicense(File archive, boolean offlineOnly, Locale locale) throws InstallException {
String aName = archive.getAbsolutePath().toLowerCase();
ServerPackageAsset spa = null;
if (ServerPackageZipAsset.validType(aName)) {
spa = new ServerPackageZipAsset(archive, false);
} else if (ServerPackageJarAsset.validType(aName)) {
spa = new ServerPackageJarAsset(archive, false);
} else {
return new HashSet<InstallLicense>();
}
return getFeatureLicense(spa.getRequiredFeatures(), locale, null, null);
} | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getServerPackageFeatureLicense",
"(",
"File",
"archive",
",",
"boolean",
"offlineOnly",
",",
"Locale",
"locale",
")",
"throws",
"InstallException",
"{",
"String",
"aName",
"=",
"archive",
".",
"getAbsolutePath",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"ServerPackageAsset",
"spa",
"=",
"null",
";",
"if",
"(",
"ServerPackageZipAsset",
".",
"validType",
"(",
"aName",
")",
")",
"{",
"spa",
"=",
"new",
"ServerPackageZipAsset",
"(",
"archive",
",",
"false",
")",
";",
"}",
"else",
"if",
"(",
"ServerPackageJarAsset",
".",
"validType",
"(",
"aName",
")",
")",
"{",
"spa",
"=",
"new",
"ServerPackageJarAsset",
"(",
"archive",
",",
"false",
")",
";",
"}",
"else",
"{",
"return",
"new",
"HashSet",
"<",
"InstallLicense",
">",
"(",
")",
";",
"}",
"return",
"getFeatureLicense",
"(",
"spa",
".",
"getRequiredFeatures",
"(",
")",
",",
"locale",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets the licenses for the specified archive file
@param archive the archive file
@param offlineOnly if features should be only retrieved locally
@param locale Locale for the licenses
@return A set of InstallLicesese for the features in the archive file
@throws InstallException | [
"Gets",
"the",
"licenses",
"for",
"the",
"specified",
"archive",
"file"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L719-L731 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getServerFeatureLicense | public Set<InstallLicense> getServerFeatureLicense(File serverXML, boolean offlineOnly, Locale locale) throws InstallException, IOException {
if (null != serverXML) {
return getFeatureLicense(new ServerAsset(serverXML).getRequiredFeatures(), locale, null, null);
}
return new HashSet<InstallLicense>();
} | java | public Set<InstallLicense> getServerFeatureLicense(File serverXML, boolean offlineOnly, Locale locale) throws InstallException, IOException {
if (null != serverXML) {
return getFeatureLicense(new ServerAsset(serverXML).getRequiredFeatures(), locale, null, null);
}
return new HashSet<InstallLicense>();
} | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getServerFeatureLicense",
"(",
"File",
"serverXML",
",",
"boolean",
"offlineOnly",
",",
"Locale",
"locale",
")",
"throws",
"InstallException",
",",
"IOException",
"{",
"if",
"(",
"null",
"!=",
"serverXML",
")",
"{",
"return",
"getFeatureLicense",
"(",
"new",
"ServerAsset",
"(",
"serverXML",
")",
".",
"getRequiredFeatures",
"(",
")",
",",
"locale",
",",
"null",
",",
"null",
")",
";",
"}",
"return",
"new",
"HashSet",
"<",
"InstallLicense",
">",
"(",
")",
";",
"}"
] | Gets the licenses for the specified server XML file
@param serverXML The server XML file
@param offlineOnly if features should be only retrieved locally
@param locale Locale for the licenses
@return Set of InstallLicenses for the features found in the server XML file
@throws InstallException
@throws IOException | [
"Gets",
"the",
"licenses",
"for",
"the",
"specified",
"server",
"XML",
"file"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L743-L749 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.cleanUp | public void cleanUp() {
fireProgressEvent(InstallProgressEvent.CLEAN_UP, 98, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CLEANING"));
if (installAssets != null) {
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset asset : iaList) {
asset.delete();
}
}
}
boolean del = InstallUtils.deleteDirectory(this.product.getInstallTempDir());
if (!del)
this.product.getInstallTempDir().deleteOnExit();
installAssets = null;
setScriptsPermission = false;
if (resolveDirector != null)
resolveDirector.cleanUp();
if (uninstallDirector != null)
uninstallDirector.cleanUp();
log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("MSG_CLEANUP_SUCCESS"));
} | java | public void cleanUp() {
fireProgressEvent(InstallProgressEvent.CLEAN_UP, 98, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CLEANING"));
if (installAssets != null) {
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset asset : iaList) {
asset.delete();
}
}
}
boolean del = InstallUtils.deleteDirectory(this.product.getInstallTempDir());
if (!del)
this.product.getInstallTempDir().deleteOnExit();
installAssets = null;
setScriptsPermission = false;
if (resolveDirector != null)
resolveDirector.cleanUp();
if (uninstallDirector != null)
uninstallDirector.cleanUp();
log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("MSG_CLEANUP_SUCCESS"));
} | [
"public",
"void",
"cleanUp",
"(",
")",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CLEAN_UP",
",",
"98",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_CLEANING\"",
")",
")",
";",
"if",
"(",
"installAssets",
"!=",
"null",
")",
"{",
"for",
"(",
"List",
"<",
"InstallAsset",
">",
"iaList",
":",
"installAssets",
")",
"{",
"for",
"(",
"InstallAsset",
"asset",
":",
"iaList",
")",
"{",
"asset",
".",
"delete",
"(",
")",
";",
"}",
"}",
"}",
"boolean",
"del",
"=",
"InstallUtils",
".",
"deleteDirectory",
"(",
"this",
".",
"product",
".",
"getInstallTempDir",
"(",
")",
")",
";",
"if",
"(",
"!",
"del",
")",
"this",
".",
"product",
".",
"getInstallTempDir",
"(",
")",
".",
"deleteOnExit",
"(",
")",
";",
"installAssets",
"=",
"null",
";",
"setScriptsPermission",
"=",
"false",
";",
"if",
"(",
"resolveDirector",
"!=",
"null",
")",
"resolveDirector",
".",
"cleanUp",
"(",
")",
";",
"if",
"(",
"uninstallDirector",
"!=",
"null",
")",
"uninstallDirector",
".",
"cleanUp",
"(",
")",
";",
"log",
"(",
"Level",
".",
"FINE",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"MSG_CLEANUP_SUCCESS\"",
")",
")",
";",
"}"
] | Clean up the downloaded install assets;
reset installAssets and uninstallAssets. | [
"Clean",
"up",
"the",
"downloaded",
"install",
"assets",
";",
"reset",
"installAssets",
"and",
"uninstallAssets",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L972-L991 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getInstalledFeatureNames | public Collection<String> getInstalledFeatureNames() {
if (installAssets == null)
return null;
Collection<String> installed = new ArrayList<String>();
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset asset : iaList) {
if (asset.isFeature()) {
ESAAsset esa = (ESAAsset) asset;
if (esa.isPublic()) {
String esaName = esa.getShortName();
if (esaName == null || esaName.isEmpty())
esaName = esa.getFeatureName();
installed.add(esaName);
}
}
}
}
return installed;
} | java | public Collection<String> getInstalledFeatureNames() {
if (installAssets == null)
return null;
Collection<String> installed = new ArrayList<String>();
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset asset : iaList) {
if (asset.isFeature()) {
ESAAsset esa = (ESAAsset) asset;
if (esa.isPublic()) {
String esaName = esa.getShortName();
if (esaName == null || esaName.isEmpty())
esaName = esa.getFeatureName();
installed.add(esaName);
}
}
}
}
return installed;
} | [
"public",
"Collection",
"<",
"String",
">",
"getInstalledFeatureNames",
"(",
")",
"{",
"if",
"(",
"installAssets",
"==",
"null",
")",
"return",
"null",
";",
"Collection",
"<",
"String",
">",
"installed",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"List",
"<",
"InstallAsset",
">",
"iaList",
":",
"installAssets",
")",
"{",
"for",
"(",
"InstallAsset",
"asset",
":",
"iaList",
")",
"{",
"if",
"(",
"asset",
".",
"isFeature",
"(",
")",
")",
"{",
"ESAAsset",
"esa",
"=",
"(",
"ESAAsset",
")",
"asset",
";",
"if",
"(",
"esa",
".",
"isPublic",
"(",
")",
")",
"{",
"String",
"esaName",
"=",
"esa",
".",
"getShortName",
"(",
")",
";",
"if",
"(",
"esaName",
"==",
"null",
"||",
"esaName",
".",
"isEmpty",
"(",
")",
")",
"esaName",
"=",
"esa",
".",
"getFeatureName",
"(",
")",
";",
"installed",
".",
"add",
"(",
"esaName",
")",
";",
"}",
"}",
"}",
"}",
"return",
"installed",
";",
"}"
] | Get a collection of installed feature names
@return installed feature name collection | [
"Get",
"a",
"collection",
"of",
"installed",
"feature",
"names"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L998-L1016 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.enableConsoleLog | public void enableConsoleLog(Level level, boolean verbose) {
InstallLogUtils.enableConsoleLogging(level, verbose);
InstallLogUtils.enableConsoleErrorLogging(verbose);
} | java | public void enableConsoleLog(Level level, boolean verbose) {
InstallLogUtils.enableConsoleLogging(level, verbose);
InstallLogUtils.enableConsoleErrorLogging(verbose);
} | [
"public",
"void",
"enableConsoleLog",
"(",
"Level",
"level",
",",
"boolean",
"verbose",
")",
"{",
"InstallLogUtils",
".",
"enableConsoleLogging",
"(",
"level",
",",
"verbose",
")",
";",
"InstallLogUtils",
".",
"enableConsoleErrorLogging",
"(",
"verbose",
")",
";",
"}"
] | Enables console logging amd console error logging
@param level Level of log
@param verbose if verbose should be set | [
"Enables",
"console",
"logging",
"amd",
"console",
"error",
"logging"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1041-L1044 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.reapplyFixIfNeeded | public void reapplyFixIfNeeded() throws ReapplyFixException {
BundleRepositoryRegistry.initializeDefaults(null, false);
Set<String> fixesToReapply = ValidateCommandTask.getFixesToReapply(product.getManifestFileProcessor(), new InstallUtils.InstallCommandConsole());
try {
fireProgressEvent(InstallProgressEvent.CHECK, 90, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_VALIDATING_FIXES", fixesToReapply.toString()));
this.enableEvent = false;
if (fixesToReapply.isEmpty()) {
log(Level.FINEST, "No fix is required to be reapplied.");
} else {
installFixes(fixesToReapply, null, null);
install(ExistsAction.replace, false, false);
log(Level.FINEST, "Successfully reapplied the following fixes: " + fixesToReapply.toString());
}
} catch (InstallException e) {
log(Level.FINEST, "Failed to reapply the following fixes: " + fixesToReapply.toString());
throw new ReapplyFixException(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_REINSTALL_FIXES_WARNING",
fixesToReapply.toString()).trim(), e, InstallException.RUNTIME_EXCEPTION);
} finally {
this.enableEvent = true;
}
} | java | public void reapplyFixIfNeeded() throws ReapplyFixException {
BundleRepositoryRegistry.initializeDefaults(null, false);
Set<String> fixesToReapply = ValidateCommandTask.getFixesToReapply(product.getManifestFileProcessor(), new InstallUtils.InstallCommandConsole());
try {
fireProgressEvent(InstallProgressEvent.CHECK, 90, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_VALIDATING_FIXES", fixesToReapply.toString()));
this.enableEvent = false;
if (fixesToReapply.isEmpty()) {
log(Level.FINEST, "No fix is required to be reapplied.");
} else {
installFixes(fixesToReapply, null, null);
install(ExistsAction.replace, false, false);
log(Level.FINEST, "Successfully reapplied the following fixes: " + fixesToReapply.toString());
}
} catch (InstallException e) {
log(Level.FINEST, "Failed to reapply the following fixes: " + fixesToReapply.toString());
throw new ReapplyFixException(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("LOG_REINSTALL_FIXES_WARNING",
fixesToReapply.toString()).trim(), e, InstallException.RUNTIME_EXCEPTION);
} finally {
this.enableEvent = true;
}
} | [
"public",
"void",
"reapplyFixIfNeeded",
"(",
")",
"throws",
"ReapplyFixException",
"{",
"BundleRepositoryRegistry",
".",
"initializeDefaults",
"(",
"null",
",",
"false",
")",
";",
"Set",
"<",
"String",
">",
"fixesToReapply",
"=",
"ValidateCommandTask",
".",
"getFixesToReapply",
"(",
"product",
".",
"getManifestFileProcessor",
"(",
")",
",",
"new",
"InstallUtils",
".",
"InstallCommandConsole",
"(",
")",
")",
";",
"try",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CHECK",
",",
"90",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_VALIDATING_FIXES\"",
",",
"fixesToReapply",
".",
"toString",
"(",
")",
")",
")",
";",
"this",
".",
"enableEvent",
"=",
"false",
";",
"if",
"(",
"fixesToReapply",
".",
"isEmpty",
"(",
")",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"No fix is required to be reapplied.\"",
")",
";",
"}",
"else",
"{",
"installFixes",
"(",
"fixesToReapply",
",",
"null",
",",
"null",
")",
";",
"install",
"(",
"ExistsAction",
".",
"replace",
",",
"false",
",",
"false",
")",
";",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Successfully reapplied the following fixes: \"",
"+",
"fixesToReapply",
".",
"toString",
"(",
")",
")",
";",
"}",
"}",
"catch",
"(",
"InstallException",
"e",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Failed to reapply the following fixes: \"",
"+",
"fixesToReapply",
".",
"toString",
"(",
")",
")",
";",
"throw",
"new",
"ReapplyFixException",
"(",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"LOG_REINSTALL_FIXES_WARNING\"",
",",
"fixesToReapply",
".",
"toString",
"(",
")",
")",
".",
"trim",
"(",
")",
",",
"e",
",",
"InstallException",
".",
"RUNTIME_EXCEPTION",
")",
";",
"}",
"finally",
"{",
"this",
".",
"enableEvent",
"=",
"true",
";",
"}",
"}"
] | Reinstalls fixes that need to be applied again if any exist
@throws ReapplyFixException | [
"Reinstalls",
"fixes",
"that",
"need",
"to",
"be",
"applied",
"again",
"if",
"any",
"exist"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1051-L1071 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.setScriptsPermission | public void setScriptsPermission(int event) {
if (event == InstallProgressEvent.POST_INSTALL ? setScriptsPermission : getUninstallDirector().needToSetScriptsPermission()) {
fireProgressEvent(event, 95, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_SET_SCRIPTS_PERMISSION"));
try {
SelfExtractUtils.fixScriptPermissions(new SelfExtractor.NullExtractProgress(), product.getInstallDir(), null);
} catch (Exception e) {
}
}
} | java | public void setScriptsPermission(int event) {
if (event == InstallProgressEvent.POST_INSTALL ? setScriptsPermission : getUninstallDirector().needToSetScriptsPermission()) {
fireProgressEvent(event, 95, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_SET_SCRIPTS_PERMISSION"));
try {
SelfExtractUtils.fixScriptPermissions(new SelfExtractor.NullExtractProgress(), product.getInstallDir(), null);
} catch (Exception e) {
}
}
} | [
"public",
"void",
"setScriptsPermission",
"(",
"int",
"event",
")",
"{",
"if",
"(",
"event",
"==",
"InstallProgressEvent",
".",
"POST_INSTALL",
"?",
"setScriptsPermission",
":",
"getUninstallDirector",
"(",
")",
".",
"needToSetScriptsPermission",
"(",
")",
")",
"{",
"fireProgressEvent",
"(",
"event",
",",
"95",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_SET_SCRIPTS_PERMISSION\"",
")",
")",
";",
"try",
"{",
"SelfExtractUtils",
".",
"fixScriptPermissions",
"(",
"new",
"SelfExtractor",
".",
"NullExtractProgress",
"(",
")",
",",
"product",
".",
"getInstallDir",
"(",
")",
",",
"null",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"}",
"}",
"}"
] | Sets the scripts permissions to executable
@param event what event to set permissions for | [
"Sets",
"the",
"scripts",
"permissions",
"to",
"executable"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1078-L1087 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.queryFeatures | public List<EsaResource> queryFeatures(String searchStr) throws InstallException {
List<EsaResource> features = new ArrayList<EsaResource>();
RepositoryConnectionList loginInfo = getResolveDirector().getRepositoryConnectionList(null, null, null, this.getClass().getCanonicalName() + ".queryFeatures");
try {
for (ProductInfo productInfo : ProductInfo.getAllProductInfo().values()) {
log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("MSG_SEARCHING_FEATURES"));
features.addAll(loginInfo.findMatchingEsas(searchStr, new ProductInfoProductDefinition(productInfo), Visibility.PUBLIC));
log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("MSG_SEARCHING_ADDONS"));
features.addAll(loginInfo.findMatchingEsas(searchStr, new ProductInfoProductDefinition(productInfo), Visibility.INSTALL));
}
log(Level.FINE, " ");
} catch (ProductInfoParseException pipe) {
throw ExceptionUtils.create(pipe);
} catch (DuplicateProductInfoException dpie) {
throw ExceptionUtils.create(dpie);
} catch (ProductInfoReplaceException pire) {
throw ExceptionUtils.create(pire);
} catch (RepositoryException re) {
throw ExceptionUtils.create(re, re.getCause(), getResolveDirector().getProxy(), getResolveDirector().defaultRepo());
}
return features;
} | java | public List<EsaResource> queryFeatures(String searchStr) throws InstallException {
List<EsaResource> features = new ArrayList<EsaResource>();
RepositoryConnectionList loginInfo = getResolveDirector().getRepositoryConnectionList(null, null, null, this.getClass().getCanonicalName() + ".queryFeatures");
try {
for (ProductInfo productInfo : ProductInfo.getAllProductInfo().values()) {
log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("MSG_SEARCHING_FEATURES"));
features.addAll(loginInfo.findMatchingEsas(searchStr, new ProductInfoProductDefinition(productInfo), Visibility.PUBLIC));
log(Level.FINE, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("MSG_SEARCHING_ADDONS"));
features.addAll(loginInfo.findMatchingEsas(searchStr, new ProductInfoProductDefinition(productInfo), Visibility.INSTALL));
}
log(Level.FINE, " ");
} catch (ProductInfoParseException pipe) {
throw ExceptionUtils.create(pipe);
} catch (DuplicateProductInfoException dpie) {
throw ExceptionUtils.create(dpie);
} catch (ProductInfoReplaceException pire) {
throw ExceptionUtils.create(pire);
} catch (RepositoryException re) {
throw ExceptionUtils.create(re, re.getCause(), getResolveDirector().getProxy(), getResolveDirector().defaultRepo());
}
return features;
} | [
"public",
"List",
"<",
"EsaResource",
">",
"queryFeatures",
"(",
"String",
"searchStr",
")",
"throws",
"InstallException",
"{",
"List",
"<",
"EsaResource",
">",
"features",
"=",
"new",
"ArrayList",
"<",
"EsaResource",
">",
"(",
")",
";",
"RepositoryConnectionList",
"loginInfo",
"=",
"getResolveDirector",
"(",
")",
".",
"getRepositoryConnectionList",
"(",
"null",
",",
"null",
",",
"null",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
"+",
"\".queryFeatures\"",
")",
";",
"try",
"{",
"for",
"(",
"ProductInfo",
"productInfo",
":",
"ProductInfo",
".",
"getAllProductInfo",
"(",
")",
".",
"values",
"(",
")",
")",
"{",
"log",
"(",
"Level",
".",
"FINE",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"MSG_SEARCHING_FEATURES\"",
")",
")",
";",
"features",
".",
"addAll",
"(",
"loginInfo",
".",
"findMatchingEsas",
"(",
"searchStr",
",",
"new",
"ProductInfoProductDefinition",
"(",
"productInfo",
")",
",",
"Visibility",
".",
"PUBLIC",
")",
")",
";",
"log",
"(",
"Level",
".",
"FINE",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"MSG_SEARCHING_ADDONS\"",
")",
")",
";",
"features",
".",
"addAll",
"(",
"loginInfo",
".",
"findMatchingEsas",
"(",
"searchStr",
",",
"new",
"ProductInfoProductDefinition",
"(",
"productInfo",
")",
",",
"Visibility",
".",
"INSTALL",
")",
")",
";",
"}",
"log",
"(",
"Level",
".",
"FINE",
",",
"\" \"",
")",
";",
"}",
"catch",
"(",
"ProductInfoParseException",
"pipe",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"pipe",
")",
";",
"}",
"catch",
"(",
"DuplicateProductInfoException",
"dpie",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"dpie",
")",
";",
"}",
"catch",
"(",
"ProductInfoReplaceException",
"pire",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"pire",
")",
";",
"}",
"catch",
"(",
"RepositoryException",
"re",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"re",
",",
"re",
".",
"getCause",
"(",
")",
",",
"getResolveDirector",
"(",
")",
".",
"getProxy",
"(",
")",
",",
"getResolveDirector",
"(",
")",
".",
"defaultRepo",
"(",
")",
")",
";",
"}",
"return",
"features",
";",
"}"
] | Searches for features that match the specified search string
@param searchStr the search string
@return List of EsaResources matching the search string
@throws InstallException | [
"Searches",
"for",
"features",
"that",
"match",
"the",
"specified",
"search",
"string"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1104-L1125 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.downloadAssetsInstallUtility | public Map<String, Collection<String>> downloadAssetsInstallUtility(Set<String> assetsNames, File toDir, DownloadOption downloadOption, String user, String password,
boolean isOverride) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
createRepoConfig(toDir, assetsNames);
if (assetsNames == null || assetsNames.isEmpty()) {
throw ExceptionUtils.createByKey("ERROR_ASSETS_LIST_INVALID");
}
Map<String, Collection<String>> downloaded = new HashMap<String, Collection<String>>();
RepositoryDownloadUtil.writeResourcesToDiskRepo(downloaded, toDir, getResolveDirector().getInstallResources(), this.product.getProductVersion(),
eventManager, getResolveDirector().defaultRepo());
return downloaded;
} | java | public Map<String, Collection<String>> downloadAssetsInstallUtility(Set<String> assetsNames, File toDir, DownloadOption downloadOption, String user, String password,
boolean isOverride) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING"));
createRepoConfig(toDir, assetsNames);
if (assetsNames == null || assetsNames.isEmpty()) {
throw ExceptionUtils.createByKey("ERROR_ASSETS_LIST_INVALID");
}
Map<String, Collection<String>> downloaded = new HashMap<String, Collection<String>>();
RepositoryDownloadUtil.writeResourcesToDiskRepo(downloaded, toDir, getResolveDirector().getInstallResources(), this.product.getProductVersion(),
eventManager, getResolveDirector().defaultRepo());
return downloaded;
} | [
"public",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"downloadAssetsInstallUtility",
"(",
"Set",
"<",
"String",
">",
"assetsNames",
",",
"File",
"toDir",
",",
"DownloadOption",
"downloadOption",
",",
"String",
"user",
",",
"String",
"password",
",",
"boolean",
"isOverride",
")",
"throws",
"InstallException",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CHECK",
",",
"1",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_CHECKING\"",
")",
")",
";",
"createRepoConfig",
"(",
"toDir",
",",
"assetsNames",
")",
";",
"if",
"(",
"assetsNames",
"==",
"null",
"||",
"assetsNames",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"\"ERROR_ASSETS_LIST_INVALID\"",
")",
";",
"}",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"downloaded",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"(",
")",
";",
"RepositoryDownloadUtil",
".",
"writeResourcesToDiskRepo",
"(",
"downloaded",
",",
"toDir",
",",
"getResolveDirector",
"(",
")",
".",
"getInstallResources",
"(",
")",
",",
"this",
".",
"product",
".",
"getProductVersion",
"(",
")",
",",
"eventManager",
",",
"getResolveDirector",
"(",
")",
".",
"defaultRepo",
"(",
")",
")",
";",
"return",
"downloaded",
";",
"}"
] | Downloads the assets specified in assetsNames using Install Utility
@param assetsNames Set of asset names to download
@param toDir Location to download assets to
@param downloadOption What dependencies should be downloaded as a DownloadOption object
@param user user id of repository
@param password password of repository
@param isOverride not used
@return Map of asset type pointing to a collection of asset names of that type downloaded
@throws InstallException | [
"Downloads",
"the",
"assets",
"specified",
"in",
"assetsNames",
"using",
"Install",
"Utility"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1293-L1306 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getInstalledCoreFeatures | public Map<String, InstalledFeature> getInstalledCoreFeatures() {
try {
Map<String, InstalledFeature> installedFeatures = new TreeMap<String, InstalledFeature>();
Map<String, ProvisioningFeatureDefinition> fdMap = product.getCoreFeatureDefinitions();
for (Entry<String, ProvisioningFeatureDefinition> entry : fdMap.entrySet()) {
installedFeatures.put(entry.getKey(), new InstalledAssetImpl(entry.getValue()));
}
return installedFeatures;
} catch (FeatureToolException rte) {
log(Level.FINEST, "Director.getInstalledCoreFeatures() got exception.", rte);
return null;
}
} | java | public Map<String, InstalledFeature> getInstalledCoreFeatures() {
try {
Map<String, InstalledFeature> installedFeatures = new TreeMap<String, InstalledFeature>();
Map<String, ProvisioningFeatureDefinition> fdMap = product.getCoreFeatureDefinitions();
for (Entry<String, ProvisioningFeatureDefinition> entry : fdMap.entrySet()) {
installedFeatures.put(entry.getKey(), new InstalledAssetImpl(entry.getValue()));
}
return installedFeatures;
} catch (FeatureToolException rte) {
log(Level.FINEST, "Director.getInstalledCoreFeatures() got exception.", rte);
return null;
}
} | [
"public",
"Map",
"<",
"String",
",",
"InstalledFeature",
">",
"getInstalledCoreFeatures",
"(",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"InstalledFeature",
">",
"installedFeatures",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"InstalledFeature",
">",
"(",
")",
";",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"fdMap",
"=",
"product",
".",
"getCoreFeatureDefinitions",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"entry",
":",
"fdMap",
".",
"entrySet",
"(",
")",
")",
"{",
"installedFeatures",
".",
"put",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"new",
"InstalledAssetImpl",
"(",
"entry",
".",
"getValue",
"(",
")",
")",
")",
";",
"}",
"return",
"installedFeatures",
";",
"}",
"catch",
"(",
"FeatureToolException",
"rte",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Director.getInstalledCoreFeatures() got exception.\"",
",",
"rte",
")",
";",
"return",
"null",
";",
"}",
"}"
] | Gets installed core features
@return Map of feature name to InstalledFeature | [
"Gets",
"installed",
"core",
"features"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1332-L1344 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getInstalledFeatureCollections | public Map<String, InstalledFeatureCollection> getInstalledFeatureCollections() {
try {
Map<String, InstalledFeatureCollection> installedFeatureCollections = new TreeMap<String, InstalledFeatureCollection>();
Map<String, ProvisioningFeatureDefinition> fdMap = product.getFeatureCollectionDefinitions();
for (Entry<String, ProvisioningFeatureDefinition> entry : fdMap.entrySet()) {
installedFeatureCollections.put(entry.getKey(), new InstalledAssetImpl(entry.getValue()));
}
return installedFeatureCollections;
} catch (FeatureToolException rte) {
log(Level.FINEST, "Director.getInstalledFeatureCollections() got exception.", rte);
return null;
}
} | java | public Map<String, InstalledFeatureCollection> getInstalledFeatureCollections() {
try {
Map<String, InstalledFeatureCollection> installedFeatureCollections = new TreeMap<String, InstalledFeatureCollection>();
Map<String, ProvisioningFeatureDefinition> fdMap = product.getFeatureCollectionDefinitions();
for (Entry<String, ProvisioningFeatureDefinition> entry : fdMap.entrySet()) {
installedFeatureCollections.put(entry.getKey(), new InstalledAssetImpl(entry.getValue()));
}
return installedFeatureCollections;
} catch (FeatureToolException rte) {
log(Level.FINEST, "Director.getInstalledFeatureCollections() got exception.", rte);
return null;
}
} | [
"public",
"Map",
"<",
"String",
",",
"InstalledFeatureCollection",
">",
"getInstalledFeatureCollections",
"(",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"InstalledFeatureCollection",
">",
"installedFeatureCollections",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"InstalledFeatureCollection",
">",
"(",
")",
";",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"fdMap",
"=",
"product",
".",
"getFeatureCollectionDefinitions",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"entry",
":",
"fdMap",
".",
"entrySet",
"(",
")",
")",
"{",
"installedFeatureCollections",
".",
"put",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"new",
"InstalledAssetImpl",
"(",
"entry",
".",
"getValue",
"(",
")",
")",
")",
";",
"}",
"return",
"installedFeatureCollections",
";",
"}",
"catch",
"(",
"FeatureToolException",
"rte",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Director.getInstalledFeatureCollections() got exception.\"",
",",
"rte",
")",
";",
"return",
"null",
";",
"}",
"}"
] | Get installed feature collections
@return Map of feature name to InstalledFeatureCollection | [
"Get",
"installed",
"feature",
"collections"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1351-L1363 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installAssets | public void installAssets(Collection<String> assetIds, File fromDir, RepositoryConnectionList loginInfo) throws InstallException {
this.installAssets = new ArrayList<List<InstallAsset>>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
ArrayList<String> unresolvedFeatures = new ArrayList<String>();
Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, InstallConstants.TO_USER);
getResolveDirector().resolve(assetIds, fromDir, InstallConstants.TO_USER, false, installAssets, unresolvedFeatures);
if (!unresolvedFeatures.isEmpty()) {
log(Level.FINEST, "installAssets() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath());
installAssets(unresolvedFeatures, loginInfo);
}
if (!installAssets.isEmpty()) {
getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets);
this.installAssets.add(installAssets);
}
if (this.installAssets.isEmpty()) {
throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ASSETS_ALREADY_INSTALLED", assetIds.toString());
}
} | java | public void installAssets(Collection<String> assetIds, File fromDir, RepositoryConnectionList loginInfo) throws InstallException {
this.installAssets = new ArrayList<List<InstallAsset>>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
ArrayList<String> unresolvedFeatures = new ArrayList<String>();
Collection<ESAAsset> autoFeatures = getResolveDirector().getAutoFeature(fromDir, InstallConstants.TO_USER);
getResolveDirector().resolve(assetIds, fromDir, InstallConstants.TO_USER, false, installAssets, unresolvedFeatures);
if (!unresolvedFeatures.isEmpty()) {
log(Level.FINEST, "installAssets() determined unresolved features: " + unresolvedFeatures.toString() + " from " + fromDir.getAbsolutePath());
installAssets(unresolvedFeatures, loginInfo);
}
if (!installAssets.isEmpty()) {
getResolveDirector().resolveAutoFeatures(autoFeatures, installAssets);
this.installAssets.add(installAssets);
}
if (this.installAssets.isEmpty()) {
throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ASSETS_ALREADY_INSTALLED", assetIds.toString());
}
} | [
"public",
"void",
"installAssets",
"(",
"Collection",
"<",
"String",
">",
"assetIds",
",",
"File",
"fromDir",
",",
"RepositoryConnectionList",
"loginInfo",
")",
"throws",
"InstallException",
"{",
"this",
".",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"InstallAsset",
">",
">",
"(",
")",
";",
"ArrayList",
"<",
"InstallAsset",
">",
"installAssets",
"=",
"new",
"ArrayList",
"<",
"InstallAsset",
">",
"(",
")",
";",
"ArrayList",
"<",
"String",
">",
"unresolvedFeatures",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collection",
"<",
"ESAAsset",
">",
"autoFeatures",
"=",
"getResolveDirector",
"(",
")",
".",
"getAutoFeature",
"(",
"fromDir",
",",
"InstallConstants",
".",
"TO_USER",
")",
";",
"getResolveDirector",
"(",
")",
".",
"resolve",
"(",
"assetIds",
",",
"fromDir",
",",
"InstallConstants",
".",
"TO_USER",
",",
"false",
",",
"installAssets",
",",
"unresolvedFeatures",
")",
";",
"if",
"(",
"!",
"unresolvedFeatures",
".",
"isEmpty",
"(",
")",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"installAssets() determined unresolved features: \"",
"+",
"unresolvedFeatures",
".",
"toString",
"(",
")",
"+",
"\" from \"",
"+",
"fromDir",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"installAssets",
"(",
"unresolvedFeatures",
",",
"loginInfo",
")",
";",
"}",
"if",
"(",
"!",
"installAssets",
".",
"isEmpty",
"(",
")",
")",
"{",
"getResolveDirector",
"(",
")",
".",
"resolveAutoFeatures",
"(",
"autoFeatures",
",",
"installAssets",
")",
";",
"this",
".",
"installAssets",
".",
"add",
"(",
"installAssets",
")",
";",
"}",
"if",
"(",
"this",
".",
"installAssets",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"InstallException",
".",
"ALREADY_EXISTS",
",",
"\"ASSETS_ALREADY_INSTALLED\"",
",",
"assetIds",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | Installs the specified assets from a specific directory
@param assetIds Collection of assetIds to install
@param fromDir Directory to get assets from
@param loginInfo RepositoryConnectionList to obtain unresolved features
@throws InstallException | [
"Installs",
"the",
"specified",
"assets",
"from",
"a",
"specific",
"directory"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1373-L1390 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.installAssets | public void installAssets(Collection<String> assetIds, RepositoryConnectionList loginInfo) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING_ASSETS"));
if (assetIds == null || assetIds.isEmpty()) {
throw ExceptionUtils.createByKey("ERROR_ASSETS_LIST_INVALID");
}
RepositoryConnectionList li = loginInfo == null ? getResolveDirector().getRepositoryConnectionList(null, null, null,
this.getClass().getCanonicalName() + ".installAssets") : loginInfo;
Map<String, List<List<RepositoryResource>>> installResources = getResolveDirector().resolveMap(assetIds, li, false);
if (isEmpty(installResources)) {
throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ASSETS_ALREADY_INSTALLED",
InstallUtils.getShortNames(product.getFeatureDefinitions(), assetIds).toString());
}
downloadAssets(installResources, InstallConstants.TO_USER);
} | java | public void installAssets(Collection<String> assetIds, RepositoryConnectionList loginInfo) throws InstallException {
fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING_ASSETS"));
if (assetIds == null || assetIds.isEmpty()) {
throw ExceptionUtils.createByKey("ERROR_ASSETS_LIST_INVALID");
}
RepositoryConnectionList li = loginInfo == null ? getResolveDirector().getRepositoryConnectionList(null, null, null,
this.getClass().getCanonicalName() + ".installAssets") : loginInfo;
Map<String, List<List<RepositoryResource>>> installResources = getResolveDirector().resolveMap(assetIds, li, false);
if (isEmpty(installResources)) {
throw ExceptionUtils.createByKey(InstallException.ALREADY_EXISTS, "ASSETS_ALREADY_INSTALLED",
InstallUtils.getShortNames(product.getFeatureDefinitions(), assetIds).toString());
}
downloadAssets(installResources, InstallConstants.TO_USER);
} | [
"public",
"void",
"installAssets",
"(",
"Collection",
"<",
"String",
">",
"assetIds",
",",
"RepositoryConnectionList",
"loginInfo",
")",
"throws",
"InstallException",
"{",
"fireProgressEvent",
"(",
"InstallProgressEvent",
".",
"CHECK",
",",
"1",
",",
"Messages",
".",
"INSTALL_KERNEL_MESSAGES",
".",
"getLogMessage",
"(",
"\"STATE_CHECKING_ASSETS\"",
")",
")",
";",
"if",
"(",
"assetIds",
"==",
"null",
"||",
"assetIds",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"\"ERROR_ASSETS_LIST_INVALID\"",
")",
";",
"}",
"RepositoryConnectionList",
"li",
"=",
"loginInfo",
"==",
"null",
"?",
"getResolveDirector",
"(",
")",
".",
"getRepositoryConnectionList",
"(",
"null",
",",
"null",
",",
"null",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
"+",
"\".installAssets\"",
")",
":",
"loginInfo",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
">",
"installResources",
"=",
"getResolveDirector",
"(",
")",
".",
"resolveMap",
"(",
"assetIds",
",",
"li",
",",
"false",
")",
";",
"if",
"(",
"isEmpty",
"(",
"installResources",
")",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"InstallException",
".",
"ALREADY_EXISTS",
",",
"\"ASSETS_ALREADY_INSTALLED\"",
",",
"InstallUtils",
".",
"getShortNames",
"(",
"product",
".",
"getFeatureDefinitions",
"(",
")",
",",
"assetIds",
")",
".",
"toString",
"(",
")",
")",
";",
"}",
"downloadAssets",
"(",
"installResources",
",",
"InstallConstants",
".",
"TO_USER",
")",
";",
"}"
] | Installs the specified assets
@param assetIds Collection of asset Ids
@param loginInfo RepositoryConnectionList to access repository with assets
@throws InstallException | [
"Installs",
"the",
"specified",
"assets"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1399-L1414 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.checkResources | public void checkResources() throws InstallException {
getResolveDirector().checkResources();
if (installAssets != null) {
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset ia : iaList) {
checkResource(ia);
}
}
}
long required = getResolveDirector().getInstallResourcesMainAttachmentSize();
String requiredSpace = castToPrintableMessage(required);
logger.log(Level.FINEST, "Total required space for installation is " + requiredSpace + " including temporary files.");
File wlpDir = product.getInstallDir();
long free = wlpDir.getFreeSpace();
String wlpDirSpace = castToPrintableMessage(wlpDir.getFreeSpace());
logger.log(Level.FINEST, "Total available space is " + wlpDirSpace + ".");
if (free < required) {
try {
throw ExceptionUtils.createByKey("ERROR_WLP_DIR_NO_SPACE", wlpDir.getCanonicalPath(), wlpDirSpace, requiredSpace);
} catch (IOException e) {
throw ExceptionUtils.create(e);
}
}
} | java | public void checkResources() throws InstallException {
getResolveDirector().checkResources();
if (installAssets != null) {
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset ia : iaList) {
checkResource(ia);
}
}
}
long required = getResolveDirector().getInstallResourcesMainAttachmentSize();
String requiredSpace = castToPrintableMessage(required);
logger.log(Level.FINEST, "Total required space for installation is " + requiredSpace + " including temporary files.");
File wlpDir = product.getInstallDir();
long free = wlpDir.getFreeSpace();
String wlpDirSpace = castToPrintableMessage(wlpDir.getFreeSpace());
logger.log(Level.FINEST, "Total available space is " + wlpDirSpace + ".");
if (free < required) {
try {
throw ExceptionUtils.createByKey("ERROR_WLP_DIR_NO_SPACE", wlpDir.getCanonicalPath(), wlpDirSpace, requiredSpace);
} catch (IOException e) {
throw ExceptionUtils.create(e);
}
}
} | [
"public",
"void",
"checkResources",
"(",
")",
"throws",
"InstallException",
"{",
"getResolveDirector",
"(",
")",
".",
"checkResources",
"(",
")",
";",
"if",
"(",
"installAssets",
"!=",
"null",
")",
"{",
"for",
"(",
"List",
"<",
"InstallAsset",
">",
"iaList",
":",
"installAssets",
")",
"{",
"for",
"(",
"InstallAsset",
"ia",
":",
"iaList",
")",
"{",
"checkResource",
"(",
"ia",
")",
";",
"}",
"}",
"}",
"long",
"required",
"=",
"getResolveDirector",
"(",
")",
".",
"getInstallResourcesMainAttachmentSize",
"(",
")",
";",
"String",
"requiredSpace",
"=",
"castToPrintableMessage",
"(",
"required",
")",
";",
"logger",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Total required space for installation is \"",
"+",
"requiredSpace",
"+",
"\" including temporary files.\"",
")",
";",
"File",
"wlpDir",
"=",
"product",
".",
"getInstallDir",
"(",
")",
";",
"long",
"free",
"=",
"wlpDir",
".",
"getFreeSpace",
"(",
")",
";",
"String",
"wlpDirSpace",
"=",
"castToPrintableMessage",
"(",
"wlpDir",
".",
"getFreeSpace",
"(",
")",
")",
";",
"logger",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Total available space is \"",
"+",
"wlpDirSpace",
"+",
"\".\"",
")",
";",
"if",
"(",
"free",
"<",
"required",
")",
"{",
"try",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"\"ERROR_WLP_DIR_NO_SPACE\"",
",",
"wlpDir",
".",
"getCanonicalPath",
"(",
")",
",",
"wlpDirSpace",
",",
"requiredSpace",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"ExceptionUtils",
".",
"create",
"(",
"e",
")",
";",
"}",
"}",
"}"
] | Checks if resources in installAssets are already installed and
if there is enough space in the install directory to install
@throws InstallException | [
"Checks",
"if",
"resources",
"in",
"installAssets",
"are",
"already",
"installed",
"and",
"if",
"there",
"is",
"enough",
"space",
"in",
"the",
"install",
"directory",
"to",
"install"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1506-L1530 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.castToPrintableMessage | public String castToPrintableMessage(long number) {
long i = number / 1048576;
if (i > 0)
return String.valueOf(i) + " MB";
else {
long l = number / 1024;
return String.valueOf(l) + " KB";
}
} | java | public String castToPrintableMessage(long number) {
long i = number / 1048576;
if (i > 0)
return String.valueOf(i) + " MB";
else {
long l = number / 1024;
return String.valueOf(l) + " KB";
}
} | [
"public",
"String",
"castToPrintableMessage",
"(",
"long",
"number",
")",
"{",
"long",
"i",
"=",
"number",
"/",
"1048576",
";",
"if",
"(",
"i",
">",
"0",
")",
"return",
"String",
".",
"valueOf",
"(",
"i",
")",
"+",
"\" MB\"",
";",
"else",
"{",
"long",
"l",
"=",
"number",
"/",
"1024",
";",
"return",
"String",
".",
"valueOf",
"(",
"l",
")",
"+",
"\" KB\"",
";",
"}",
"}"
] | Casts a long to MB or KB
@param number long number to cast
@return number in MB or KB if less than 1048576 | [
"Casts",
"a",
"long",
"to",
"MB",
"or",
"KB"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1538-L1548 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getInstalledAssetNames | public Map<String, Collection<String>> getInstalledAssetNames() {
if (installAssets == null)
return null;
Map<String, Collection<String>> installed = new HashMap<String, Collection<String>>();
Collection<String> installedAddons = new ArrayList<String>();
Collection<String> installedFeatures = new ArrayList<String>();
Collection<String> installedFixes = new ArrayList<String>();
Collection<String> installedSamples = new ArrayList<String>();
Collection<String> installedOpenSources = new ArrayList<String>();
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset asset : iaList) {
if (asset.isFeature()) {
ESAAsset esa = (ESAAsset) asset;
if (esa.isPublic()) {
String esaName = esa.getShortName();
if (esaName == null || esaName.isEmpty())
esaName = esa.getFeatureName();
if (esa.isAddon())
installedAddons.add(esaName);
else
installedFeatures.add(esaName);
}
} else if (asset.isFix()) {
installedFixes.add(asset.toString());
} else if (asset.isSample()) {
installedSamples.add(asset.toString());
} else if (asset.isOpenSource()) {
installedOpenSources.add(asset.toString());
}
}
}
installed.put(InstallConstants.ADDON, installedAddons);
installed.put(InstallConstants.FEATURE, installedFeatures);
installed.put(InstallConstants.IFIX, installedFixes);
installed.put(InstallConstants.SAMPLE, installedSamples);
installed.put(InstallConstants.OPENSOURCE, installedOpenSources);
return installed;
} | java | public Map<String, Collection<String>> getInstalledAssetNames() {
if (installAssets == null)
return null;
Map<String, Collection<String>> installed = new HashMap<String, Collection<String>>();
Collection<String> installedAddons = new ArrayList<String>();
Collection<String> installedFeatures = new ArrayList<String>();
Collection<String> installedFixes = new ArrayList<String>();
Collection<String> installedSamples = new ArrayList<String>();
Collection<String> installedOpenSources = new ArrayList<String>();
for (List<InstallAsset> iaList : installAssets) {
for (InstallAsset asset : iaList) {
if (asset.isFeature()) {
ESAAsset esa = (ESAAsset) asset;
if (esa.isPublic()) {
String esaName = esa.getShortName();
if (esaName == null || esaName.isEmpty())
esaName = esa.getFeatureName();
if (esa.isAddon())
installedAddons.add(esaName);
else
installedFeatures.add(esaName);
}
} else if (asset.isFix()) {
installedFixes.add(asset.toString());
} else if (asset.isSample()) {
installedSamples.add(asset.toString());
} else if (asset.isOpenSource()) {
installedOpenSources.add(asset.toString());
}
}
}
installed.put(InstallConstants.ADDON, installedAddons);
installed.put(InstallConstants.FEATURE, installedFeatures);
installed.put(InstallConstants.IFIX, installedFixes);
installed.put(InstallConstants.SAMPLE, installedSamples);
installed.put(InstallConstants.OPENSOURCE, installedOpenSources);
return installed;
} | [
"public",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"getInstalledAssetNames",
"(",
")",
"{",
"if",
"(",
"installAssets",
"==",
"null",
")",
"return",
"null",
";",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"installed",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"(",
")",
";",
"Collection",
"<",
"String",
">",
"installedAddons",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collection",
"<",
"String",
">",
"installedFeatures",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collection",
"<",
"String",
">",
"installedFixes",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collection",
"<",
"String",
">",
"installedSamples",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collection",
"<",
"String",
">",
"installedOpenSources",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"List",
"<",
"InstallAsset",
">",
"iaList",
":",
"installAssets",
")",
"{",
"for",
"(",
"InstallAsset",
"asset",
":",
"iaList",
")",
"{",
"if",
"(",
"asset",
".",
"isFeature",
"(",
")",
")",
"{",
"ESAAsset",
"esa",
"=",
"(",
"ESAAsset",
")",
"asset",
";",
"if",
"(",
"esa",
".",
"isPublic",
"(",
")",
")",
"{",
"String",
"esaName",
"=",
"esa",
".",
"getShortName",
"(",
")",
";",
"if",
"(",
"esaName",
"==",
"null",
"||",
"esaName",
".",
"isEmpty",
"(",
")",
")",
"esaName",
"=",
"esa",
".",
"getFeatureName",
"(",
")",
";",
"if",
"(",
"esa",
".",
"isAddon",
"(",
")",
")",
"installedAddons",
".",
"add",
"(",
"esaName",
")",
";",
"else",
"installedFeatures",
".",
"add",
"(",
"esaName",
")",
";",
"}",
"}",
"else",
"if",
"(",
"asset",
".",
"isFix",
"(",
")",
")",
"{",
"installedFixes",
".",
"add",
"(",
"asset",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"asset",
".",
"isSample",
"(",
")",
")",
"{",
"installedSamples",
".",
"add",
"(",
"asset",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"asset",
".",
"isOpenSource",
"(",
")",
")",
"{",
"installedOpenSources",
".",
"add",
"(",
"asset",
".",
"toString",
"(",
")",
")",
";",
"}",
"}",
"}",
"installed",
".",
"put",
"(",
"InstallConstants",
".",
"ADDON",
",",
"installedAddons",
")",
";",
"installed",
".",
"put",
"(",
"InstallConstants",
".",
"FEATURE",
",",
"installedFeatures",
")",
";",
"installed",
".",
"put",
"(",
"InstallConstants",
".",
"IFIX",
",",
"installedFixes",
")",
";",
"installed",
".",
"put",
"(",
"InstallConstants",
".",
"SAMPLE",
",",
"installedSamples",
")",
";",
"installed",
".",
"put",
"(",
"InstallConstants",
".",
"OPENSOURCE",
",",
"installedOpenSources",
")",
";",
"return",
"installed",
";",
"}"
] | Gets the names of assets inside installAssets
@return Map of asset types and collections of asset names | [
"Gets",
"the",
"names",
"of",
"assets",
"inside",
"installAssets"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1601-L1638 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getFeatureLicense | public Set<InstallLicense> getFeatureLicense(Locale locale) throws InstallException {
Map<String, InstallLicenseImpl> licenseIds = new HashMap<String, InstallLicenseImpl>();
getFeatureLicenseFromInstallAssets(locale, licenseIds, getResolveDirector().getLocalInstallAssets());
getFeatureLicenseFromInstallResources(locale, licenseIds, getResolveDirector().getInstallResources());
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
licenses.addAll(licenseIds.values());
return licenses;
} | java | public Set<InstallLicense> getFeatureLicense(Locale locale) throws InstallException {
Map<String, InstallLicenseImpl> licenseIds = new HashMap<String, InstallLicenseImpl>();
getFeatureLicenseFromInstallAssets(locale, licenseIds, getResolveDirector().getLocalInstallAssets());
getFeatureLicenseFromInstallResources(locale, licenseIds, getResolveDirector().getInstallResources());
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
licenses.addAll(licenseIds.values());
return licenses;
} | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getFeatureLicense",
"(",
"Locale",
"locale",
")",
"throws",
"InstallException",
"{",
"Map",
"<",
"String",
",",
"InstallLicenseImpl",
">",
"licenseIds",
"=",
"new",
"HashMap",
"<",
"String",
",",
"InstallLicenseImpl",
">",
"(",
")",
";",
"getFeatureLicenseFromInstallAssets",
"(",
"locale",
",",
"licenseIds",
",",
"getResolveDirector",
"(",
")",
".",
"getLocalInstallAssets",
"(",
")",
")",
";",
"getFeatureLicenseFromInstallResources",
"(",
"locale",
",",
"licenseIds",
",",
"getResolveDirector",
"(",
")",
".",
"getInstallResources",
"(",
")",
")",
";",
"Set",
"<",
"InstallLicense",
">",
"licenses",
"=",
"new",
"HashSet",
"<",
"InstallLicense",
">",
"(",
")",
";",
"licenses",
".",
"addAll",
"(",
"licenseIds",
".",
"values",
"(",
")",
")",
";",
"return",
"licenses",
";",
"}"
] | Gets the feature licenses of install assets and resources
@param locale Locale of license
@return Set of InstallLicenses of installed assets
@throws InstallException | [
"Gets",
"the",
"feature",
"licenses",
"of",
"install",
"assets",
"and",
"resources"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1647-L1654 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getSampleLicense | public Collection<String> getSampleLicense(Locale locale) throws InstallException {
Collection<String> licenses = new ArrayList<String>();
for (List<List<RepositoryResource>> targetList : getResolveDirector().getInstallResources().values()) {
for (List<RepositoryResource> mrList : targetList) {
for (RepositoryResource mr : mrList) {
ResourceType type = mr.getType();
if (type.equals(ResourceType.PRODUCTSAMPLE) ||
type.equals(ResourceType.OPENSOURCE)) {
try {
AttachmentResource lar = mr.getLicenseAgreement(locale);
if (lar != null)
licenses.add(InstallLicenseImpl.getLicense(lar));
} catch (RepositoryException e) {
throw ExceptionUtils.createByKey(e, "ERROR_FAILED_TO_GET_ASSET_LICENSE", mr.getName());
}
}
}
}
}
return licenses;
} | java | public Collection<String> getSampleLicense(Locale locale) throws InstallException {
Collection<String> licenses = new ArrayList<String>();
for (List<List<RepositoryResource>> targetList : getResolveDirector().getInstallResources().values()) {
for (List<RepositoryResource> mrList : targetList) {
for (RepositoryResource mr : mrList) {
ResourceType type = mr.getType();
if (type.equals(ResourceType.PRODUCTSAMPLE) ||
type.equals(ResourceType.OPENSOURCE)) {
try {
AttachmentResource lar = mr.getLicenseAgreement(locale);
if (lar != null)
licenses.add(InstallLicenseImpl.getLicense(lar));
} catch (RepositoryException e) {
throw ExceptionUtils.createByKey(e, "ERROR_FAILED_TO_GET_ASSET_LICENSE", mr.getName());
}
}
}
}
}
return licenses;
} | [
"public",
"Collection",
"<",
"String",
">",
"getSampleLicense",
"(",
"Locale",
"locale",
")",
"throws",
"InstallException",
"{",
"Collection",
"<",
"String",
">",
"licenses",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
"targetList",
":",
"getResolveDirector",
"(",
")",
".",
"getInstallResources",
"(",
")",
".",
"values",
"(",
")",
")",
"{",
"for",
"(",
"List",
"<",
"RepositoryResource",
">",
"mrList",
":",
"targetList",
")",
"{",
"for",
"(",
"RepositoryResource",
"mr",
":",
"mrList",
")",
"{",
"ResourceType",
"type",
"=",
"mr",
".",
"getType",
"(",
")",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"ResourceType",
".",
"PRODUCTSAMPLE",
")",
"||",
"type",
".",
"equals",
"(",
"ResourceType",
".",
"OPENSOURCE",
")",
")",
"{",
"try",
"{",
"AttachmentResource",
"lar",
"=",
"mr",
".",
"getLicenseAgreement",
"(",
"locale",
")",
";",
"if",
"(",
"lar",
"!=",
"null",
")",
"licenses",
".",
"add",
"(",
"InstallLicenseImpl",
".",
"getLicense",
"(",
"lar",
")",
")",
";",
"}",
"catch",
"(",
"RepositoryException",
"e",
")",
"{",
"throw",
"ExceptionUtils",
".",
"createByKey",
"(",
"e",
",",
"\"ERROR_FAILED_TO_GET_ASSET_LICENSE\"",
",",
"mr",
".",
"getName",
"(",
")",
")",
";",
"}",
"}",
"}",
"}",
"}",
"return",
"licenses",
";",
"}"
] | Gets the sample licenses from install resources
@param locale Locale of license
@return Collection of licenses as Strings for samples
@throws InstallException | [
"Gets",
"the",
"sample",
"licenses",
"from",
"install",
"resources"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1686-L1706 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getSamplesOrOpenSources | public Collection<String> getSamplesOrOpenSources() {
Collection<String> samplesOrOpenSources = new ArrayList<String>();
Map<String, List<List<RepositoryResource>>> installResources = getResolveDirector().getInstallResources();
if (installResources != null) {
for (List<List<RepositoryResource>> targetList : installResources.values()) {
for (List<RepositoryResource> mrList : targetList) {
for (RepositoryResource mr : mrList) {
ResourceType type = mr.getType();
if (type.equals(ResourceType.PRODUCTSAMPLE) ||
type.equals(ResourceType.OPENSOURCE)) {
samplesOrOpenSources.add(InstallUtils.getResourceId(mr));
}
}
}
}
}
return samplesOrOpenSources;
} | java | public Collection<String> getSamplesOrOpenSources() {
Collection<String> samplesOrOpenSources = new ArrayList<String>();
Map<String, List<List<RepositoryResource>>> installResources = getResolveDirector().getInstallResources();
if (installResources != null) {
for (List<List<RepositoryResource>> targetList : installResources.values()) {
for (List<RepositoryResource> mrList : targetList) {
for (RepositoryResource mr : mrList) {
ResourceType type = mr.getType();
if (type.equals(ResourceType.PRODUCTSAMPLE) ||
type.equals(ResourceType.OPENSOURCE)) {
samplesOrOpenSources.add(InstallUtils.getResourceId(mr));
}
}
}
}
}
return samplesOrOpenSources;
} | [
"public",
"Collection",
"<",
"String",
">",
"getSamplesOrOpenSources",
"(",
")",
"{",
"Collection",
"<",
"String",
">",
"samplesOrOpenSources",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
">",
"installResources",
"=",
"getResolveDirector",
"(",
")",
".",
"getInstallResources",
"(",
")",
";",
"if",
"(",
"installResources",
"!=",
"null",
")",
"{",
"for",
"(",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
"targetList",
":",
"installResources",
".",
"values",
"(",
")",
")",
"{",
"for",
"(",
"List",
"<",
"RepositoryResource",
">",
"mrList",
":",
"targetList",
")",
"{",
"for",
"(",
"RepositoryResource",
"mr",
":",
"mrList",
")",
"{",
"ResourceType",
"type",
"=",
"mr",
".",
"getType",
"(",
")",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"ResourceType",
".",
"PRODUCTSAMPLE",
")",
"||",
"type",
".",
"equals",
"(",
"ResourceType",
".",
"OPENSOURCE",
")",
")",
"{",
"samplesOrOpenSources",
".",
"add",
"(",
"InstallUtils",
".",
"getResourceId",
"(",
"mr",
")",
")",
";",
"}",
"}",
"}",
"}",
"}",
"return",
"samplesOrOpenSources",
";",
"}"
] | Creates a collection of Sample and Open Source resource names from install resource
@return Collections of Strings of resource names | [
"Creates",
"a",
"collection",
"of",
"Sample",
"and",
"Open",
"Source",
"resource",
"names",
"from",
"install",
"resource"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1713-L1730 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.downloadAssets | public void downloadAssets(String toExtension) throws InstallException {
downloadAssets(getResolveDirector().getInstallResources(), toExtension);
if (getResolveDirector().getLocalInstallAssetsSize() > 0)
this.installAssets.add(getResolveDirector().getLocalInstallAssets());
} | java | public void downloadAssets(String toExtension) throws InstallException {
downloadAssets(getResolveDirector().getInstallResources(), toExtension);
if (getResolveDirector().getLocalInstallAssetsSize() > 0)
this.installAssets.add(getResolveDirector().getLocalInstallAssets());
} | [
"public",
"void",
"downloadAssets",
"(",
"String",
"toExtension",
")",
"throws",
"InstallException",
"{",
"downloadAssets",
"(",
"getResolveDirector",
"(",
")",
".",
"getInstallResources",
"(",
")",
",",
"toExtension",
")",
";",
"if",
"(",
"getResolveDirector",
"(",
")",
".",
"getLocalInstallAssetsSize",
"(",
")",
">",
"0",
")",
"this",
".",
"installAssets",
".",
"add",
"(",
"getResolveDirector",
"(",
")",
".",
"getLocalInstallAssets",
"(",
")",
")",
";",
"}"
] | Downloads assets in install resources
@param toExtension location of a product extension
@throws InstallException | [
"Downloads",
"assets",
"in",
"install",
"resources"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1738-L1742 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.resolve | public void resolve(String feature, File esaFile, String toExtension) throws InstallException {
getResolveDirector().resolve(feature, esaFile, toExtension);
} | java | public void resolve(String feature, File esaFile, String toExtension) throws InstallException {
getResolveDirector().resolve(feature, esaFile, toExtension);
} | [
"public",
"void",
"resolve",
"(",
"String",
"feature",
",",
"File",
"esaFile",
",",
"String",
"toExtension",
")",
"throws",
"InstallException",
"{",
"getResolveDirector",
"(",
")",
".",
"resolve",
"(",
"feature",
",",
"esaFile",
",",
"toExtension",
")",
";",
"}"
] | Resolves feature names
@param feature feature name to resolve
@param esaFile esa file containing feature
@param toExtension location of a product extension
@throws InstallException | [
"Resolves",
"feature",
"names"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1798-L1800 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.resolveExistingAssetsFromDirectoryRepo | public boolean resolveExistingAssetsFromDirectoryRepo(Collection<String> featureNames, File repoDir, boolean isOverwrite) throws InstallException {
return getResolveDirector().resolveExistingAssetsFromDirectoryRepo(featureNames, repoDir, isOverwrite);
} | java | public boolean resolveExistingAssetsFromDirectoryRepo(Collection<String> featureNames, File repoDir, boolean isOverwrite) throws InstallException {
return getResolveDirector().resolveExistingAssetsFromDirectoryRepo(featureNames, repoDir, isOverwrite);
} | [
"public",
"boolean",
"resolveExistingAssetsFromDirectoryRepo",
"(",
"Collection",
"<",
"String",
">",
"featureNames",
",",
"File",
"repoDir",
",",
"boolean",
"isOverwrite",
")",
"throws",
"InstallException",
"{",
"return",
"getResolveDirector",
"(",
")",
".",
"resolveExistingAssetsFromDirectoryRepo",
"(",
"featureNames",
",",
"repoDir",
",",
"isOverwrite",
")",
";",
"}"
] | Resolves existing assets from a specified directory
@param featureNames Collection of feature names to resolve
@param repoDir Repository directory to obtain features from
@param isOverwrite If features should be overwritten with fresh ones
@return
@throws InstallException | [
"Resolves",
"existing",
"assets",
"from",
"a",
"specified",
"directory"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1811-L1813 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.uninstall | public void uninstall(Collection<String> ids, boolean force) throws InstallException {
getUninstallDirector().uninstall(ids, force);
} | java | public void uninstall(Collection<String> ids, boolean force) throws InstallException {
getUninstallDirector().uninstall(ids, force);
} | [
"public",
"void",
"uninstall",
"(",
"Collection",
"<",
"String",
">",
"ids",
",",
"boolean",
"force",
")",
"throws",
"InstallException",
"{",
"getUninstallDirector",
"(",
")",
".",
"uninstall",
"(",
"ids",
",",
"force",
")",
";",
"}"
] | Uninstalls the ids
@param ids Collection of ids to uninstall
@param force If uninstallation should be forced
@throws InstallException | [
"Uninstalls",
"the",
"ids"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1828-L1830 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.uninstall | public void uninstall(boolean checkDependency, String[] productIds, Collection<File> toBeDeleted) throws InstallException {
getUninstallDirector().uninstall(checkDependency, productIds, toBeDeleted);
} | java | public void uninstall(boolean checkDependency, String[] productIds, Collection<File> toBeDeleted) throws InstallException {
getUninstallDirector().uninstall(checkDependency, productIds, toBeDeleted);
} | [
"public",
"void",
"uninstall",
"(",
"boolean",
"checkDependency",
",",
"String",
"[",
"]",
"productIds",
",",
"Collection",
"<",
"File",
">",
"toBeDeleted",
")",
"throws",
"InstallException",
"{",
"getUninstallDirector",
"(",
")",
".",
"uninstall",
"(",
"checkDependency",
",",
"productIds",
",",
"toBeDeleted",
")",
";",
"}"
] | Uninstalls product depending on dependencies
@param checkDependency if uninstall should check for dependencies
@param productIds Ids of product to uninstall
@param toBeDeleted Collection of files to uninstall
@throws InstallException | [
"Uninstalls",
"product",
"depending",
"on",
"dependencies"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1884-L1886 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.uninstallFeaturesByProductId | public void uninstallFeaturesByProductId(String productId, boolean exceptPlatformFeatures) throws InstallException {
String[] productIds = new String[1];
productIds[0] = productId;
uninstallFeaturesByProductId(productIds, exceptPlatformFeatures);
} | java | public void uninstallFeaturesByProductId(String productId, boolean exceptPlatformFeatures) throws InstallException {
String[] productIds = new String[1];
productIds[0] = productId;
uninstallFeaturesByProductId(productIds, exceptPlatformFeatures);
} | [
"public",
"void",
"uninstallFeaturesByProductId",
"(",
"String",
"productId",
",",
"boolean",
"exceptPlatformFeatures",
")",
"throws",
"InstallException",
"{",
"String",
"[",
"]",
"productIds",
"=",
"new",
"String",
"[",
"1",
"]",
";",
"productIds",
"[",
"0",
"]",
"=",
"productId",
";",
"uninstallFeaturesByProductId",
"(",
"productIds",
",",
"exceptPlatformFeatures",
")",
";",
"}"
] | Calls below method to uninstall features by product id
@param productId product id to uninstall
@param exceptPlatformFeatures If platform features should be ignored
@throws InstallException | [
"Calls",
"below",
"method",
"to",
"uninstall",
"features",
"by",
"product",
"id"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1907-L1911 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java | LinkedList.append | public synchronized final void append(Link link)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "append");
Link prev = _dummyTail._getPreviousLink();
link._link(prev, _dummyTail, _nextPositionToIssue++, this);
prev._setNextLink(link);
_dummyTail._setPreviousLink(link);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "append", _debugString());
} | java | public synchronized final void append(Link link)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "append");
Link prev = _dummyTail._getPreviousLink();
link._link(prev, _dummyTail, _nextPositionToIssue++, this);
prev._setNextLink(link);
_dummyTail._setPreviousLink(link);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "append", _debugString());
} | [
"public",
"synchronized",
"final",
"void",
"append",
"(",
"Link",
"link",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"append\"",
")",
";",
"Link",
"prev",
"=",
"_dummyTail",
".",
"_getPreviousLink",
"(",
")",
";",
"link",
".",
"_link",
"(",
"prev",
",",
"_dummyTail",
",",
"_nextPositionToIssue",
"++",
",",
"this",
")",
";",
"prev",
".",
"_setNextLink",
"(",
"link",
")",
";",
"_dummyTail",
".",
"_setPreviousLink",
"(",
"link",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"append\"",
",",
"_debugString",
"(",
")",
")",
";",
"}"
] | Append a link to the end of the list.
@param link | [
"Append",
"a",
"link",
"to",
"the",
"end",
"of",
"the",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java#L91-L101 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java | LinkedList.findFirstMatching | public final AbstractItem findFirstMatching(final Filter filter) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "findFirstMatching", filter);
AbstractItem found = null;
Link link = getHead();
while (link != null && found == null)
{
found = ((AbstractItemLink)link).matches(filter);
if (found == null)
{
// Defect 493652/PK59872
// We need to lock on the list at this point as our current link
// may have been unlinked by another thread during the matches()
// call. In that case we need to start at the head of the list again
// as the next/previous pointers for the unlinked link will not be
// set.
synchronized(this)
{
if (link.isPhysicallyUnlinked())
{
// We have been unlinked while we were doing the match.
// Start again at the beginning of the list.
link = getHead();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Current link is PhysicallyUnlinked so returning to beginning of list.");
}
else
{
link = link.getNextLogicalLink();
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "findFirstMatching", found);
return found;
} | java | public final AbstractItem findFirstMatching(final Filter filter) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "findFirstMatching", filter);
AbstractItem found = null;
Link link = getHead();
while (link != null && found == null)
{
found = ((AbstractItemLink)link).matches(filter);
if (found == null)
{
// Defect 493652/PK59872
// We need to lock on the list at this point as our current link
// may have been unlinked by another thread during the matches()
// call. In that case we need to start at the head of the list again
// as the next/previous pointers for the unlinked link will not be
// set.
synchronized(this)
{
if (link.isPhysicallyUnlinked())
{
// We have been unlinked while we were doing the match.
// Start again at the beginning of the list.
link = getHead();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Current link is PhysicallyUnlinked so returning to beginning of list.");
}
else
{
link = link.getNextLogicalLink();
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "findFirstMatching", found);
return found;
} | [
"public",
"final",
"AbstractItem",
"findFirstMatching",
"(",
"final",
"Filter",
"filter",
")",
"throws",
"MessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"findFirstMatching\"",
",",
"filter",
")",
";",
"AbstractItem",
"found",
"=",
"null",
";",
"Link",
"link",
"=",
"getHead",
"(",
")",
";",
"while",
"(",
"link",
"!=",
"null",
"&&",
"found",
"==",
"null",
")",
"{",
"found",
"=",
"(",
"(",
"AbstractItemLink",
")",
"link",
")",
".",
"matches",
"(",
"filter",
")",
";",
"if",
"(",
"found",
"==",
"null",
")",
"{",
"// Defect 493652/PK59872",
"// We need to lock on the list at this point as our current link",
"// may have been unlinked by another thread during the matches() ",
"// call. In that case we need to start at the head of the list again ",
"// as the next/previous pointers for the unlinked link will not be",
"// set.",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"link",
".",
"isPhysicallyUnlinked",
"(",
")",
")",
"{",
"// We have been unlinked while we were doing the match. ",
"// Start again at the beginning of the list.",
"link",
"=",
"getHead",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Current link is PhysicallyUnlinked so returning to beginning of list.\"",
")",
";",
"}",
"else",
"{",
"link",
"=",
"link",
".",
"getNextLogicalLink",
"(",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"findFirstMatching\"",
",",
"found",
")",
";",
"return",
"found",
";",
"}"
] | Method get returns the first unlocked matching object on the list.
@param filter
@return Link
@throws MessageStoreException | [
"Method",
"get",
"returns",
"the",
"first",
"unlocked",
"matching",
"object",
"on",
"the",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java#L110-L150 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java | LinkedList.removeFirstMatching | public final AbstractItem removeFirstMatching(final Filter filter, PersistentTransaction transaction) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "removeFirstMatching", new Object[] { filter, transaction});
AbstractItem found = null;
Link link = getHead();
while (link != null && found == null)
{
found = ((AbstractItemLink)link).removeIfMatches(filter, transaction);
if (found == null)
{
// Defect 493652/PK59872
// We need to lock on the list at this point as our current link
// may have been unlinked by another thread during the matches()
// call. In that case we need to start at the head of the list again
// as the next/previous pointers for the unlinked link will not be
// set.
synchronized(this)
{
if (link.isPhysicallyUnlinked())
{
// We have been unlinked while we were doing the match.
// Start again at the beginning of the list.
link = getHead();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Current link is PhysicallyUnlinked so returning to beginning of list.");
}
else
{
link = link.getNextLogicalLink();
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "removeFirstMatching", found);
return found;
} | java | public final AbstractItem removeFirstMatching(final Filter filter, PersistentTransaction transaction) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "removeFirstMatching", new Object[] { filter, transaction});
AbstractItem found = null;
Link link = getHead();
while (link != null && found == null)
{
found = ((AbstractItemLink)link).removeIfMatches(filter, transaction);
if (found == null)
{
// Defect 493652/PK59872
// We need to lock on the list at this point as our current link
// may have been unlinked by another thread during the matches()
// call. In that case we need to start at the head of the list again
// as the next/previous pointers for the unlinked link will not be
// set.
synchronized(this)
{
if (link.isPhysicallyUnlinked())
{
// We have been unlinked while we were doing the match.
// Start again at the beginning of the list.
link = getHead();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Current link is PhysicallyUnlinked so returning to beginning of list.");
}
else
{
link = link.getNextLogicalLink();
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "removeFirstMatching", found);
return found;
} | [
"public",
"final",
"AbstractItem",
"removeFirstMatching",
"(",
"final",
"Filter",
"filter",
",",
"PersistentTransaction",
"transaction",
")",
"throws",
"MessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"removeFirstMatching\"",
",",
"new",
"Object",
"[",
"]",
"{",
"filter",
",",
"transaction",
"}",
")",
";",
"AbstractItem",
"found",
"=",
"null",
";",
"Link",
"link",
"=",
"getHead",
"(",
")",
";",
"while",
"(",
"link",
"!=",
"null",
"&&",
"found",
"==",
"null",
")",
"{",
"found",
"=",
"(",
"(",
"AbstractItemLink",
")",
"link",
")",
".",
"removeIfMatches",
"(",
"filter",
",",
"transaction",
")",
";",
"if",
"(",
"found",
"==",
"null",
")",
"{",
"// Defect 493652/PK59872",
"// We need to lock on the list at this point as our current link",
"// may have been unlinked by another thread during the matches() ",
"// call. In that case we need to start at the head of the list again ",
"// as the next/previous pointers for the unlinked link will not be",
"// set.",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"link",
".",
"isPhysicallyUnlinked",
"(",
")",
")",
"{",
"// We have been unlinked while we were doing the match. ",
"// Start again at the beginning of the list.",
"link",
"=",
"getHead",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Current link is PhysicallyUnlinked so returning to beginning of list.\"",
")",
";",
"}",
"else",
"{",
"link",
"=",
"link",
".",
"getNextLogicalLink",
"(",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"removeFirstMatching\"",
",",
"found",
")",
";",
"return",
"found",
";",
"}"
] | Method removes the first unlocked matching object on the list destructively under
transactional control.
@param filter
@param transaction
@return AbstractItem
@throws MessageStoreException | [
"Method",
"removes",
"the",
"first",
"unlocked",
"matching",
"object",
"on",
"the",
"list",
"destructively",
"under",
"transactional",
"control",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java#L225-L265 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java | LinkedList.xmlWriteOn | public final void xmlWriteOn(FormattedWriter writer, String tagName) throws IOException
{
Link link = getHead();
if (link != null)
{
writer.newLine();
writer.startTag(tagName);
writer.indent();
while (link != null)
{
writer.newLine();
link.xmlWriteOn(writer);
link = link.getNextPhysicalLink();
}
writer.outdent();
writer.newLine();
writer.endTag(tagName);
}
} | java | public final void xmlWriteOn(FormattedWriter writer, String tagName) throws IOException
{
Link link = getHead();
if (link != null)
{
writer.newLine();
writer.startTag(tagName);
writer.indent();
while (link != null)
{
writer.newLine();
link.xmlWriteOn(writer);
link = link.getNextPhysicalLink();
}
writer.outdent();
writer.newLine();
writer.endTag(tagName);
}
} | [
"public",
"final",
"void",
"xmlWriteOn",
"(",
"FormattedWriter",
"writer",
",",
"String",
"tagName",
")",
"throws",
"IOException",
"{",
"Link",
"link",
"=",
"getHead",
"(",
")",
";",
"if",
"(",
"link",
"!=",
"null",
")",
"{",
"writer",
".",
"newLine",
"(",
")",
";",
"writer",
".",
"startTag",
"(",
"tagName",
")",
";",
"writer",
".",
"indent",
"(",
")",
";",
"while",
"(",
"link",
"!=",
"null",
")",
"{",
"writer",
".",
"newLine",
"(",
")",
";",
"link",
".",
"xmlWriteOn",
"(",
"writer",
")",
";",
"link",
"=",
"link",
".",
"getNextPhysicalLink",
"(",
")",
";",
"}",
"writer",
".",
"outdent",
"(",
")",
";",
"writer",
".",
"newLine",
"(",
")",
";",
"writer",
".",
"endTag",
"(",
"tagName",
")",
";",
"}",
"}"
] | Used when the transactional list is NOT part of a prioritized list.
@param writer
@param tagName
@throws IOException | [
"Used",
"when",
"the",
"transactional",
"list",
"is",
"NOT",
"part",
"of",
"a",
"prioritized",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java#L274-L294 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java | LinkedList.countLinks | public int countLinks()
{
int count = 0;
Link look = _dummyHead.getNextLogicalLink();
while (look != null && _dummyTail != look)
{
count++;
look = look._getNextLink();
}
return count;
} | java | public int countLinks()
{
int count = 0;
Link look = _dummyHead.getNextLogicalLink();
while (look != null && _dummyTail != look)
{
count++;
look = look._getNextLink();
}
return count;
} | [
"public",
"int",
"countLinks",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Link",
"look",
"=",
"_dummyHead",
".",
"getNextLogicalLink",
"(",
")",
";",
"while",
"(",
"look",
"!=",
"null",
"&&",
"_dummyTail",
"!=",
"look",
")",
"{",
"count",
"++",
";",
"look",
"=",
"look",
".",
"_getNextLink",
"(",
")",
";",
"}",
"return",
"count",
";",
"}"
] | This is a method used by the unit tests to determine the number of links in the list.
It's too inefficient for any other purpose.
@return the number of links | [
"This",
"is",
"a",
"method",
"used",
"by",
"the",
"unit",
"tests",
"to",
"determine",
"the",
"number",
"of",
"links",
"in",
"the",
"list",
".",
"It",
"s",
"too",
"inefficient",
"for",
"any",
"other",
"purpose",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java#L302-L312 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/TimedMap.java | TimedMap.purge | private void purge()
{
if (TraceComponent.isAnyTracingEnabled() && _tc.isEntryEnabled()) SibTr.entry(this, _tc, "purge");
Iterator<Map.Entry<K,TimedValue<V>>> it = _realMap.entrySet().iterator();
while (it.hasNext())
{
Map.Entry<K,TimedValue<V>> entry = it.next();
TimedValue<V> value = entry.getValue();
if (value.hasExipred())
{
it.remove();
if (TraceComponent.isAnyTracingEnabled() && _tc.isDebugEnabled())
{
SibTr.debug(_tc, "The value with the key " + entry.getKey() + " has expired");
}
}
}
if (TraceComponent.isAnyTracingEnabled() && _tc.isEntryEnabled()) SibTr.exit(this, _tc, "purge");
} | java | private void purge()
{
if (TraceComponent.isAnyTracingEnabled() && _tc.isEntryEnabled()) SibTr.entry(this, _tc, "purge");
Iterator<Map.Entry<K,TimedValue<V>>> it = _realMap.entrySet().iterator();
while (it.hasNext())
{
Map.Entry<K,TimedValue<V>> entry = it.next();
TimedValue<V> value = entry.getValue();
if (value.hasExipred())
{
it.remove();
if (TraceComponent.isAnyTracingEnabled() && _tc.isDebugEnabled())
{
SibTr.debug(_tc, "The value with the key " + entry.getKey() + " has expired");
}
}
}
if (TraceComponent.isAnyTracingEnabled() && _tc.isEntryEnabled()) SibTr.exit(this, _tc, "purge");
} | [
"private",
"void",
"purge",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"_tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"_tc",
",",
"\"purge\"",
")",
";",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"TimedValue",
"<",
"V",
">",
">",
">",
"it",
"=",
"_realMap",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Map",
".",
"Entry",
"<",
"K",
",",
"TimedValue",
"<",
"V",
">",
">",
"entry",
"=",
"it",
".",
"next",
"(",
")",
";",
"TimedValue",
"<",
"V",
">",
"value",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"value",
".",
"hasExipred",
"(",
")",
")",
"{",
"it",
".",
"remove",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"_tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"_tc",
",",
"\"The value with the key \"",
"+",
"entry",
".",
"getKey",
"(",
")",
"+",
"\" has expired\"",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"_tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"_tc",
",",
"\"purge\"",
")",
";",
"}"
] | This method removes any expired data from the map. | [
"This",
"method",
"removes",
"any",
"expired",
"data",
"from",
"the",
"map",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/TimedMap.java#L538-L558 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestIdGeneratorPUID.java | RequestIdGeneratorPUID.toBase64 | private static StringBuilder toBase64(long value) {
StringBuilder result = new StringBuilder(23); // Initialize with the size of ID if using Base64
for(int shift=60; shift>=0; shift-=6) {
result.append(Base64[(int)((value >> shift) & 0x3F)]);
}
return result;
} | java | private static StringBuilder toBase64(long value) {
StringBuilder result = new StringBuilder(23); // Initialize with the size of ID if using Base64
for(int shift=60; shift>=0; shift-=6) {
result.append(Base64[(int)((value >> shift) & 0x3F)]);
}
return result;
} | [
"private",
"static",
"StringBuilder",
"toBase64",
"(",
"long",
"value",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"23",
")",
";",
"// Initialize with the size of ID if using Base64",
"for",
"(",
"int",
"shift",
"=",
"60",
";",
"shift",
">=",
"0",
";",
"shift",
"-=",
"6",
")",
"{",
"result",
".",
"append",
"(",
"Base64",
"[",
"(",
"int",
")",
"(",
"(",
"value",
">>",
"shift",
")",
"&",
"0x3F",
")",
"]",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Return 11 chars of Base64 string for the 64 bits of the value padded with 2 zero bits
@param value long value to translate
@return StringBuilder instance containing characters of the result Base64 string | [
"Return",
"11",
"chars",
"of",
"Base64",
"string",
"for",
"the",
"64",
"bits",
"of",
"the",
"value",
"padded",
"with",
"2",
"zero",
"bits"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestIdGeneratorPUID.java#L51-L57 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/RemoteQueuePointIterator.java | RemoteQueuePointIterator.nextQueue | private void nextQueue()
{
if(super.hasNext())
{
do
{
if(_currentSubIterator != null) _currentSubIterator.finished();
_currentSubIterator = null;
_currentQueue = (SIMPQueueControllable) super.next();
try
{
_currentSubIterator = _currentQueue.getRemoteQueuePointIterator();
}
catch (SIMPException e)
{
// No FFDC code needed
if (tc.isDebugEnabled())
SibTr.exception(tc, e);
}
}
// Retry if we failed to get an iterator, that iterator does not
// have any remote queue points in it and we have more queues available.
while((_currentSubIterator == null || !_currentSubIterator.hasNext())
&& super.hasNext());
}
else
{
_currentQueue = null;
if(_currentSubIterator != null) _currentSubIterator.finished();
_currentSubIterator = null;
}
} | java | private void nextQueue()
{
if(super.hasNext())
{
do
{
if(_currentSubIterator != null) _currentSubIterator.finished();
_currentSubIterator = null;
_currentQueue = (SIMPQueueControllable) super.next();
try
{
_currentSubIterator = _currentQueue.getRemoteQueuePointIterator();
}
catch (SIMPException e)
{
// No FFDC code needed
if (tc.isDebugEnabled())
SibTr.exception(tc, e);
}
}
// Retry if we failed to get an iterator, that iterator does not
// have any remote queue points in it and we have more queues available.
while((_currentSubIterator == null || !_currentSubIterator.hasNext())
&& super.hasNext());
}
else
{
_currentQueue = null;
if(_currentSubIterator != null) _currentSubIterator.finished();
_currentSubIterator = null;
}
} | [
"private",
"void",
"nextQueue",
"(",
")",
"{",
"if",
"(",
"super",
".",
"hasNext",
"(",
")",
")",
"{",
"do",
"{",
"if",
"(",
"_currentSubIterator",
"!=",
"null",
")",
"_currentSubIterator",
".",
"finished",
"(",
")",
";",
"_currentSubIterator",
"=",
"null",
";",
"_currentQueue",
"=",
"(",
"SIMPQueueControllable",
")",
"super",
".",
"next",
"(",
")",
";",
"try",
"{",
"_currentSubIterator",
"=",
"_currentQueue",
".",
"getRemoteQueuePointIterator",
"(",
")",
";",
"}",
"catch",
"(",
"SIMPException",
"e",
")",
"{",
"// No FFDC code needed",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"}",
"// Retry if we failed to get an iterator, that iterator does not",
"// have any remote queue points in it and we have more queues available.",
"while",
"(",
"(",
"_currentSubIterator",
"==",
"null",
"||",
"!",
"_currentSubIterator",
".",
"hasNext",
"(",
")",
")",
"&&",
"super",
".",
"hasNext",
"(",
")",
")",
";",
"}",
"else",
"{",
"_currentQueue",
"=",
"null",
";",
"if",
"(",
"_currentSubIterator",
"!=",
"null",
")",
"_currentSubIterator",
".",
"finished",
"(",
")",
";",
"_currentSubIterator",
"=",
"null",
";",
"}",
"}"
] | Move to the next stream which has active ranges | [
"Move",
"to",
"the",
"next",
"stream",
"which",
"has",
"active",
"ranges"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/RemoteQueuePointIterator.java#L45-L78 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java | EventLocal.getContextData | @SuppressWarnings("unchecked")
public static <T> T getContextData(String name) {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null != event) {
return (T) event.getContextData(name);
}
return null;
} | java | @SuppressWarnings("unchecked")
public static <T> T getContextData(String name) {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null != event) {
return (T) event.getContextData(name);
}
return null;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getContextData",
"(",
"String",
"name",
")",
"{",
"EventImpl",
"event",
"=",
"(",
"EventImpl",
")",
"CurrentEvent",
".",
"get",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"event",
")",
"{",
"return",
"(",
"T",
")",
"event",
".",
"getContextData",
"(",
"name",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Query possible EventLocal context data for the current Event runtime
based on the provided name value. If an EventLocal was created under
the target name then the currently running Event runtime would return
its value.
@param <T>
@param name
@return T, null if not set or the name does not exist | [
"Query",
"possible",
"EventLocal",
"context",
"data",
"for",
"the",
"current",
"Event",
"runtime",
"based",
"on",
"the",
"provided",
"name",
"value",
".",
"If",
"an",
"EventLocal",
"was",
"created",
"under",
"the",
"target",
"name",
"then",
"the",
"currently",
"running",
"Event",
"runtime",
"would",
"return",
"its",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java#L45-L52 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java | EventLocal.getLocal | public static <T> EventLocal<T> getLocal(String name) {
return (EventLocal<T>) eventLocalNames.get(name);
} | java | public static <T> EventLocal<T> getLocal(String name) {
return (EventLocal<T>) eventLocalNames.get(name);
} | [
"public",
"static",
"<",
"T",
">",
"EventLocal",
"<",
"T",
">",
"getLocal",
"(",
"String",
"name",
")",
"{",
"return",
"(",
"EventLocal",
"<",
"T",
">",
")",
"eventLocalNames",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Query possible EventLocal for the current Event based on
the provided name value. If an EventLocal was created under the
target name then the currently running event runtime would return
its value.
@param <T>
@param name
@return T, null if not set or the name does not exist | [
"Query",
"possible",
"EventLocal",
"for",
"the",
"current",
"Event",
"based",
"on",
"the",
"provided",
"name",
"value",
".",
"If",
"an",
"EventLocal",
"was",
"created",
"under",
"the",
"target",
"name",
"then",
"the",
"currently",
"running",
"event",
"runtime",
"would",
"return",
"its",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java#L64-L66 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java | EventLocal.get | public T get() {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null == event) {
return null;
}
return event.get(this);
} | java | public T get() {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null == event) {
return null;
}
return event.get(this);
} | [
"public",
"T",
"get",
"(",
")",
"{",
"EventImpl",
"event",
"=",
"(",
"EventImpl",
")",
"CurrentEvent",
".",
"get",
"(",
")",
";",
"if",
"(",
"null",
"==",
"event",
")",
"{",
"return",
"null",
";",
"}",
"return",
"event",
".",
"get",
"(",
"this",
")",
";",
"}"
] | Query the current value, if any, of this EventLocal.
@return T, null if nothing is set | [
"Query",
"the",
"current",
"value",
"if",
"any",
"of",
"this",
"EventLocal",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java#L162-L168 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java | EventLocal.set | public void set(T value) {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null != event) {
event.set(this, value);
}
} | java | public void set(T value) {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null != event) {
event.set(this, value);
}
} | [
"public",
"void",
"set",
"(",
"T",
"value",
")",
"{",
"EventImpl",
"event",
"=",
"(",
"EventImpl",
")",
"CurrentEvent",
".",
"get",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"event",
")",
"{",
"event",
".",
"set",
"(",
"this",
",",
"value",
")",
";",
"}",
"}"
] | Set the value of the current EventLocal to the input item.
@param value | [
"Set",
"the",
"value",
"of",
"the",
"current",
"EventLocal",
"to",
"the",
"input",
"item",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java#L175-L180 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java | EventLocal.remove | public T remove() {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null != event) {
// Also need to remove name, if specified, from the Event's Set.
if (name != null) {
event.removeEventLocalName(name);
}
return event.remove(this);
}
return null;
} | java | public T remove() {
EventImpl event = (EventImpl) CurrentEvent.get();
if (null != event) {
// Also need to remove name, if specified, from the Event's Set.
if (name != null) {
event.removeEventLocalName(name);
}
return event.remove(this);
}
return null;
} | [
"public",
"T",
"remove",
"(",
")",
"{",
"EventImpl",
"event",
"=",
"(",
"EventImpl",
")",
"CurrentEvent",
".",
"get",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"event",
")",
"{",
"// Also need to remove name, if specified, from the Event's Set.",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"event",
".",
"removeEventLocalName",
"(",
"name",
")",
";",
"}",
"return",
"event",
".",
"remove",
"(",
"this",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Remove this EventLocal from the current event.
@return T, existing object being removed, null if none present | [
"Remove",
"this",
"EventLocal",
"from",
"the",
"current",
"event",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/websphere/event/EventLocal.java#L187-L197 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutputStreamImpl.java | HttpOutputStreamImpl.validate | protected void validate() throws IOException {
if (null != this.error) {
throw this.error;
}
if (isClosed()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "validate - is closed: hc: " + this.hashCode() + " details: " + this);
}
throw new IOException("Stream is closed");
}
if (null == this.output) {
setBufferSize(32768);
}
} | java | protected void validate() throws IOException {
if (null != this.error) {
throw this.error;
}
if (isClosed()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "validate - is closed: hc: " + this.hashCode() + " details: " + this);
}
throw new IOException("Stream is closed");
}
if (null == this.output) {
setBufferSize(32768);
}
} | [
"protected",
"void",
"validate",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"!=",
"this",
".",
"error",
")",
"{",
"throw",
"this",
".",
"error",
";",
"}",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"validate - is closed: hc: \"",
"+",
"this",
".",
"hashCode",
"(",
")",
"+",
"\" details: \"",
"+",
"this",
")",
";",
"}",
"throw",
"new",
"IOException",
"(",
"\"Stream is closed\"",
")",
";",
"}",
"if",
"(",
"null",
"==",
"this",
".",
"output",
")",
"{",
"setBufferSize",
"(",
"32768",
")",
";",
"}",
"}"
] | Perform validation of the stream before processing external requests
to write data.
@throws IOException | [
"Perform",
"validation",
"of",
"the",
"stream",
"before",
"processing",
"external",
"requests",
"to",
"write",
"data",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutputStreamImpl.java#L214-L228 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutputStreamImpl.java | HttpOutputStreamImpl.convertFile | @FFDCIgnore({ IOException.class })
private void convertFile(FileChannel fc) throws IOException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Converting FileChannel to buffers");
}
final WsByteBuffer[] body = new WsByteBuffer[1];
final WsByteBufferPoolManager mgr = HttpDispatcher.getBufferManager();
final long max = fc.size();
final long blocksize = (1048576L < max) ? 1048576L : max;
long offset = 0;
while (offset < max) {
ByteBuffer bb = fc.map(MapMode.READ_ONLY, offset, blocksize);
offset += blocksize;
WsByteBuffer wsbb = mgr.wrap(bb);
body[0] = wsbb;
try {
this.isc.sendResponseBody(body);
} catch (MessageSentException mse) {
FFDCFilter.processException(mse, getClass().getName(),
"convertFile", new Object[] { this, this.isc });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Invalid state, message-sent-exception received; " + this.isc);
}
this.error = new IOException("Invalid state");
throw this.error;
} catch (IOException ioe) {
// no FFDC required
this.error = ioe;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received exception during write: " + ioe);
}
throw ioe;
} finally {
wsbb.release();
}
} // end-while
} | java | @FFDCIgnore({ IOException.class })
private void convertFile(FileChannel fc) throws IOException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Converting FileChannel to buffers");
}
final WsByteBuffer[] body = new WsByteBuffer[1];
final WsByteBufferPoolManager mgr = HttpDispatcher.getBufferManager();
final long max = fc.size();
final long blocksize = (1048576L < max) ? 1048576L : max;
long offset = 0;
while (offset < max) {
ByteBuffer bb = fc.map(MapMode.READ_ONLY, offset, blocksize);
offset += blocksize;
WsByteBuffer wsbb = mgr.wrap(bb);
body[0] = wsbb;
try {
this.isc.sendResponseBody(body);
} catch (MessageSentException mse) {
FFDCFilter.processException(mse, getClass().getName(),
"convertFile", new Object[] { this, this.isc });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Invalid state, message-sent-exception received; " + this.isc);
}
this.error = new IOException("Invalid state");
throw this.error;
} catch (IOException ioe) {
// no FFDC required
this.error = ioe;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received exception during write: " + ioe);
}
throw ioe;
} finally {
wsbb.release();
}
} // end-while
} | [
"@",
"FFDCIgnore",
"(",
"{",
"IOException",
".",
"class",
"}",
")",
"private",
"void",
"convertFile",
"(",
"FileChannel",
"fc",
")",
"throws",
"IOException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Converting FileChannel to buffers\"",
")",
";",
"}",
"final",
"WsByteBuffer",
"[",
"]",
"body",
"=",
"new",
"WsByteBuffer",
"[",
"1",
"]",
";",
"final",
"WsByteBufferPoolManager",
"mgr",
"=",
"HttpDispatcher",
".",
"getBufferManager",
"(",
")",
";",
"final",
"long",
"max",
"=",
"fc",
".",
"size",
"(",
")",
";",
"final",
"long",
"blocksize",
"=",
"(",
"1048576L",
"<",
"max",
")",
"?",
"1048576L",
":",
"max",
";",
"long",
"offset",
"=",
"0",
";",
"while",
"(",
"offset",
"<",
"max",
")",
"{",
"ByteBuffer",
"bb",
"=",
"fc",
".",
"map",
"(",
"MapMode",
".",
"READ_ONLY",
",",
"offset",
",",
"blocksize",
")",
";",
"offset",
"+=",
"blocksize",
";",
"WsByteBuffer",
"wsbb",
"=",
"mgr",
".",
"wrap",
"(",
"bb",
")",
";",
"body",
"[",
"0",
"]",
"=",
"wsbb",
";",
"try",
"{",
"this",
".",
"isc",
".",
"sendResponseBody",
"(",
"body",
")",
";",
"}",
"catch",
"(",
"MessageSentException",
"mse",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"mse",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"convertFile\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"this",
".",
"isc",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Invalid state, message-sent-exception received; \"",
"+",
"this",
".",
"isc",
")",
";",
"}",
"this",
".",
"error",
"=",
"new",
"IOException",
"(",
"\"Invalid state\"",
")",
";",
"throw",
"this",
".",
"error",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"// no FFDC required",
"this",
".",
"error",
"=",
"ioe",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Received exception during write: \"",
"+",
"ioe",
")",
";",
"}",
"throw",
"ioe",
";",
"}",
"finally",
"{",
"wsbb",
".",
"release",
"(",
")",
";",
"}",
"}",
"// end-while",
"}"
] | User attempted to use the optimized FileChannel writing; however, that
path is currently disabled. This method will read the file and do repeated
write calls until done. This avoids TCP channel doing it in one big block.
@param fc
@throws IOException | [
"User",
"attempted",
"to",
"use",
"the",
"optimized",
"FileChannel",
"writing",
";",
"however",
"that",
"path",
"is",
"currently",
"disabled",
".",
"This",
"method",
"will",
"read",
"the",
"file",
"and",
"do",
"repeated",
"write",
"calls",
"until",
"done",
".",
"This",
"avoids",
"TCP",
"channel",
"doing",
"it",
"in",
"one",
"big",
"block",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutputStreamImpl.java#L325-L361 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.persistence/src/com/ibm/wsspi/persistence/internal/PUInfoImpl.java | PUInfoImpl.copyInMemoryMappingFiles | private List<InMemoryMappingFile> copyInMemoryMappingFiles(List<InMemoryMappingFile> copyIMMF) {
List<InMemoryMappingFile> immf = new ArrayList<InMemoryMappingFile>();
for (InMemoryMappingFile file : copyIMMF) {
immf.add(new InMemoryMappingFile(file.getMappingFile()));
}
return immf;
} | java | private List<InMemoryMappingFile> copyInMemoryMappingFiles(List<InMemoryMappingFile> copyIMMF) {
List<InMemoryMappingFile> immf = new ArrayList<InMemoryMappingFile>();
for (InMemoryMappingFile file : copyIMMF) {
immf.add(new InMemoryMappingFile(file.getMappingFile()));
}
return immf;
} | [
"private",
"List",
"<",
"InMemoryMappingFile",
">",
"copyInMemoryMappingFiles",
"(",
"List",
"<",
"InMemoryMappingFile",
">",
"copyIMMF",
")",
"{",
"List",
"<",
"InMemoryMappingFile",
">",
"immf",
"=",
"new",
"ArrayList",
"<",
"InMemoryMappingFile",
">",
"(",
")",
";",
"for",
"(",
"InMemoryMappingFile",
"file",
":",
"copyIMMF",
")",
"{",
"immf",
".",
"add",
"(",
"new",
"InMemoryMappingFile",
"(",
"file",
".",
"getMappingFile",
"(",
")",
")",
")",
";",
"}",
"return",
"immf",
";",
"}"
] | Private method that takes a list of InMemoryMappingFiles and copies them by assigning a new
id while sharing the same underlying byte array. This method avoids unnecessarily create
identical byte arrays. Once all references to a byte array are deleted, the garbage
collector will cleanup the byte array. | [
"Private",
"method",
"that",
"takes",
"a",
"list",
"of",
"InMemoryMappingFiles",
"and",
"copies",
"them",
"by",
"assigning",
"a",
"new",
"id",
"while",
"sharing",
"the",
"same",
"underlying",
"byte",
"array",
".",
"This",
"method",
"avoids",
"unnecessarily",
"create",
"identical",
"byte",
"arrays",
".",
"Once",
"all",
"references",
"to",
"a",
"byte",
"array",
"are",
"deleted",
"the",
"garbage",
"collector",
"will",
"cleanup",
"the",
"byte",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.persistence/src/com/ibm/wsspi/persistence/internal/PUInfoImpl.java#L109-L115 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPChannelFactory.java | TCPChannelFactory.createChannel | protected Channel createChannel(ChannelData channelData) throws ChannelException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "createChannel");
}
TCPChannelConfiguration newCC = new TCPChannelConfiguration(channelData);
TCPChannel channel = null;
boolean isOverrideClassUsed = false;
if ((!newCC.isNIOOnly())
&& (commClass != null)
&& (ChannelFrameworkImpl.getRef().getAsyncIOEnabled())) {
try {
channel = (TCPChannel) commClass.newInstance();
ChannelTermination ct = channel.setup(channelData, newCC, this);
if (ct != null) {
this.terminationList.put(commClassName, ct);
}
isOverrideClassUsed = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "using CommClass: " + commClass);
}
} catch (Exception e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Exception trying to instantiate CommClass: " + e);
}
}
}
if (!isOverrideClassUsed) {
channel = new NioTCPChannel();
ChannelTermination ct = channel.setup(channelData, newCC, this);
if (ct != null) {
this.terminationList.put("NioTCPChannel", ct);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "createChannel");
}
return channel;
} | java | protected Channel createChannel(ChannelData channelData) throws ChannelException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "createChannel");
}
TCPChannelConfiguration newCC = new TCPChannelConfiguration(channelData);
TCPChannel channel = null;
boolean isOverrideClassUsed = false;
if ((!newCC.isNIOOnly())
&& (commClass != null)
&& (ChannelFrameworkImpl.getRef().getAsyncIOEnabled())) {
try {
channel = (TCPChannel) commClass.newInstance();
ChannelTermination ct = channel.setup(channelData, newCC, this);
if (ct != null) {
this.terminationList.put(commClassName, ct);
}
isOverrideClassUsed = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "using CommClass: " + commClass);
}
} catch (Exception e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Exception trying to instantiate CommClass: " + e);
}
}
}
if (!isOverrideClassUsed) {
channel = new NioTCPChannel();
ChannelTermination ct = channel.setup(channelData, newCC, this);
if (ct != null) {
this.terminationList.put("NioTCPChannel", ct);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "createChannel");
}
return channel;
} | [
"protected",
"Channel",
"createChannel",
"(",
"ChannelData",
"channelData",
")",
"throws",
"ChannelException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"createChannel\"",
")",
";",
"}",
"TCPChannelConfiguration",
"newCC",
"=",
"new",
"TCPChannelConfiguration",
"(",
"channelData",
")",
";",
"TCPChannel",
"channel",
"=",
"null",
";",
"boolean",
"isOverrideClassUsed",
"=",
"false",
";",
"if",
"(",
"(",
"!",
"newCC",
".",
"isNIOOnly",
"(",
")",
")",
"&&",
"(",
"commClass",
"!=",
"null",
")",
"&&",
"(",
"ChannelFrameworkImpl",
".",
"getRef",
"(",
")",
".",
"getAsyncIOEnabled",
"(",
")",
")",
")",
"{",
"try",
"{",
"channel",
"=",
"(",
"TCPChannel",
")",
"commClass",
".",
"newInstance",
"(",
")",
";",
"ChannelTermination",
"ct",
"=",
"channel",
".",
"setup",
"(",
"channelData",
",",
"newCC",
",",
"this",
")",
";",
"if",
"(",
"ct",
"!=",
"null",
")",
"{",
"this",
".",
"terminationList",
".",
"put",
"(",
"commClassName",
",",
"ct",
")",
";",
"}",
"isOverrideClassUsed",
"=",
"true",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"using CommClass: \"",
"+",
"commClass",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception trying to instantiate CommClass: \"",
"+",
"e",
")",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"isOverrideClassUsed",
")",
"{",
"channel",
"=",
"new",
"NioTCPChannel",
"(",
")",
";",
"ChannelTermination",
"ct",
"=",
"channel",
".",
"setup",
"(",
"channelData",
",",
"newCC",
",",
"this",
")",
";",
"if",
"(",
"ct",
"!=",
"null",
")",
"{",
"this",
".",
"terminationList",
".",
"put",
"(",
"\"NioTCPChannel\"",
",",
"ct",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"createChannel\"",
")",
";",
"}",
"return",
"channel",
";",
"}"
] | Declared abstract in the ChannelFactoryImpl class.
@param channelData
@return Channel
@throws ChannelException | [
"Declared",
"abstract",
"in",
"the",
"ChannelFactoryImpl",
"class",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPChannelFactory.java#L147-L188 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/security/SecurityViolationException.java | SecurityViolationException.processException | public void processException(HttpServletRequest req, HttpServletResponse res) throws IOException
{
if (redirectURL != null)
{
res.sendRedirect(redirectURL);
return;
}
if (message == null)
{
res.sendError(statusCode);
}
else
{
res.sendError(statusCode, message);
}
} | java | public void processException(HttpServletRequest req, HttpServletResponse res) throws IOException
{
if (redirectURL != null)
{
res.sendRedirect(redirectURL);
return;
}
if (message == null)
{
res.sendError(statusCode);
}
else
{
res.sendError(statusCode, message);
}
} | [
"public",
"void",
"processException",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"IOException",
"{",
"if",
"(",
"redirectURL",
"!=",
"null",
")",
"{",
"res",
".",
"sendRedirect",
"(",
"redirectURL",
")",
";",
"return",
";",
"}",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"res",
".",
"sendError",
"(",
"statusCode",
")",
";",
"}",
"else",
"{",
"res",
".",
"sendError",
"(",
"statusCode",
",",
"message",
")",
";",
"}",
"}"
] | Process security violation exception
@param req - Http servlet request object
@param res - Http servlet response object
@throws IOException if error, otherwise redirects to appropriate error or login page | [
"Process",
"security",
"violation",
"exception"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/security/SecurityViolationException.java#L84-L100 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getMD5String | public static String getMD5String(String str) {
MessageDigest messageDigest = getMessageDigest(MD5);
return getHashString(str, messageDigest);
} | java | public static String getMD5String(String str) {
MessageDigest messageDigest = getMessageDigest(MD5);
return getHashString(str, messageDigest);
} | [
"public",
"static",
"String",
"getMD5String",
"(",
"String",
"str",
")",
"{",
"MessageDigest",
"messageDigest",
"=",
"getMessageDigest",
"(",
"MD5",
")",
";",
"return",
"getHashString",
"(",
"str",
",",
"messageDigest",
")",
";",
"}"
] | Calculate MD5 hash of a String
@param str - the String to hash
@return the MD5 hash value | [
"Calculate",
"MD5",
"hash",
"of",
"a",
"String"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L35-L38 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getFileMD5String | public static String getFileMD5String(File file) throws IOException {
MessageDigest messageDigest = getMessageDigest(MD5);
return getFileHashString(file, messageDigest);
} | java | public static String getFileMD5String(File file) throws IOException {
MessageDigest messageDigest = getMessageDigest(MD5);
return getFileHashString(file, messageDigest);
} | [
"public",
"static",
"String",
"getFileMD5String",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"MessageDigest",
"messageDigest",
"=",
"getMessageDigest",
"(",
"MD5",
")",
";",
"return",
"getFileHashString",
"(",
"file",
",",
"messageDigest",
")",
";",
"}"
] | Calculate MD5 hash of a File
@param file - the File to hash
@return the MD5 hash value
@throws IOException | [
"Calculate",
"MD5",
"hash",
"of",
"a",
"File"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L47-L50 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getSHA256String | public static String getSHA256String(String str) {
MessageDigest messageDigest = getMessageDigest(SHA256);
return getHashString(str, messageDigest);
} | java | public static String getSHA256String(String str) {
MessageDigest messageDigest = getMessageDigest(SHA256);
return getHashString(str, messageDigest);
} | [
"public",
"static",
"String",
"getSHA256String",
"(",
"String",
"str",
")",
"{",
"MessageDigest",
"messageDigest",
"=",
"getMessageDigest",
"(",
"SHA256",
")",
";",
"return",
"getHashString",
"(",
"str",
",",
"messageDigest",
")",
";",
"}"
] | Calculate SHA-256 hash of a String
@param str - the String to hash
@return the SHA-256 hash value | [
"Calculate",
"SHA",
"-",
"256",
"hash",
"of",
"a",
"String"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L58-L61 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getFileSHA256String | public static String getFileSHA256String(File file) throws IOException {
MessageDigest messageDigest = getMessageDigest(SHA256);
return getFileHashString(file, messageDigest);
} | java | public static String getFileSHA256String(File file) throws IOException {
MessageDigest messageDigest = getMessageDigest(SHA256);
return getFileHashString(file, messageDigest);
} | [
"public",
"static",
"String",
"getFileSHA256String",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"MessageDigest",
"messageDigest",
"=",
"getMessageDigest",
"(",
"SHA256",
")",
";",
"return",
"getFileHashString",
"(",
"file",
",",
"messageDigest",
")",
";",
"}"
] | Calculate SHA-256 hash of a File
@param file - the File to hash
@return the SHA-256 hash value
@throws IOException | [
"Calculate",
"SHA",
"-",
"256",
"hash",
"of",
"a",
"File"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L70-L73 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getMessageDigest | private static MessageDigest getMessageDigest(String digestType) {
MessageDigest messageDigest;
try {
messageDigest = MessageDigest.getInstance(digestType);
} catch (NoSuchAlgorithmException e) {
//should not happen
throw new RuntimeException(e);
}
return messageDigest;
} | java | private static MessageDigest getMessageDigest(String digestType) {
MessageDigest messageDigest;
try {
messageDigest = MessageDigest.getInstance(digestType);
} catch (NoSuchAlgorithmException e) {
//should not happen
throw new RuntimeException(e);
}
return messageDigest;
} | [
"private",
"static",
"MessageDigest",
"getMessageDigest",
"(",
"String",
"digestType",
")",
"{",
"MessageDigest",
"messageDigest",
";",
"try",
"{",
"messageDigest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"digestType",
")",
";",
"}",
"catch",
"(",
"NoSuchAlgorithmException",
"e",
")",
"{",
"//should not happen",
"throw",
"new",
"RuntimeException",
"(",
"e",
")",
";",
"}",
"return",
"messageDigest",
";",
"}"
] | this code replaces the creation of the message digest in a static code block
as that was found to fail when multi threaded.
@param digestType - MD5 or SHA-256
@return the MessageDigest of the requested type | [
"this",
"code",
"replaces",
"the",
"creation",
"of",
"the",
"message",
"digest",
"in",
"a",
"static",
"code",
"block",
"as",
"that",
"was",
"found",
"to",
"fail",
"when",
"multi",
"threaded",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L121-L130 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java | Engine.install | public void install(InstallAsset installAsset, List<File> filesInstalled, Collection<String> featuresToBeInstalled, ExistsAction existsAction,
Set<String> executableFiles, Map<String, Set<String>> extattrFiles, boolean downloadDependencies,
RestRepositoryConnectionProxy proxy, ChecksumsManager checksumsManager) throws IOException, InstallException {
if (installAsset.isFeature())
ESAAdaptor.install(product, (ESAAsset) installAsset, filesInstalled, featuresToBeInstalled, existsAction, executableFiles, extattrFiles, checksumsManager);
else if (installAsset.isFix())
FixAdaptor.install(product, (FixAsset) installAsset);
else if (installAsset.isServerPackage())
if (installAsset instanceof JarAsset) {
ServerPackageJarAdaptor.install(product, (JarAsset) installAsset, filesInstalled, downloadDependencies, proxy);
} else {
ServicePackageAdaptor.install(product, (ServerPackageAsset) installAsset, filesInstalled, existsAction);
}
else if (installAsset.isSample())
ServerPackageJarAdaptor.install(product, (JarAsset) installAsset, filesInstalled, downloadDependencies, proxy);
else if (installAsset.isOpenSource())
ServerPackageJarAdaptor.install(product, (JarAsset) installAsset, filesInstalled, downloadDependencies, proxy);
} | java | public void install(InstallAsset installAsset, List<File> filesInstalled, Collection<String> featuresToBeInstalled, ExistsAction existsAction,
Set<String> executableFiles, Map<String, Set<String>> extattrFiles, boolean downloadDependencies,
RestRepositoryConnectionProxy proxy, ChecksumsManager checksumsManager) throws IOException, InstallException {
if (installAsset.isFeature())
ESAAdaptor.install(product, (ESAAsset) installAsset, filesInstalled, featuresToBeInstalled, existsAction, executableFiles, extattrFiles, checksumsManager);
else if (installAsset.isFix())
FixAdaptor.install(product, (FixAsset) installAsset);
else if (installAsset.isServerPackage())
if (installAsset instanceof JarAsset) {
ServerPackageJarAdaptor.install(product, (JarAsset) installAsset, filesInstalled, downloadDependencies, proxy);
} else {
ServicePackageAdaptor.install(product, (ServerPackageAsset) installAsset, filesInstalled, existsAction);
}
else if (installAsset.isSample())
ServerPackageJarAdaptor.install(product, (JarAsset) installAsset, filesInstalled, downloadDependencies, proxy);
else if (installAsset.isOpenSource())
ServerPackageJarAdaptor.install(product, (JarAsset) installAsset, filesInstalled, downloadDependencies, proxy);
} | [
"public",
"void",
"install",
"(",
"InstallAsset",
"installAsset",
",",
"List",
"<",
"File",
">",
"filesInstalled",
",",
"Collection",
"<",
"String",
">",
"featuresToBeInstalled",
",",
"ExistsAction",
"existsAction",
",",
"Set",
"<",
"String",
">",
"executableFiles",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"extattrFiles",
",",
"boolean",
"downloadDependencies",
",",
"RestRepositoryConnectionProxy",
"proxy",
",",
"ChecksumsManager",
"checksumsManager",
")",
"throws",
"IOException",
",",
"InstallException",
"{",
"if",
"(",
"installAsset",
".",
"isFeature",
"(",
")",
")",
"ESAAdaptor",
".",
"install",
"(",
"product",
",",
"(",
"ESAAsset",
")",
"installAsset",
",",
"filesInstalled",
",",
"featuresToBeInstalled",
",",
"existsAction",
",",
"executableFiles",
",",
"extattrFiles",
",",
"checksumsManager",
")",
";",
"else",
"if",
"(",
"installAsset",
".",
"isFix",
"(",
")",
")",
"FixAdaptor",
".",
"install",
"(",
"product",
",",
"(",
"FixAsset",
")",
"installAsset",
")",
";",
"else",
"if",
"(",
"installAsset",
".",
"isServerPackage",
"(",
")",
")",
"if",
"(",
"installAsset",
"instanceof",
"JarAsset",
")",
"{",
"ServerPackageJarAdaptor",
".",
"install",
"(",
"product",
",",
"(",
"JarAsset",
")",
"installAsset",
",",
"filesInstalled",
",",
"downloadDependencies",
",",
"proxy",
")",
";",
"}",
"else",
"{",
"ServicePackageAdaptor",
".",
"install",
"(",
"product",
",",
"(",
"ServerPackageAsset",
")",
"installAsset",
",",
"filesInstalled",
",",
"existsAction",
")",
";",
"}",
"else",
"if",
"(",
"installAsset",
".",
"isSample",
"(",
")",
")",
"ServerPackageJarAdaptor",
".",
"install",
"(",
"product",
",",
"(",
"JarAsset",
")",
"installAsset",
",",
"filesInstalled",
",",
"downloadDependencies",
",",
"proxy",
")",
";",
"else",
"if",
"(",
"installAsset",
".",
"isOpenSource",
"(",
")",
")",
"ServerPackageJarAdaptor",
".",
"install",
"(",
"product",
",",
"(",
"JarAsset",
")",
"installAsset",
",",
"filesInstalled",
",",
"downloadDependencies",
",",
"proxy",
")",
";",
"}"
] | Determines which install method to call based on the type of installAsset
@param installAsset InstallAsset to install
@param filesInstalled List of files to be installed
@param featuresToBeInstalled Collection of feature names to install
@param existsAction Action to take if asset exists
@param executableFiles Set of executable file names
@param extattrFiles Extendible attribute files as a set
@param downloadDependencies If dependencies should be downloaded
@param proxy RestRepositoryConnectionProxy to connect to
@param checksumsManager ChecksumsManager for installed files
@throws IOException
@throws InstallException | [
"Determines",
"which",
"install",
"method",
"to",
"call",
"based",
"on",
"the",
"type",
"of",
"installAsset"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java#L67-L84 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java | Engine.installFeatureNoDependencyCheck | public void installFeatureNoDependencyCheck(InstallAsset installAsset, List<File> filesInstalled, Collection<String> featuresToBeInstalled, ExistsAction existsAction,
Set<String> executableFiles, Map<String, Set<String>> extattrFiles, boolean downloadDependencies,
RestRepositoryConnectionProxy proxy, ChecksumsManager checksumsManager) throws IOException, InstallException {
ESAAdaptor.install(product, (ESAAsset) installAsset, filesInstalled, featuresToBeInstalled, existsAction, executableFiles, extattrFiles, checksumsManager, true);
} | java | public void installFeatureNoDependencyCheck(InstallAsset installAsset, List<File> filesInstalled, Collection<String> featuresToBeInstalled, ExistsAction existsAction,
Set<String> executableFiles, Map<String, Set<String>> extattrFiles, boolean downloadDependencies,
RestRepositoryConnectionProxy proxy, ChecksumsManager checksumsManager) throws IOException, InstallException {
ESAAdaptor.install(product, (ESAAsset) installAsset, filesInstalled, featuresToBeInstalled, existsAction, executableFiles, extattrFiles, checksumsManager, true);
} | [
"public",
"void",
"installFeatureNoDependencyCheck",
"(",
"InstallAsset",
"installAsset",
",",
"List",
"<",
"File",
">",
"filesInstalled",
",",
"Collection",
"<",
"String",
">",
"featuresToBeInstalled",
",",
"ExistsAction",
"existsAction",
",",
"Set",
"<",
"String",
">",
"executableFiles",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"extattrFiles",
",",
"boolean",
"downloadDependencies",
",",
"RestRepositoryConnectionProxy",
"proxy",
",",
"ChecksumsManager",
"checksumsManager",
")",
"throws",
"IOException",
",",
"InstallException",
"{",
"ESAAdaptor",
".",
"install",
"(",
"product",
",",
"(",
"ESAAsset",
")",
"installAsset",
",",
"filesInstalled",
",",
"featuresToBeInstalled",
",",
"existsAction",
",",
"executableFiles",
",",
"extattrFiles",
",",
"checksumsManager",
",",
"true",
")",
";",
"}"
] | Installs Feature while skipping dependency check
@param installAsset InstallAsset to install
@param filesInstalled List of files to be installed
@param featuresToBeInstalled Collection of feature names to install
@param existsAction Action to take if asset exists
@param executableFiles Set of executable file names
@param extattrFiles Extendible attribute files as a set
@param downloadDependencies If dependencies should be downloaded
@param proxy RestRepositoryConnectionProxy to connect to
@param checksumsManager ChecksumsManager for installed files
@throws IOException
@throws InstallException | [
"Installs",
"Feature",
"while",
"skipping",
"dependency",
"check"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java#L101-L105 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java | Engine.uninstall | public void uninstall(UninstallAsset uninstallAsset, boolean checkDependency,
List<File> filesRestored) throws IOException, ParserConfigurationException, SAXException, InstallException {
if (uninstallAsset.getType().equals(UninstallAssetType.feature)) {
// Remove the feature contents and metadata
ESAAdaptor.uninstallFeature(uninstallAsset, uninstallAsset.getProvisioningFeatureDefinition(),
getBaseDir(uninstallAsset.getProvisioningFeatureDefinition()), filesRestored);
} else if (uninstallAsset.getType().equals(UninstallAssetType.fix)) {
FixAdaptor.uninstallFix(uninstallAsset.getIFixInfo(), product.getInstallDir(), filesRestored);
}
InstallUtils.updateFingerprint(product.getInstallDir());
} | java | public void uninstall(UninstallAsset uninstallAsset, boolean checkDependency,
List<File> filesRestored) throws IOException, ParserConfigurationException, SAXException, InstallException {
if (uninstallAsset.getType().equals(UninstallAssetType.feature)) {
// Remove the feature contents and metadata
ESAAdaptor.uninstallFeature(uninstallAsset, uninstallAsset.getProvisioningFeatureDefinition(),
getBaseDir(uninstallAsset.getProvisioningFeatureDefinition()), filesRestored);
} else if (uninstallAsset.getType().equals(UninstallAssetType.fix)) {
FixAdaptor.uninstallFix(uninstallAsset.getIFixInfo(), product.getInstallDir(), filesRestored);
}
InstallUtils.updateFingerprint(product.getInstallDir());
} | [
"public",
"void",
"uninstall",
"(",
"UninstallAsset",
"uninstallAsset",
",",
"boolean",
"checkDependency",
",",
"List",
"<",
"File",
">",
"filesRestored",
")",
"throws",
"IOException",
",",
"ParserConfigurationException",
",",
"SAXException",
",",
"InstallException",
"{",
"if",
"(",
"uninstallAsset",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"UninstallAssetType",
".",
"feature",
")",
")",
"{",
"// Remove the feature contents and metadata",
"ESAAdaptor",
".",
"uninstallFeature",
"(",
"uninstallAsset",
",",
"uninstallAsset",
".",
"getProvisioningFeatureDefinition",
"(",
")",
",",
"getBaseDir",
"(",
"uninstallAsset",
".",
"getProvisioningFeatureDefinition",
"(",
")",
")",
",",
"filesRestored",
")",
";",
"}",
"else",
"if",
"(",
"uninstallAsset",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"UninstallAssetType",
".",
"fix",
")",
")",
"{",
"FixAdaptor",
".",
"uninstallFix",
"(",
"uninstallAsset",
".",
"getIFixInfo",
"(",
")",
",",
"product",
".",
"getInstallDir",
"(",
")",
",",
"filesRestored",
")",
";",
"}",
"InstallUtils",
".",
"updateFingerprint",
"(",
"product",
".",
"getInstallDir",
"(",
")",
")",
";",
"}"
] | Determines which install method to call based on the type of uninstallAsset
@param uninstallAsset UninstallAsset to uninstall
@param checkDependency If dependencies should be checked
@param filesRestored Files to be restored
@throws IOException
@throws ParserConfigurationException
@throws SAXException
@throws InstallException | [
"Determines",
"which",
"install",
"method",
"to",
"call",
"based",
"on",
"the",
"type",
"of",
"uninstallAsset"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java#L118-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java | Engine.preCheck | public void preCheck(UninstallAsset uninstallAsset) throws InstallException {
if (uninstallAsset.getType().equals(UninstallAssetType.feature)) {
ESAAdaptor.preCheck(uninstallAsset, uninstallAsset.getProvisioningFeatureDefinition(),
getBaseDir(uninstallAsset.getProvisioningFeatureDefinition()));
} else if (uninstallAsset.getType().equals(UninstallAssetType.fix)) {
FixAdaptor.preCheck(uninstallAsset.getIFixInfo(), product.getInstallDir());
}
} | java | public void preCheck(UninstallAsset uninstallAsset) throws InstallException {
if (uninstallAsset.getType().equals(UninstallAssetType.feature)) {
ESAAdaptor.preCheck(uninstallAsset, uninstallAsset.getProvisioningFeatureDefinition(),
getBaseDir(uninstallAsset.getProvisioningFeatureDefinition()));
} else if (uninstallAsset.getType().equals(UninstallAssetType.fix)) {
FixAdaptor.preCheck(uninstallAsset.getIFixInfo(), product.getInstallDir());
}
} | [
"public",
"void",
"preCheck",
"(",
"UninstallAsset",
"uninstallAsset",
")",
"throws",
"InstallException",
"{",
"if",
"(",
"uninstallAsset",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"UninstallAssetType",
".",
"feature",
")",
")",
"{",
"ESAAdaptor",
".",
"preCheck",
"(",
"uninstallAsset",
",",
"uninstallAsset",
".",
"getProvisioningFeatureDefinition",
"(",
")",
",",
"getBaseDir",
"(",
"uninstallAsset",
".",
"getProvisioningFeatureDefinition",
"(",
")",
")",
")",
";",
"}",
"else",
"if",
"(",
"uninstallAsset",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"UninstallAssetType",
".",
"fix",
")",
")",
"{",
"FixAdaptor",
".",
"preCheck",
"(",
"uninstallAsset",
".",
"getIFixInfo",
"(",
")",
",",
"product",
".",
"getInstallDir",
"(",
")",
")",
";",
"}",
"}"
] | Determines which preCheck method to call based on the uninstalLAsset type
@param uninstallAsset UninstallAsset to be uninstalled
@param checkDependency If dependencies should be checked
@throws InstallException | [
"Determines",
"which",
"preCheck",
"method",
"to",
"call",
"based",
"on",
"the",
"uninstalLAsset",
"type"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Engine.java#L148-L155 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java | FFDCLogger.append | public final FFDCLogger append(String description, Object value) {
lines.add(description);
lines.add(new StringBuffer().append(TAB).append(value).append(AdapterUtil.EOLN).toString());
return this;
} | java | public final FFDCLogger append(String description, Object value) {
lines.add(description);
lines.add(new StringBuffer().append(TAB).append(value).append(AdapterUtil.EOLN).toString());
return this;
} | [
"public",
"final",
"FFDCLogger",
"append",
"(",
"String",
"description",
",",
"Object",
"value",
")",
"{",
"lines",
".",
"add",
"(",
"description",
")",
";",
"lines",
".",
"add",
"(",
"new",
"StringBuffer",
"(",
")",
".",
"append",
"(",
"TAB",
")",
".",
"append",
"(",
"value",
")",
".",
"append",
"(",
"AdapterUtil",
".",
"EOLN",
")",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] | Appends FFDC information to the log.
@param description a description of the value.
@param value the value.
@return this FFDC logger. | [
"Appends",
"FFDC",
"information",
"to",
"the",
"log",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java#L55-L60 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java | FFDCLogger.append | public final FFDCLogger append(String info) {
lines.add(new StringBuffer().append(info).append(AdapterUtil.EOLN).toString());
return this;
} | java | public final FFDCLogger append(String info) {
lines.add(new StringBuffer().append(info).append(AdapterUtil.EOLN).toString());
return this;
} | [
"public",
"final",
"FFDCLogger",
"append",
"(",
"String",
"info",
")",
"{",
"lines",
".",
"add",
"(",
"new",
"StringBuffer",
"(",
")",
".",
"append",
"(",
"info",
")",
".",
"append",
"(",
"AdapterUtil",
".",
"EOLN",
")",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] | Appends a single line of FFDC information.
@param info the information to add.
@return this FFDC logger. | [
"Appends",
"a",
"single",
"line",
"of",
"FFDC",
"information",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java#L69-L73 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java | FFDCLogger.append | public final FFDCLogger append(String[] moreLines) {
int numLines = moreLines.length;
for (int i = 0; i < numLines; i++)
lines.add(moreLines[i]);
return this;
} | java | public final FFDCLogger append(String[] moreLines) {
int numLines = moreLines.length;
for (int i = 0; i < numLines; i++)
lines.add(moreLines[i]);
return this;
} | [
"public",
"final",
"FFDCLogger",
"append",
"(",
"String",
"[",
"]",
"moreLines",
")",
"{",
"int",
"numLines",
"=",
"moreLines",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numLines",
";",
"i",
"++",
")",
"lines",
".",
"(",
"moreLines",
"[",
"i",
"]",
")",
";",
"return",
"this",
";",
"}"
] | Appends output from another FFDC self introspect method.
@param moreLines the output from the other method.
@return this FFDC logger. | [
"Appends",
"output",
"from",
"another",
"FFDC",
"self",
"introspect",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java#L82-L88 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java | FFDCLogger.indent | public final FFDCLogger indent(Object value) {
lines.add(new StringBuffer().append(TAB).append(value).toString());
return this;
} | java | public final FFDCLogger indent(Object value) {
lines.add(new StringBuffer().append(TAB).append(value).toString());
return this;
} | [
"public",
"final",
"FFDCLogger",
"indent",
"(",
"Object",
"value",
")",
"{",
"lines",
".",
"add",
"(",
"new",
"StringBuffer",
"(",
")",
".",
"append",
"(",
"TAB",
")",
".",
"append",
"(",
"value",
")",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] | Appends an indented line of FFDC information.
@param value the information to add.
@return this FFDC logger. | [
"Appends",
"an",
"indented",
"line",
"of",
"FFDC",
"information",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java#L125-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java | FFDCLogger.introspect | public final FFDCLogger introspect(String description, Object value)
{
if (value instanceof FFDCSelfIntrospectable)
append(((FFDCSelfIntrospectable) value).introspectSelf());
else
append(description, value);
return this;
} | java | public final FFDCLogger introspect(String description, Object value)
{
if (value instanceof FFDCSelfIntrospectable)
append(((FFDCSelfIntrospectable) value).introspectSelf());
else
append(description, value);
return this;
} | [
"public",
"final",
"FFDCLogger",
"introspect",
"(",
"String",
"description",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"FFDCSelfIntrospectable",
")",
"append",
"(",
"(",
"(",
"FFDCSelfIntrospectable",
")",
"value",
")",
".",
"introspectSelf",
"(",
")",
")",
";",
"else",
"append",
"(",
"description",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Appends the FFDC self introspection information for the object provided. If none is
available then we delegate to the normal append method.
@param description a description of the value.
@param value the value.
@return this FFDC logger. | [
"Appends",
"the",
"FFDC",
"self",
"introspection",
"information",
"for",
"the",
"object",
"provided",
".",
"If",
"none",
"is",
"available",
"then",
"we",
"delegate",
"to",
"the",
"normal",
"append",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/FFDCLogger.java#L139-L147 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java | KernelResolverRepository.getCachedFeature | private ProvisioningFeatureDefinition getCachedFeature(String featureName) {
List<ProvisioningFeatureDefinition> featureList = symbolicNameToFeature.get(featureName);
if (featureList == null) {
featureName = publicNameToSymbolicName.get(featureName.toLowerCase());
if (featureName != null) {
featureList = symbolicNameToFeature.get(featureName);
}
}
if (featureList == null || featureList.isEmpty()) {
return null;
}
return getPreferredVersion(featureName, featureList);
} | java | private ProvisioningFeatureDefinition getCachedFeature(String featureName) {
List<ProvisioningFeatureDefinition> featureList = symbolicNameToFeature.get(featureName);
if (featureList == null) {
featureName = publicNameToSymbolicName.get(featureName.toLowerCase());
if (featureName != null) {
featureList = symbolicNameToFeature.get(featureName);
}
}
if (featureList == null || featureList.isEmpty()) {
return null;
}
return getPreferredVersion(featureName, featureList);
} | [
"private",
"ProvisioningFeatureDefinition",
"getCachedFeature",
"(",
"String",
"featureName",
")",
"{",
"List",
"<",
"ProvisioningFeatureDefinition",
">",
"featureList",
"=",
"symbolicNameToFeature",
".",
"get",
"(",
"featureName",
")",
";",
"if",
"(",
"featureList",
"==",
"null",
")",
"{",
"featureName",
"=",
"publicNameToSymbolicName",
".",
"get",
"(",
"featureName",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
"(",
"featureName",
"!=",
"null",
")",
"{",
"featureList",
"=",
"symbolicNameToFeature",
".",
"get",
"(",
"featureName",
")",
";",
"}",
"}",
"if",
"(",
"featureList",
"==",
"null",
"||",
"featureList",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"getPreferredVersion",
"(",
"featureName",
",",
"featureList",
")",
";",
"}"
] | Get a feature by name, but without going and checking the remote repository if we don't know about it
@see #getFeature(String) | [
"Get",
"a",
"feature",
"by",
"name",
"but",
"without",
"going",
"and",
"checking",
"the",
"remote",
"repository",
"if",
"we",
"don",
"t",
"know",
"about",
"it"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java#L188-L203 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java | KernelResolverRepository.getResourcesForName | private List<RepositoryResource> getResourcesForName(String resourceName) {
List<RepositoryResource> results = new ArrayList<>();
try {
results.addAll(repositoryConnection.getMatchingEsas(FilterableAttribute.SYMBOLIC_NAME, resourceName));
results.addAll(repositoryConnection.getMatchingEsas(FilterableAttribute.LOWER_CASE_SHORT_NAME, resourceName.toLowerCase()));
results.addAll(repositoryConnection.getMatchingSamples(FilterableAttribute.LOWER_CASE_SHORT_NAME, resourceName.toLowerCase()));
} catch (RepositoryBackendException e) {
// Don't worry if we fail to contact the repository
// worst case is we report a resource as missing rather than available on another version/edition
}
return results;
} | java | private List<RepositoryResource> getResourcesForName(String resourceName) {
List<RepositoryResource> results = new ArrayList<>();
try {
results.addAll(repositoryConnection.getMatchingEsas(FilterableAttribute.SYMBOLIC_NAME, resourceName));
results.addAll(repositoryConnection.getMatchingEsas(FilterableAttribute.LOWER_CASE_SHORT_NAME, resourceName.toLowerCase()));
results.addAll(repositoryConnection.getMatchingSamples(FilterableAttribute.LOWER_CASE_SHORT_NAME, resourceName.toLowerCase()));
} catch (RepositoryBackendException e) {
// Don't worry if we fail to contact the repository
// worst case is we report a resource as missing rather than available on another version/edition
}
return results;
} | [
"private",
"List",
"<",
"RepositoryResource",
">",
"getResourcesForName",
"(",
"String",
"resourceName",
")",
"{",
"List",
"<",
"RepositoryResource",
">",
"results",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"results",
".",
"addAll",
"(",
"repositoryConnection",
".",
"getMatchingEsas",
"(",
"FilterableAttribute",
".",
"SYMBOLIC_NAME",
",",
"resourceName",
")",
")",
";",
"results",
".",
"addAll",
"(",
"repositoryConnection",
".",
"getMatchingEsas",
"(",
"FilterableAttribute",
".",
"LOWER_CASE_SHORT_NAME",
",",
"resourceName",
".",
"toLowerCase",
"(",
")",
")",
")",
";",
"results",
".",
"addAll",
"(",
"repositoryConnection",
".",
"getMatchingSamples",
"(",
"FilterableAttribute",
".",
"LOWER_CASE_SHORT_NAME",
",",
"resourceName",
".",
"toLowerCase",
"(",
")",
")",
")",
";",
"}",
"catch",
"(",
"RepositoryBackendException",
"e",
")",
"{",
"// Don't worry if we fail to contact the repository",
"// worst case is we report a resource as missing rather than available on another version/edition",
"}",
"return",
"results",
";",
"}"
] | Fetch the feature and sample resources that match the given name, whether or not they're applicable to the current product
@param resourceName the short or symbolic name to look for
@return the resources that match that name | [
"Fetch",
"the",
"feature",
"and",
"sample",
"resources",
"that",
"match",
"the",
"given",
"name",
"whether",
"or",
"not",
"they",
"re",
"applicable",
"to",
"the",
"current",
"product"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java#L241-L252 | train |