repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/jfapchannel/server/ServerConnectionManager.java | ServerConnectionManager.initialiseAcceptListenerFactory | public static void initialiseAcceptListenerFactory(AcceptListenerFactory _acceptListenerFactory)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "initialiseAcceptListenerFactory", _acceptListenerFactory);
Class clientImpl = instance.getClass();
Method initialiseAcceptListenerFactoryMethod;
try
{
initialiseAcceptListenerFactoryMethod = clientImpl.getMethod("initialiseAcceptListenerFactory", new Class[] { AcceptListenerFactory.class });
initialiseAcceptListenerFactoryMethod.invoke(clientImpl, new Object[] { _acceptListenerFactory });
} catch (Exception e)
{
FFDCFilter.processException(e, "com.ibm.ws.sib.jfapchannel.ServerConnectionManager.initialiseAcceptListenerFactory", JFapChannelConstants.SRVRCONNMGR_INITIALISE_ALF_01);
//Make sure we allow for the fact this could be an InvocationTargetException
Throwable displayedException = e;
if (e instanceof InvocationTargetException)
displayedException = e.getCause();
SibTr.error(tc, "EXCP_DURING_INIT_SICJ0081", new Object[] { clientImpl, displayedException });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "initialiseAcceptListenerFactory");
} | java | public static void initialiseAcceptListenerFactory(AcceptListenerFactory _acceptListenerFactory)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "initialiseAcceptListenerFactory", _acceptListenerFactory);
Class clientImpl = instance.getClass();
Method initialiseAcceptListenerFactoryMethod;
try
{
initialiseAcceptListenerFactoryMethod = clientImpl.getMethod("initialiseAcceptListenerFactory", new Class[] { AcceptListenerFactory.class });
initialiseAcceptListenerFactoryMethod.invoke(clientImpl, new Object[] { _acceptListenerFactory });
} catch (Exception e)
{
FFDCFilter.processException(e, "com.ibm.ws.sib.jfapchannel.ServerConnectionManager.initialiseAcceptListenerFactory", JFapChannelConstants.SRVRCONNMGR_INITIALISE_ALF_01);
//Make sure we allow for the fact this could be an InvocationTargetException
Throwable displayedException = e;
if (e instanceof InvocationTargetException)
displayedException = e.getCause();
SibTr.error(tc, "EXCP_DURING_INIT_SICJ0081", new Object[] { clientImpl, displayedException });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "initialiseAcceptListenerFactory");
} | [
"public",
"static",
"void",
"initialiseAcceptListenerFactory",
"(",
"AcceptListenerFactory",
"_acceptListenerFactory",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"initialiseAcceptListenerFactory\"",
",",
"_acceptListenerFactory",
")",
";",
"Class",
"clientImpl",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"Method",
"initialiseAcceptListenerFactoryMethod",
";",
"try",
"{",
"initialiseAcceptListenerFactoryMethod",
"=",
"clientImpl",
".",
"getMethod",
"(",
"\"initialiseAcceptListenerFactory\"",
",",
"new",
"Class",
"[",
"]",
"{",
"AcceptListenerFactory",
".",
"class",
"}",
")",
";",
"initialiseAcceptListenerFactoryMethod",
".",
"invoke",
"(",
"clientImpl",
",",
"new",
"Object",
"[",
"]",
"{",
"_acceptListenerFactory",
"}",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.jfapchannel.ServerConnectionManager.initialiseAcceptListenerFactory\"",
",",
"JFapChannelConstants",
".",
"SRVRCONNMGR_INITIALISE_ALF_01",
")",
";",
"//Make sure we allow for the fact this could be an InvocationTargetException",
"Throwable",
"displayedException",
"=",
"e",
";",
"if",
"(",
"e",
"instanceof",
"InvocationTargetException",
")",
"displayedException",
"=",
"e",
".",
"getCause",
"(",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"EXCP_DURING_INIT_SICJ0081\"",
",",
"new",
"Object",
"[",
"]",
"{",
"clientImpl",
",",
"displayedException",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"initialiseAcceptListenerFactory\"",
")",
";",
"}"
] | Sets an AcceptListenerFactory on the full implementation of the ServerConnectionManager implementation.
@param _acceptListenerFactory | [
"Sets",
"an",
"AcceptListenerFactory",
"on",
"the",
"full",
"implementation",
"of",
"the",
"ServerConnectionManager",
"implementation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/jfapchannel/server/ServerConnectionManager.java#L120-L148 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java | WSCredentialProvider.setCredential | private void setCredential(Subject subject, WSPrincipal principal) throws CredentialException {
String securityName = principal.getName();
Hashtable<String, ?> customProperties = getUniqueIdHashtableFromSubject(subject);
if (customProperties == null || customProperties.isEmpty()) {
UserRegistryService urService = userRegistryServiceRef.getService();
if (urService != null) {
String urType = urService.getUserRegistryType();
if ("WIM".equalsIgnoreCase(urType) || "LDAP".equalsIgnoreCase(urType)) {
try {
securityName = urService.getUserRegistry().getUserDisplayName(securityName);
} catch (Exception e) {
//do nothing
}
}
}
}
if (securityName == null || securityName.length() == 0) {
securityName = principal.getName();
}
String accessId = principal.getAccessId();
String customRealm = null;
String realm = null;
String uniqueName = null;
if (customProperties != null) {
customRealm = (String) customProperties.get(AttributeNameConstants.WSCREDENTIAL_REALM);
}
if (customRealm != null) {
realm = customRealm;
String[] parts = accessId.split(realm + "/");
if (parts != null && parts.length == 2)
uniqueName = parts[1];
} else {
realm = AccessIdUtil.getRealm(accessId);
uniqueName = AccessIdUtil.getUniqueId(accessId);
}
if (AccessIdUtil.isServerAccessId(accessId)) {
// Create a server WSCredential
setCredential(null, subject, realm, securityName, uniqueName, null, accessId, null, null);
} else {
CredentialsService cs = credentialsServiceRef.getService();
String unauthenticatedUserid = cs.getUnauthenticatedUserid();
if (securityName != null && unauthenticatedUserid != null &&
securityName.equals(unauthenticatedUserid)) {
// Create an unauthenticated WSCredential
setCredential(unauthenticatedUserid, subject, realm, securityName, uniqueName, null, null, null, null);
} else if (AccessIdUtil.isUserAccessId(accessId)) {
// Create a user WSCredential
createUserWSCredential(subject, securityName, accessId, realm, uniqueName, unauthenticatedUserid);
}
}
} | java | private void setCredential(Subject subject, WSPrincipal principal) throws CredentialException {
String securityName = principal.getName();
Hashtable<String, ?> customProperties = getUniqueIdHashtableFromSubject(subject);
if (customProperties == null || customProperties.isEmpty()) {
UserRegistryService urService = userRegistryServiceRef.getService();
if (urService != null) {
String urType = urService.getUserRegistryType();
if ("WIM".equalsIgnoreCase(urType) || "LDAP".equalsIgnoreCase(urType)) {
try {
securityName = urService.getUserRegistry().getUserDisplayName(securityName);
} catch (Exception e) {
//do nothing
}
}
}
}
if (securityName == null || securityName.length() == 0) {
securityName = principal.getName();
}
String accessId = principal.getAccessId();
String customRealm = null;
String realm = null;
String uniqueName = null;
if (customProperties != null) {
customRealm = (String) customProperties.get(AttributeNameConstants.WSCREDENTIAL_REALM);
}
if (customRealm != null) {
realm = customRealm;
String[] parts = accessId.split(realm + "/");
if (parts != null && parts.length == 2)
uniqueName = parts[1];
} else {
realm = AccessIdUtil.getRealm(accessId);
uniqueName = AccessIdUtil.getUniqueId(accessId);
}
if (AccessIdUtil.isServerAccessId(accessId)) {
// Create a server WSCredential
setCredential(null, subject, realm, securityName, uniqueName, null, accessId, null, null);
} else {
CredentialsService cs = credentialsServiceRef.getService();
String unauthenticatedUserid = cs.getUnauthenticatedUserid();
if (securityName != null && unauthenticatedUserid != null &&
securityName.equals(unauthenticatedUserid)) {
// Create an unauthenticated WSCredential
setCredential(unauthenticatedUserid, subject, realm, securityName, uniqueName, null, null, null, null);
} else if (AccessIdUtil.isUserAccessId(accessId)) {
// Create a user WSCredential
createUserWSCredential(subject, securityName, accessId, realm, uniqueName, unauthenticatedUserid);
}
}
} | [
"private",
"void",
"setCredential",
"(",
"Subject",
"subject",
",",
"WSPrincipal",
"principal",
")",
"throws",
"CredentialException",
"{",
"String",
"securityName",
"=",
"principal",
".",
"getName",
"(",
")",
";",
"Hashtable",
"<",
"String",
",",
"?",
">",
"customProperties",
"=",
"getUniqueIdHashtableFromSubject",
"(",
"subject",
")",
";",
"if",
"(",
"customProperties",
"==",
"null",
"||",
"customProperties",
".",
"isEmpty",
"(",
")",
")",
"{",
"UserRegistryService",
"urService",
"=",
"userRegistryServiceRef",
".",
"getService",
"(",
")",
";",
"if",
"(",
"urService",
"!=",
"null",
")",
"{",
"String",
"urType",
"=",
"urService",
".",
"getUserRegistryType",
"(",
")",
";",
"if",
"(",
"\"WIM\"",
".",
"equalsIgnoreCase",
"(",
"urType",
")",
"||",
"\"LDAP\"",
".",
"equalsIgnoreCase",
"(",
"urType",
")",
")",
"{",
"try",
"{",
"securityName",
"=",
"urService",
".",
"getUserRegistry",
"(",
")",
".",
"getUserDisplayName",
"(",
"securityName",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"//do nothing",
"}",
"}",
"}",
"}",
"if",
"(",
"securityName",
"==",
"null",
"||",
"securityName",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"securityName",
"=",
"principal",
".",
"getName",
"(",
")",
";",
"}",
"String",
"accessId",
"=",
"principal",
".",
"getAccessId",
"(",
")",
";",
"String",
"customRealm",
"=",
"null",
";",
"String",
"realm",
"=",
"null",
";",
"String",
"uniqueName",
"=",
"null",
";",
"if",
"(",
"customProperties",
"!=",
"null",
")",
"{",
"customRealm",
"=",
"(",
"String",
")",
"customProperties",
".",
"get",
"(",
"AttributeNameConstants",
".",
"WSCREDENTIAL_REALM",
")",
";",
"}",
"if",
"(",
"customRealm",
"!=",
"null",
")",
"{",
"realm",
"=",
"customRealm",
";",
"String",
"[",
"]",
"parts",
"=",
"accessId",
".",
"split",
"(",
"realm",
"+",
"\"/\"",
")",
";",
"if",
"(",
"parts",
"!=",
"null",
"&&",
"parts",
".",
"length",
"==",
"2",
")",
"uniqueName",
"=",
"parts",
"[",
"1",
"]",
";",
"}",
"else",
"{",
"realm",
"=",
"AccessIdUtil",
".",
"getRealm",
"(",
"accessId",
")",
";",
"uniqueName",
"=",
"AccessIdUtil",
".",
"getUniqueId",
"(",
"accessId",
")",
";",
"}",
"if",
"(",
"AccessIdUtil",
".",
"isServerAccessId",
"(",
"accessId",
")",
")",
"{",
"// Create a server WSCredential",
"setCredential",
"(",
"null",
",",
"subject",
",",
"realm",
",",
"securityName",
",",
"uniqueName",
",",
"null",
",",
"accessId",
",",
"null",
",",
"null",
")",
";",
"}",
"else",
"{",
"CredentialsService",
"cs",
"=",
"credentialsServiceRef",
".",
"getService",
"(",
")",
";",
"String",
"unauthenticatedUserid",
"=",
"cs",
".",
"getUnauthenticatedUserid",
"(",
")",
";",
"if",
"(",
"securityName",
"!=",
"null",
"&&",
"unauthenticatedUserid",
"!=",
"null",
"&&",
"securityName",
".",
"equals",
"(",
"unauthenticatedUserid",
")",
")",
"{",
"// Create an unauthenticated WSCredential",
"setCredential",
"(",
"unauthenticatedUserid",
",",
"subject",
",",
"realm",
",",
"securityName",
",",
"uniqueName",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}",
"else",
"if",
"(",
"AccessIdUtil",
".",
"isUserAccessId",
"(",
"accessId",
")",
")",
"{",
"// Create a user WSCredential",
"createUserWSCredential",
"(",
"subject",
",",
"securityName",
",",
"accessId",
",",
"realm",
",",
"uniqueName",
",",
"unauthenticatedUserid",
")",
";",
"}",
"}",
"}"
] | Create a WSCredential for the specified accessId.
If this accessId came from the current UserRegistry, create a WsCredential.
If not, then do nothing.
@throws CredentialException | [
"Create",
"a",
"WSCredential",
"for",
"the",
"specified",
"accessId",
".",
"If",
"this",
"accessId",
"came",
"from",
"the",
"current",
"UserRegistry",
"create",
"a",
"WsCredential",
".",
"If",
"not",
"then",
"do",
"nothing",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java#L125-L179 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java | WSCredentialProvider.getUniqueGroupAccessIds | private List<String> getUniqueGroupAccessIds(UserRegistry userRegistry,
String realm, String uniqueName) throws EntryNotFoundException, RegistryException {
List<String> uniqueGroupAccessIds = new ArrayList<String>();
List<String> uniqueGroupIds = userRegistry.getUniqueGroupIdsForUser(uniqueName);
Iterator<String> groupIter = uniqueGroupIds.iterator();
while (groupIter.hasNext()) {
String groupAccessId = AccessIdUtil.createAccessId(AccessIdUtil.TYPE_GROUP, realm, groupIter.next());
uniqueGroupAccessIds.add(groupAccessId);
}
return uniqueGroupAccessIds;
} | java | private List<String> getUniqueGroupAccessIds(UserRegistry userRegistry,
String realm, String uniqueName) throws EntryNotFoundException, RegistryException {
List<String> uniqueGroupAccessIds = new ArrayList<String>();
List<String> uniqueGroupIds = userRegistry.getUniqueGroupIdsForUser(uniqueName);
Iterator<String> groupIter = uniqueGroupIds.iterator();
while (groupIter.hasNext()) {
String groupAccessId = AccessIdUtil.createAccessId(AccessIdUtil.TYPE_GROUP, realm, groupIter.next());
uniqueGroupAccessIds.add(groupAccessId);
}
return uniqueGroupAccessIds;
} | [
"private",
"List",
"<",
"String",
">",
"getUniqueGroupAccessIds",
"(",
"UserRegistry",
"userRegistry",
",",
"String",
"realm",
",",
"String",
"uniqueName",
")",
"throws",
"EntryNotFoundException",
",",
"RegistryException",
"{",
"List",
"<",
"String",
">",
"uniqueGroupAccessIds",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"List",
"<",
"String",
">",
"uniqueGroupIds",
"=",
"userRegistry",
".",
"getUniqueGroupIdsForUser",
"(",
"uniqueName",
")",
";",
"Iterator",
"<",
"String",
">",
"groupIter",
"=",
"uniqueGroupIds",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"groupIter",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"groupAccessId",
"=",
"AccessIdUtil",
".",
"createAccessId",
"(",
"AccessIdUtil",
".",
"TYPE_GROUP",
",",
"realm",
",",
"groupIter",
".",
"next",
"(",
")",
")",
";",
"uniqueGroupAccessIds",
".",
"add",
"(",
"groupAccessId",
")",
";",
"}",
"return",
"uniqueGroupAccessIds",
";",
"}"
] | Get a list of all of the groups the user belongs to, formated as
group access IDs.
@param userRegistry
@param realm
@param uniqueName
@return A list of all of the uniqueGroupAccessIds the user belongs to
@throws EntryNotFoundException
@throws RegistryException | [
"Get",
"a",
"list",
"of",
"all",
"of",
"the",
"groups",
"the",
"user",
"belongs",
"to",
"formated",
"as",
"group",
"access",
"IDs",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java#L253-L263 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java | WSCredentialProvider.getPrimaryGroupId | private String getPrimaryGroupId(List<String> uniqueGroupIds) {
return uniqueGroupIds.isEmpty() ? null : uniqueGroupIds.get(0);
} | java | private String getPrimaryGroupId(List<String> uniqueGroupIds) {
return uniqueGroupIds.isEmpty() ? null : uniqueGroupIds.get(0);
} | [
"private",
"String",
"getPrimaryGroupId",
"(",
"List",
"<",
"String",
">",
"uniqueGroupIds",
")",
"{",
"return",
"uniqueGroupIds",
".",
"isEmpty",
"(",
")",
"?",
"null",
":",
"uniqueGroupIds",
".",
"get",
"(",
"0",
")",
";",
"}"
] | Get the primary group ID. This is assumed to be the first group in the
group list.
@param uniqueGroupIds
@return The first entry of the list | [
"Get",
"the",
"primary",
"group",
"ID",
".",
"This",
"is",
"assumed",
"to",
"be",
"the",
"first",
"group",
"in",
"the",
"group",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java#L272-L274 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java | WSCredentialProvider.isSubjectValid | @Override
@FFDCIgnore({ CredentialDestroyedException.class, CredentialExpiredException.class })
public boolean isSubjectValid(Subject subject) {
boolean valid = false;
try {
WSCredential wsCredential = getWSCredential(subject);
if (wsCredential != null) {
long credentialExpirationInMillis = wsCredential.getExpiration();
Date currentTime = new Date();
Date expirationTime = new Date(credentialExpirationInMillis);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Current time = " + currentTime + ", expiration time = " + expirationTime);
}
if (credentialExpirationInMillis == 0 || credentialExpirationInMillis == -1 ||
currentTime.before(expirationTime)) {
valid = true;
}
}
} catch (CredentialDestroyedException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "CredentialDestroyedException while determining the validity of the subject.", e);
}
} catch (CredentialExpiredException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "CredentialExpiredException while determining the validity of the subject.", e);
}
}
return valid;
} | java | @Override
@FFDCIgnore({ CredentialDestroyedException.class, CredentialExpiredException.class })
public boolean isSubjectValid(Subject subject) {
boolean valid = false;
try {
WSCredential wsCredential = getWSCredential(subject);
if (wsCredential != null) {
long credentialExpirationInMillis = wsCredential.getExpiration();
Date currentTime = new Date();
Date expirationTime = new Date(credentialExpirationInMillis);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Current time = " + currentTime + ", expiration time = " + expirationTime);
}
if (credentialExpirationInMillis == 0 || credentialExpirationInMillis == -1 ||
currentTime.before(expirationTime)) {
valid = true;
}
}
} catch (CredentialDestroyedException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "CredentialDestroyedException while determining the validity of the subject.", e);
}
} catch (CredentialExpiredException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "CredentialExpiredException while determining the validity of the subject.", e);
}
}
return valid;
} | [
"@",
"Override",
"@",
"FFDCIgnore",
"(",
"{",
"CredentialDestroyedException",
".",
"class",
",",
"CredentialExpiredException",
".",
"class",
"}",
")",
"public",
"boolean",
"isSubjectValid",
"(",
"Subject",
"subject",
")",
"{",
"boolean",
"valid",
"=",
"false",
";",
"try",
"{",
"WSCredential",
"wsCredential",
"=",
"getWSCredential",
"(",
"subject",
")",
";",
"if",
"(",
"wsCredential",
"!=",
"null",
")",
"{",
"long",
"credentialExpirationInMillis",
"=",
"wsCredential",
".",
"getExpiration",
"(",
")",
";",
"Date",
"currentTime",
"=",
"new",
"Date",
"(",
")",
";",
"Date",
"expirationTime",
"=",
"new",
"Date",
"(",
"credentialExpirationInMillis",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Current time = \"",
"+",
"currentTime",
"+",
"\", expiration time = \"",
"+",
"expirationTime",
")",
";",
"}",
"if",
"(",
"credentialExpirationInMillis",
"==",
"0",
"||",
"credentialExpirationInMillis",
"==",
"-",
"1",
"||",
"currentTime",
".",
"before",
"(",
"expirationTime",
")",
")",
"{",
"valid",
"=",
"true",
";",
"}",
"}",
"}",
"catch",
"(",
"CredentialDestroyedException",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"CredentialDestroyedException while determining the validity of the subject.\"",
",",
"e",
")",
";",
"}",
"}",
"catch",
"(",
"CredentialExpiredException",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"CredentialExpiredException while determining the validity of the subject.\"",
",",
"e",
")",
";",
"}",
"}",
"return",
"valid",
";",
"}"
] | Checks if the subject is valid. Currently, a subject is REQUIRED to have
a WSCredential, and it is only valid if the WSCredential is not expired.
@param subject The subject to validate, {@code null} is not supported.
@return <code>true</code> if the subject is valid. | [
"Checks",
"if",
"the",
"subject",
"is",
"valid",
".",
"Currently",
"a",
"subject",
"is",
"REQUIRED",
"to",
"have",
"a",
"WSCredential",
"and",
"it",
"is",
"only",
"valid",
"if",
"the",
"WSCredential",
"is",
"not",
"expired",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.credentials.wscred/src/com/ibm/ws/security/credentials/wscred/internal/WSCredentialProvider.java#L329-L357 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnectionFactory.java | SibRaConnectionFactory.createConnection | private SibRaConnection createConnection(
ConnectionRequestInfo requestInfo)
throws SIResourceException,
SINotPossibleInCurrentConfigurationException,
SIIncorrectCallException, SIAuthenticationException {
if (TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "createConnection", requestInfo);
}
SibRaConnection result = null;
boolean tryAgain = true;
do {
try {
// Obtain connection via connection manager
final Object connection = _connectionManager.allocateConnection(
_managedConnectionFactory, requestInfo);
// Check it is one of ours
if (connection instanceof SibRaConnection) {
result = (SibRaConnection) connection;
SibRaManagedConnection managedConnection = result.getManagedConnection();
// Pass a reference to this connection factory as the
// connection needs access to the connection manager and
// managed connection factory to perform lazy enlistment and
// association
result.setConnectionFactory(this);
tryAgain = result.isCoreConnectionInValid();
if (tryAgain)
{
SibTr.info(TRACE, NLS.getString("CONNECTION_ERROR_RETRY_CWSIV0356"),
new Object[] {result.getManagedConnection().getConnectionException()});
// We need to try again so we clone and change the cri (incremenet counter) which
// forces j2c to create a new managed connection. Cloning is needed to prevent
// a broken connection in the shared pool being returned because it has a
// cri == this cri (PM31826)
requestInfo = (ConnectionRequestInfo)((SibRaConnectionRequestInfo)requestInfo).clone();
((SibRaConnectionRequestInfo)requestInfo).incrementRequestCounter();
// PK60857 the connection is broken so notify JCA to ensure it is cleaned up
managedConnection.connectionErrorOccurred(new SIResourceException(), true);
}
} else {
final ResourceException exception = new ResourceAdapterInternalException(
NLS.getFormattedMessage(
"INCORRECT_CONNECTION_TYPE_CWSIV0101",
new Object[] { connection,
SibRaConnection.class }, null));
if (TRACE.isEventEnabled()) {
SibTr.exception(this, TRACE, exception);
}
throw exception;
}
} catch (ResourceException exception) {
FFDCFilter
.processException(
exception,
"com.ibm.ws.sib.ra.impl.SibRaConnectionFactory.createConnection",
"1:318:1.21", this);
if (TRACE.isEventEnabled()) {
SibTr.exception(this, TRACE, exception);
}
if (exception.getCause() instanceof SIResourceException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIResourceException) exception.getCause();
} else if (exception.getCause() instanceof SIErrorException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIErrorException) exception.getCause();
} else if (exception.getCause() instanceof SINotPossibleInCurrentConfigurationException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SINotPossibleInCurrentConfigurationException) exception
.getCause();
} else if (exception.getCause() instanceof SIIncorrectCallException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIIncorrectCallException) exception.getCause();
} else if (exception.getCause() instanceof SIAuthenticationException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIAuthenticationException) exception.getCause();
} else {
// ...otherwise, wrap it in an SIResourceException
throw new SIResourceException(NLS
.getString("CONNECTION_FACTORY_EXCEPTION_CWSIV0050"),
exception);
}
}
} while (tryAgain);
if (TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, "createConnection", result);
}
return result;
} | java | private SibRaConnection createConnection(
ConnectionRequestInfo requestInfo)
throws SIResourceException,
SINotPossibleInCurrentConfigurationException,
SIIncorrectCallException, SIAuthenticationException {
if (TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "createConnection", requestInfo);
}
SibRaConnection result = null;
boolean tryAgain = true;
do {
try {
// Obtain connection via connection manager
final Object connection = _connectionManager.allocateConnection(
_managedConnectionFactory, requestInfo);
// Check it is one of ours
if (connection instanceof SibRaConnection) {
result = (SibRaConnection) connection;
SibRaManagedConnection managedConnection = result.getManagedConnection();
// Pass a reference to this connection factory as the
// connection needs access to the connection manager and
// managed connection factory to perform lazy enlistment and
// association
result.setConnectionFactory(this);
tryAgain = result.isCoreConnectionInValid();
if (tryAgain)
{
SibTr.info(TRACE, NLS.getString("CONNECTION_ERROR_RETRY_CWSIV0356"),
new Object[] {result.getManagedConnection().getConnectionException()});
// We need to try again so we clone and change the cri (incremenet counter) which
// forces j2c to create a new managed connection. Cloning is needed to prevent
// a broken connection in the shared pool being returned because it has a
// cri == this cri (PM31826)
requestInfo = (ConnectionRequestInfo)((SibRaConnectionRequestInfo)requestInfo).clone();
((SibRaConnectionRequestInfo)requestInfo).incrementRequestCounter();
// PK60857 the connection is broken so notify JCA to ensure it is cleaned up
managedConnection.connectionErrorOccurred(new SIResourceException(), true);
}
} else {
final ResourceException exception = new ResourceAdapterInternalException(
NLS.getFormattedMessage(
"INCORRECT_CONNECTION_TYPE_CWSIV0101",
new Object[] { connection,
SibRaConnection.class }, null));
if (TRACE.isEventEnabled()) {
SibTr.exception(this, TRACE, exception);
}
throw exception;
}
} catch (ResourceException exception) {
FFDCFilter
.processException(
exception,
"com.ibm.ws.sib.ra.impl.SibRaConnectionFactory.createConnection",
"1:318:1.21", this);
if (TRACE.isEventEnabled()) {
SibTr.exception(this, TRACE, exception);
}
if (exception.getCause() instanceof SIResourceException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIResourceException) exception.getCause();
} else if (exception.getCause() instanceof SIErrorException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIErrorException) exception.getCause();
} else if (exception.getCause() instanceof SINotPossibleInCurrentConfigurationException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SINotPossibleInCurrentConfigurationException) exception
.getCause();
} else if (exception.getCause() instanceof SIIncorrectCallException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIIncorrectCallException) exception.getCause();
} else if (exception.getCause() instanceof SIAuthenticationException) {
// If the original exception came from the underlying core SPI
// throw this back to the caller...
throw (SIAuthenticationException) exception.getCause();
} else {
// ...otherwise, wrap it in an SIResourceException
throw new SIResourceException(NLS
.getString("CONNECTION_FACTORY_EXCEPTION_CWSIV0050"),
exception);
}
}
} while (tryAgain);
if (TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, "createConnection", result);
}
return result;
} | [
"private",
"SibRaConnection",
"createConnection",
"(",
"ConnectionRequestInfo",
"requestInfo",
")",
"throws",
"SIResourceException",
",",
"SINotPossibleInCurrentConfigurationException",
",",
"SIIncorrectCallException",
",",
"SIAuthenticationException",
"{",
"if",
"(",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"TRACE",
",",
"\"createConnection\"",
",",
"requestInfo",
")",
";",
"}",
"SibRaConnection",
"result",
"=",
"null",
";",
"boolean",
"tryAgain",
"=",
"true",
";",
"do",
"{",
"try",
"{",
"// Obtain connection via connection manager",
"final",
"Object",
"connection",
"=",
"_connectionManager",
".",
"allocateConnection",
"(",
"_managedConnectionFactory",
",",
"requestInfo",
")",
";",
"// Check it is one of ours",
"if",
"(",
"connection",
"instanceof",
"SibRaConnection",
")",
"{",
"result",
"=",
"(",
"SibRaConnection",
")",
"connection",
";",
"SibRaManagedConnection",
"managedConnection",
"=",
"result",
".",
"getManagedConnection",
"(",
")",
";",
"// Pass a reference to this connection factory as the",
"// connection needs access to the connection manager and",
"// managed connection factory to perform lazy enlistment and",
"// association",
"result",
".",
"setConnectionFactory",
"(",
"this",
")",
";",
"tryAgain",
"=",
"result",
".",
"isCoreConnectionInValid",
"(",
")",
";",
"if",
"(",
"tryAgain",
")",
"{",
"SibTr",
".",
"info",
"(",
"TRACE",
",",
"NLS",
".",
"getString",
"(",
"\"CONNECTION_ERROR_RETRY_CWSIV0356\"",
")",
",",
"new",
"Object",
"[",
"]",
"{",
"result",
".",
"getManagedConnection",
"(",
")",
".",
"getConnectionException",
"(",
")",
"}",
")",
";",
"// We need to try again so we clone and change the cri (incremenet counter) which ",
"// forces j2c to create a new managed connection. Cloning is needed to prevent",
"// a broken connection in the shared pool being returned because it has a",
"// cri == this cri (PM31826)",
"requestInfo",
"=",
"(",
"ConnectionRequestInfo",
")",
"(",
"(",
"SibRaConnectionRequestInfo",
")",
"requestInfo",
")",
".",
"clone",
"(",
")",
";",
"(",
"(",
"SibRaConnectionRequestInfo",
")",
"requestInfo",
")",
".",
"incrementRequestCounter",
"(",
")",
";",
"// PK60857 the connection is broken so notify JCA to ensure it is cleaned up",
"managedConnection",
".",
"connectionErrorOccurred",
"(",
"new",
"SIResourceException",
"(",
")",
",",
"true",
")",
";",
"}",
"}",
"else",
"{",
"final",
"ResourceException",
"exception",
"=",
"new",
"ResourceAdapterInternalException",
"(",
"NLS",
".",
"getFormattedMessage",
"(",
"\"INCORRECT_CONNECTION_TYPE_CWSIV0101\"",
",",
"new",
"Object",
"[",
"]",
"{",
"connection",
",",
"SibRaConnection",
".",
"class",
"}",
",",
"null",
")",
")",
";",
"if",
"(",
"TRACE",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exception",
"(",
"this",
",",
"TRACE",
",",
"exception",
")",
";",
"}",
"throw",
"exception",
";",
"}",
"}",
"catch",
"(",
"ResourceException",
"exception",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"exception",
",",
"\"com.ibm.ws.sib.ra.impl.SibRaConnectionFactory.createConnection\"",
",",
"\"1:318:1.21\"",
",",
"this",
")",
";",
"if",
"(",
"TRACE",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exception",
"(",
"this",
",",
"TRACE",
",",
"exception",
")",
";",
"}",
"if",
"(",
"exception",
".",
"getCause",
"(",
")",
"instanceof",
"SIResourceException",
")",
"{",
"// If the original exception came from the underlying core SPI",
"// throw this back to the caller...",
"throw",
"(",
"SIResourceException",
")",
"exception",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"exception",
".",
"getCause",
"(",
")",
"instanceof",
"SIErrorException",
")",
"{",
"// If the original exception came from the underlying core SPI",
"// throw this back to the caller...",
"throw",
"(",
"SIErrorException",
")",
"exception",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"exception",
".",
"getCause",
"(",
")",
"instanceof",
"SINotPossibleInCurrentConfigurationException",
")",
"{",
"// If the original exception came from the underlying core SPI",
"// throw this back to the caller...",
"throw",
"(",
"SINotPossibleInCurrentConfigurationException",
")",
"exception",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"exception",
".",
"getCause",
"(",
")",
"instanceof",
"SIIncorrectCallException",
")",
"{",
"// If the original exception came from the underlying core SPI",
"// throw this back to the caller...",
"throw",
"(",
"SIIncorrectCallException",
")",
"exception",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"exception",
".",
"getCause",
"(",
")",
"instanceof",
"SIAuthenticationException",
")",
"{",
"// If the original exception came from the underlying core SPI",
"// throw this back to the caller...",
"throw",
"(",
"SIAuthenticationException",
")",
"exception",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"{",
"// ...otherwise, wrap it in an SIResourceException",
"throw",
"new",
"SIResourceException",
"(",
"NLS",
".",
"getString",
"(",
"\"CONNECTION_FACTORY_EXCEPTION_CWSIV0050\"",
")",
",",
"exception",
")",
";",
"}",
"}",
"}",
"while",
"(",
"tryAgain",
")",
";",
"if",
"(",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"this",
",",
"TRACE",
",",
"\"createConnection\"",
",",
"result",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Creates a connection via the connection manager.
@param requestInfo
the request information
@return the new connection
@throws SIResourceException
if an exception relating to the JCA processing occurs
@throws SINotPossibleInCurrentConfigurationException
if an exception occurs when delegating to the underlying core
SPI implementation
@throws SIIncorrectCallException
if an exception occurs when delegating to the underlying core
SPI implementation
@throws SIAuthenticationException
if an exception occurs when delegating to the underlying core
SPI implementation | [
"Creates",
"a",
"connection",
"via",
"the",
"connection",
"manager",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnectionFactory.java#L221-L344 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/writer/CompatibilityRepositoryExporter.java | CompatibilityRepositoryExporter.storeRecord | public void storeRecord(RepositoryLogRecord record) {
if (isClosed) {
throw new IllegalStateException("This instance of the exporter is already closed");
}
if (!isInitialized) {
throw new IllegalStateException("This instance of the exporter does not have header information yet");
}
String formatRecord = formatter.formatRecord(record);
out.print(formatRecord);
out.print(formatter.getLineSeparator());
} | java | public void storeRecord(RepositoryLogRecord record) {
if (isClosed) {
throw new IllegalStateException("This instance of the exporter is already closed");
}
if (!isInitialized) {
throw new IllegalStateException("This instance of the exporter does not have header information yet");
}
String formatRecord = formatter.formatRecord(record);
out.print(formatRecord);
out.print(formatter.getLineSeparator());
} | [
"public",
"void",
"storeRecord",
"(",
"RepositoryLogRecord",
"record",
")",
"{",
"if",
"(",
"isClosed",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"This instance of the exporter is already closed\"",
")",
";",
"}",
"if",
"(",
"!",
"isInitialized",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"This instance of the exporter does not have header information yet\"",
")",
";",
"}",
"String",
"formatRecord",
"=",
"formatter",
".",
"formatRecord",
"(",
"record",
")",
";",
"out",
".",
"print",
"(",
"formatRecord",
")",
";",
"out",
".",
"print",
"(",
"formatter",
".",
"getLineSeparator",
"(",
")",
")",
";",
"}"
] | Stores a RepositoryLogRecord into the proper text format
@param record RepositoryLogRecord which formatter will convert to Basic or Advanced output format | [
"Stores",
"a",
"RepositoryLogRecord",
"into",
"the",
"proper",
"text",
"format"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/writer/CompatibilityRepositoryExporter.java#L115-L125 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.acceptAnnotationsFrom | protected boolean acceptAnnotationsFrom(String className, boolean acceptPartial, boolean acceptExcluded) {
String methodName = "acceptAnnotationsFrom";
// Don't unnecessarily obtain the annotation targets table:
// No seed annotations will be obtained when the module is metadata-complete.
if (config.isMetadataComplete()) {
if (!acceptPartial && !acceptExcluded) {
return false;
}
}
try {
WebAnnotations webAppAnnotations = getModuleContainer().adapt(WebAnnotations.class);
AnnotationTargets_Targets table = webAppAnnotations.getAnnotationTargets();
return ( table.isSeedClassName(className) ||
(acceptPartial && table.isPartialClassName(className)) ||
(acceptExcluded && table.isExcludedClassName(className)) );
} catch (UnableToAdaptException e) {
logger.logp(Level.FINE, CLASS_NAME, methodName, "caught UnableToAdaptException: " + e);
return false;
}
} | java | protected boolean acceptAnnotationsFrom(String className, boolean acceptPartial, boolean acceptExcluded) {
String methodName = "acceptAnnotationsFrom";
// Don't unnecessarily obtain the annotation targets table:
// No seed annotations will be obtained when the module is metadata-complete.
if (config.isMetadataComplete()) {
if (!acceptPartial && !acceptExcluded) {
return false;
}
}
try {
WebAnnotations webAppAnnotations = getModuleContainer().adapt(WebAnnotations.class);
AnnotationTargets_Targets table = webAppAnnotations.getAnnotationTargets();
return ( table.isSeedClassName(className) ||
(acceptPartial && table.isPartialClassName(className)) ||
(acceptExcluded && table.isExcludedClassName(className)) );
} catch (UnableToAdaptException e) {
logger.logp(Level.FINE, CLASS_NAME, methodName, "caught UnableToAdaptException: " + e);
return false;
}
} | [
"protected",
"boolean",
"acceptAnnotationsFrom",
"(",
"String",
"className",
",",
"boolean",
"acceptPartial",
",",
"boolean",
"acceptExcluded",
")",
"{",
"String",
"methodName",
"=",
"\"acceptAnnotationsFrom\"",
";",
"// Don't unnecessarily obtain the annotation targets table:",
"// No seed annotations will be obtained when the module is metadata-complete.",
"if",
"(",
"config",
".",
"isMetadataComplete",
"(",
")",
")",
"{",
"if",
"(",
"!",
"acceptPartial",
"&&",
"!",
"acceptExcluded",
")",
"{",
"return",
"false",
";",
"}",
"}",
"try",
"{",
"WebAnnotations",
"webAppAnnotations",
"=",
"getModuleContainer",
"(",
")",
".",
"adapt",
"(",
"WebAnnotations",
".",
"class",
")",
";",
"AnnotationTargets_Targets",
"table",
"=",
"webAppAnnotations",
".",
"getAnnotationTargets",
"(",
")",
";",
"return",
"(",
"table",
".",
"isSeedClassName",
"(",
"className",
")",
"||",
"(",
"acceptPartial",
"&&",
"table",
".",
"isPartialClassName",
"(",
"className",
")",
")",
"||",
"(",
"acceptExcluded",
"&&",
"table",
".",
"isExcludedClassName",
"(",
"className",
")",
")",
")",
";",
"}",
"catch",
"(",
"UnableToAdaptException",
"e",
")",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"methodName",
",",
"\"caught UnableToAdaptException: \"",
"+",
"e",
")",
";",
"return",
"false",
";",
"}",
"}"
] | Tell if annotations on a target class are to be processed. This is
controlled by the metadata-complete and absolute ordering settings
of the web module.
Metadata complete may be set for the web-module as a whole, or may be set
individually on fragments. Annotations are ignored when the target class
is in a metadata complete region.
When an absolute ordering element is present in the web module descriptor,
jars not listed are excluded from annotation processing.
Control parameters are provided to allow testing for the several usage cases.
See {@link com.ibm.wsspi.anno.classsource.ClassSource_Aggregate} for detailed
documentation.
Caution: Extra testing is necessary for annotations on inherited methods.
An inherited methods have two associated classes: The class which defined
the method and the class which is using the method definition.
Caution: Extra testing is necessary for inheritable annotations. Normally,
class annotations apply only to the class which provides the annotation
definition. As a special case, a class annotation may be declared as being
inherited, in which case the annotation applies to all subclasses of the
class which has the annotation definition.
@param className The name of the class which is to be tested.
@param acceptPartial Control parameter: Tell if partial classes are accepted.
@param acceptExcluded Control parameter: Tell if excluded classes are accepted.
@return True if annotations are accepted from the class. Otherwise, false. | [
"Tell",
"if",
"annotations",
"on",
"a",
"target",
"class",
"are",
"to",
"be",
"processed",
".",
"This",
"is",
"controlled",
"by",
"the",
"metadata",
"-",
"complete",
"and",
"absolute",
"ordering",
"settings",
"of",
"the",
"web",
"module",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L754-L778 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.createSessionContext | protected void createSessionContext(DeployedModule moduleConfig) throws Throwable {
try {
// added sessionIdListeners for Servlet 3.1
ArrayList sessionRelatedListeners[] = new ArrayList[] { sessionListeners, sessionAttrListeners, sessionIdListeners }; // cmd
// PQ81253
this.sessionCtx = ((WebGroup) parent).getSessionContext(moduleConfig, this, sessionRelatedListeners); // cmd
// PQ81253
} catch (Throwable th) {
// pk435011
logger.logp(Level.SEVERE, CLASS_NAME, "createSessionContext", "error.obtaining.session.context", th);
throw new WebAppNotLoadedException(th.getMessage());
}
} | java | protected void createSessionContext(DeployedModule moduleConfig) throws Throwable {
try {
// added sessionIdListeners for Servlet 3.1
ArrayList sessionRelatedListeners[] = new ArrayList[] { sessionListeners, sessionAttrListeners, sessionIdListeners }; // cmd
// PQ81253
this.sessionCtx = ((WebGroup) parent).getSessionContext(moduleConfig, this, sessionRelatedListeners); // cmd
// PQ81253
} catch (Throwable th) {
// pk435011
logger.logp(Level.SEVERE, CLASS_NAME, "createSessionContext", "error.obtaining.session.context", th);
throw new WebAppNotLoadedException(th.getMessage());
}
} | [
"protected",
"void",
"createSessionContext",
"(",
"DeployedModule",
"moduleConfig",
")",
"throws",
"Throwable",
"{",
"try",
"{",
"// added sessionIdListeners for Servlet 3.1",
"ArrayList",
"sessionRelatedListeners",
"[",
"]",
"=",
"new",
"ArrayList",
"[",
"]",
"{",
"sessionListeners",
",",
"sessionAttrListeners",
",",
"sessionIdListeners",
"}",
";",
"// cmd",
"// PQ81253",
"this",
".",
"sessionCtx",
"=",
"(",
"(",
"WebGroup",
")",
"parent",
")",
".",
"getSessionContext",
"(",
"moduleConfig",
",",
"this",
",",
"sessionRelatedListeners",
")",
";",
"// cmd",
"// PQ81253",
"}",
"catch",
"(",
"Throwable",
"th",
")",
"{",
"// pk435011",
"logger",
".",
"logp",
"(",
"Level",
".",
"SEVERE",
",",
"CLASS_NAME",
",",
"\"createSessionContext\"",
",",
"\"error.obtaining.session.context\"",
",",
"th",
")",
";",
"throw",
"new",
"WebAppNotLoadedException",
"(",
"th",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}"
] | Method createSessionContext.
@param moduleConfig | [
"Method",
"createSessionContext",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L1256-L1269 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.initializeTargetMappings | protected void initializeTargetMappings() throws Exception {
// NOTE: namespace preinvoke/postinvoke not necessary as the only
// external
// code being run is the servlet's init() and that is handled in the
// ServletWrapper
// check if an extensionFactory is present for *.jsp:
// We do this by constructing an arbitrary mapping which
// will only match the *.xxx extension pattern
//
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.entering(CLASS_NAME, "initializeTargetMappings");
initializeStaticFileHandler();
initializeInvokerProcessor();
if (config.isDirectoryBrowsingEnabled()) {
try {
IServletWrapper dirServlet = getServletWrapper("DirectoryBrowsingServlet");
requestMapper.addMapping(DIR_BROWSING_MAPPING, dirServlet);
} catch (WebContainerException wce) {
// pk435011
logger.logp(Level.WARNING, CLASS_NAME, "initializeTargetMappings", "mapping.for.directorybrowsingservlet.already.exists");
} catch (Exception exc) {
// pk435011
logger.logp(Level.WARNING, CLASS_NAME, "initializeTargetMappings", "mapping.for.directorybrowsingservlet.already.exists");
}
}
} | java | protected void initializeTargetMappings() throws Exception {
// NOTE: namespace preinvoke/postinvoke not necessary as the only
// external
// code being run is the servlet's init() and that is handled in the
// ServletWrapper
// check if an extensionFactory is present for *.jsp:
// We do this by constructing an arbitrary mapping which
// will only match the *.xxx extension pattern
//
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.entering(CLASS_NAME, "initializeTargetMappings");
initializeStaticFileHandler();
initializeInvokerProcessor();
if (config.isDirectoryBrowsingEnabled()) {
try {
IServletWrapper dirServlet = getServletWrapper("DirectoryBrowsingServlet");
requestMapper.addMapping(DIR_BROWSING_MAPPING, dirServlet);
} catch (WebContainerException wce) {
// pk435011
logger.logp(Level.WARNING, CLASS_NAME, "initializeTargetMappings", "mapping.for.directorybrowsingservlet.already.exists");
} catch (Exception exc) {
// pk435011
logger.logp(Level.WARNING, CLASS_NAME, "initializeTargetMappings", "mapping.for.directorybrowsingservlet.already.exists");
}
}
} | [
"protected",
"void",
"initializeTargetMappings",
"(",
")",
"throws",
"Exception",
"{",
"// NOTE: namespace preinvoke/postinvoke not necessary as the only",
"// external",
"// code being run is the servlet's init() and that is handled in the",
"// ServletWrapper",
"// check if an extensionFactory is present for *.jsp:",
"// We do this by constructing an arbitrary mapping which",
"// will only match the *.xxx extension pattern",
"//",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"initializeTargetMappings\"",
")",
";",
"initializeStaticFileHandler",
"(",
")",
";",
"initializeInvokerProcessor",
"(",
")",
";",
"if",
"(",
"config",
".",
"isDirectoryBrowsingEnabled",
"(",
")",
")",
"{",
"try",
"{",
"IServletWrapper",
"dirServlet",
"=",
"getServletWrapper",
"(",
"\"DirectoryBrowsingServlet\"",
")",
";",
"requestMapper",
".",
"addMapping",
"(",
"DIR_BROWSING_MAPPING",
",",
"dirServlet",
")",
";",
"}",
"catch",
"(",
"WebContainerException",
"wce",
")",
"{",
"// pk435011",
"logger",
".",
"logp",
"(",
"Level",
".",
"WARNING",
",",
"CLASS_NAME",
",",
"\"initializeTargetMappings\"",
",",
"\"mapping.for.directorybrowsingservlet.already.exists\"",
")",
";",
"}",
"catch",
"(",
"Exception",
"exc",
")",
"{",
"// pk435011",
"logger",
".",
"logp",
"(",
"Level",
".",
"WARNING",
",",
"CLASS_NAME",
",",
"\"initializeTargetMappings\"",
",",
"\"mapping.for.directorybrowsingservlet.already.exists\"",
")",
";",
"}",
"}",
"}"
] | Method initializeTargetMappings. | [
"Method",
"initializeTargetMappings",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L1286-L1317 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.initializeNonDDRepresentableAnnotation | private void initializeNonDDRepresentableAnnotation(IServletConfig servletConfig) {
if (com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping())
return;
String methodName = "initializeNonDDRepresentableAnnotation";
String configClassName = servletConfig.getClassName();
if (configClassName == null) {
return; // Strange; but impossible to process; ignore.
}
if (!acceptAnnotationsFrom(configClassName, DO_NOT_ACCEPT_PARTIAL, DO_NOT_ACCEPT_EXCLUDED)) {
return; // Ignore: In a metadata-complete or excluded region.
}
// Process: In a non-metadata-complete, non-excluded region.
Class<?> configClass;
try {
configClass = Class.forName(configClassName, false, this.getClassLoader());
} catch (ClassNotFoundException e) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
LoggingUtil.logParamsAndException(logger, Level.FINE, CLASS_NAME, methodName,
"unable to load class [{0}] which is benign if the class is never used",
new Object[] { configClassName }, e);
}
return;
} catch (NoClassDefFoundError e) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
LoggingUtil.logParamsAndException(logger, Level.FINE, CLASS_NAME, methodName,
"unable to load class [{0}] which is benign if the class is never used",
new Object[] { configClassName }, e);
}
return;
}
checkForServletSecurityAnnotation(configClass, servletConfig);
} | java | private void initializeNonDDRepresentableAnnotation(IServletConfig servletConfig) {
if (com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping())
return;
String methodName = "initializeNonDDRepresentableAnnotation";
String configClassName = servletConfig.getClassName();
if (configClassName == null) {
return; // Strange; but impossible to process; ignore.
}
if (!acceptAnnotationsFrom(configClassName, DO_NOT_ACCEPT_PARTIAL, DO_NOT_ACCEPT_EXCLUDED)) {
return; // Ignore: In a metadata-complete or excluded region.
}
// Process: In a non-metadata-complete, non-excluded region.
Class<?> configClass;
try {
configClass = Class.forName(configClassName, false, this.getClassLoader());
} catch (ClassNotFoundException e) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
LoggingUtil.logParamsAndException(logger, Level.FINE, CLASS_NAME, methodName,
"unable to load class [{0}] which is benign if the class is never used",
new Object[] { configClassName }, e);
}
return;
} catch (NoClassDefFoundError e) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
LoggingUtil.logParamsAndException(logger, Level.FINE, CLASS_NAME, methodName,
"unable to load class [{0}] which is benign if the class is never used",
new Object[] { configClassName }, e);
}
return;
}
checkForServletSecurityAnnotation(configClass, servletConfig);
} | [
"private",
"void",
"initializeNonDDRepresentableAnnotation",
"(",
"IServletConfig",
"servletConfig",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"webcontainer",
".",
"osgi",
".",
"WebContainer",
".",
"isServerStopping",
"(",
")",
")",
"return",
";",
"String",
"methodName",
"=",
"\"initializeNonDDRepresentableAnnotation\"",
";",
"String",
"configClassName",
"=",
"servletConfig",
".",
"getClassName",
"(",
")",
";",
"if",
"(",
"configClassName",
"==",
"null",
")",
"{",
"return",
";",
"// Strange; but impossible to process; ignore.",
"}",
"if",
"(",
"!",
"acceptAnnotationsFrom",
"(",
"configClassName",
",",
"DO_NOT_ACCEPT_PARTIAL",
",",
"DO_NOT_ACCEPT_EXCLUDED",
")",
")",
"{",
"return",
";",
"// Ignore: In a metadata-complete or excluded region.",
"}",
"// Process: In a non-metadata-complete, non-excluded region.",
"Class",
"<",
"?",
">",
"configClass",
";",
"try",
"{",
"configClass",
"=",
"Class",
".",
"forName",
"(",
"configClassName",
",",
"false",
",",
"this",
".",
"getClassLoader",
"(",
")",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"LoggingUtil",
".",
"logParamsAndException",
"(",
"logger",
",",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"methodName",
",",
"\"unable to load class [{0}] which is benign if the class is never used\"",
",",
"new",
"Object",
"[",
"]",
"{",
"configClassName",
"}",
",",
"e",
")",
";",
"}",
"return",
";",
"}",
"catch",
"(",
"NoClassDefFoundError",
"e",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"LoggingUtil",
".",
"logParamsAndException",
"(",
"logger",
",",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"methodName",
",",
"\"unable to load class [{0}] which is benign if the class is never used\"",
",",
"new",
"Object",
"[",
"]",
"{",
"configClassName",
"}",
",",
"e",
")",
";",
"}",
"return",
";",
"}",
"checkForServletSecurityAnnotation",
"(",
"configClass",
",",
"servletConfig",
")",
";",
"}"
] | Process any annotation which could not be managed by an update
to the the descriptor based configuration.
@param servletConfig The servlet configuration embedding a class
which is to be processed for annotations. | [
"Process",
"any",
"annotation",
"which",
"could",
"not",
"be",
"managed",
"by",
"an",
"update",
"to",
"the",
"the",
"descriptor",
"based",
"configuration",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L1510-L1549 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.addStaticFilePatternMappings | @FFDCIgnore(Exception.class)
protected void addStaticFilePatternMappings(RequestProcessor proxyReqProcessor) {
String nextPattern;
ExtensionProcessor fileExtensionProcessor = getDefaultExtensionProcessor(this, getConfiguration().getFileServingAttributes());
List patternList = fileExtensionProcessor.getPatternList();
Iterator patternIter = patternList.iterator();
int globalPatternsCount = 0;
while (patternIter.hasNext()) {
nextPattern = (String) patternIter.next(); // PK18713
try {
if (proxyReqProcessor == null)
requestMapper.addMapping(nextPattern, fileExtensionProcessor); // PK18713
else
requestMapper.addMapping(nextPattern, proxyReqProcessor);
} catch (Exception e) {
// Mapping clash. Log error
// pk435011
// LIBERTY: Fix for RTC defect 49695 -- The logging level should match the severity of the message.
if (!!!"/*".equals(nextPattern)) {
logger.logp(Level.SEVERE, CLASS_NAME, "initializeStaticFileHandler", "error.adding.servlet.mapping.file.handler", nextPattern);
} else {
globalPatternsCount++;
}
}
}
if (globalPatternsCount > 1) {
logger.logp(Level.SEVERE, CLASS_NAME, "initializeStaticFileHandler", "error.adding.servlet.mapping.file.handler", "/*");
}
} | java | @FFDCIgnore(Exception.class)
protected void addStaticFilePatternMappings(RequestProcessor proxyReqProcessor) {
String nextPattern;
ExtensionProcessor fileExtensionProcessor = getDefaultExtensionProcessor(this, getConfiguration().getFileServingAttributes());
List patternList = fileExtensionProcessor.getPatternList();
Iterator patternIter = patternList.iterator();
int globalPatternsCount = 0;
while (patternIter.hasNext()) {
nextPattern = (String) patternIter.next(); // PK18713
try {
if (proxyReqProcessor == null)
requestMapper.addMapping(nextPattern, fileExtensionProcessor); // PK18713
else
requestMapper.addMapping(nextPattern, proxyReqProcessor);
} catch (Exception e) {
// Mapping clash. Log error
// pk435011
// LIBERTY: Fix for RTC defect 49695 -- The logging level should match the severity of the message.
if (!!!"/*".equals(nextPattern)) {
logger.logp(Level.SEVERE, CLASS_NAME, "initializeStaticFileHandler", "error.adding.servlet.mapping.file.handler", nextPattern);
} else {
globalPatternsCount++;
}
}
}
if (globalPatternsCount > 1) {
logger.logp(Level.SEVERE, CLASS_NAME, "initializeStaticFileHandler", "error.adding.servlet.mapping.file.handler", "/*");
}
} | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"protected",
"void",
"addStaticFilePatternMappings",
"(",
"RequestProcessor",
"proxyReqProcessor",
")",
"{",
"String",
"nextPattern",
";",
"ExtensionProcessor",
"fileExtensionProcessor",
"=",
"getDefaultExtensionProcessor",
"(",
"this",
",",
"getConfiguration",
"(",
")",
".",
"getFileServingAttributes",
"(",
")",
")",
";",
"List",
"patternList",
"=",
"fileExtensionProcessor",
".",
"getPatternList",
"(",
")",
";",
"Iterator",
"patternIter",
"=",
"patternList",
".",
"iterator",
"(",
")",
";",
"int",
"globalPatternsCount",
"=",
"0",
";",
"while",
"(",
"patternIter",
".",
"hasNext",
"(",
")",
")",
"{",
"nextPattern",
"=",
"(",
"String",
")",
"patternIter",
".",
"next",
"(",
")",
";",
"// PK18713",
"try",
"{",
"if",
"(",
"proxyReqProcessor",
"==",
"null",
")",
"requestMapper",
".",
"addMapping",
"(",
"nextPattern",
",",
"fileExtensionProcessor",
")",
";",
"// PK18713",
"else",
"requestMapper",
".",
"addMapping",
"(",
"nextPattern",
",",
"proxyReqProcessor",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// Mapping clash. Log error",
"// pk435011",
"// LIBERTY: Fix for RTC defect 49695 -- The logging level should match the severity of the message.",
"if",
"(",
"!",
"!",
"!",
"\"/*\"",
".",
"equals",
"(",
"nextPattern",
")",
")",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"SEVERE",
",",
"CLASS_NAME",
",",
"\"initializeStaticFileHandler\"",
",",
"\"error.adding.servlet.mapping.file.handler\"",
",",
"nextPattern",
")",
";",
"}",
"else",
"{",
"globalPatternsCount",
"++",
";",
"}",
"}",
"}",
"if",
"(",
"globalPatternsCount",
">",
"1",
")",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"SEVERE",
",",
"CLASS_NAME",
",",
"\"initializeStaticFileHandler\"",
",",
"\"error.adding.servlet.mapping.file.handler\"",
",",
"\"/*\"",
")",
";",
"}",
"}"
] | defect 39851 needs to stop the exception from always being thrown | [
"defect",
"39851",
"needs",
"to",
"stop",
"the",
"exception",
"from",
"always",
"being",
"thrown"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L1592-L1622 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.getServletWrapper | public IServletWrapper getServletWrapper(String servletName, boolean addMapping) throws Exception // PK61140
{
IServletWrapper targetWrapper = null;
IServletConfig sconfig = config.getServletInfo(servletName);
if (sconfig != null) {
IServletWrapper existingServletWrapper = sconfig.getServletWrapper();
if (existingServletWrapper != null)
return existingServletWrapper;
}
// Retrieve the list of mappings associated with 'servletName'
List<String> mappings = config.getServletMappings(servletName);
if (mappings != null) {
for (String mapping : mappings) {
if (mapping.length() > 0 && mapping.charAt(0) != '/' && mapping.charAt(0) != '*')
mapping = '/' + mapping;
RequestProcessor p = requestMapper.map(mapping);
if (p != null) {
if (p instanceof IServletWrapper) {
if (((IServletWrapper) p).getServletName().equals(servletName)) {
targetWrapper = (IServletWrapper) p;
break;
}
}
}
}
}
if (targetWrapper != null)
return targetWrapper;
// Begin 650884
// PK61140 - Starts
// String path = BY_NAME_ONLY + servletName;
// RequestProcessor p = requestMapper.map(path);
// // RequestProcessor p = requestMapper.map(BY_NAME_ONLY + servletName);
//
// // PK61140 - Ends
//
//
// if (p != null)
// if (p instanceof ServletWrapper) {
// if (((ServletWrapper) p).getServletName().equals(servletName))
// targetWrapper = (ServletWrapper) p;
// }
//
// if (targetWrapper != null)
// return targetWrapper;
// End 650884
if (sconfig == null) {
int internalIndex;
if ((internalIndex = getInternalServletIndex(servletName)) >= 0) {
sconfig = loadInternalConfig(servletName, internalIndex);
} else {
// Not found in DD, and not an Internal Servlet, stray??
//
return null;
}
}
// return webExtensionProcessor.createServletWrapper(sconfig); //
// PK61140
// PK61140 - Starts
IServletWrapper sw = webExtensionProcessor.createServletWrapper(sconfig);
// Begin 650884
// if ((sw != null)) {
// if (addMapping) {
// synchronized (sconfig) {
// if (!requestMapper.exists(path)) {
// requestMapper.addMapping(path, sw);
// }
// }
// }
// }
// End 650884
return sw;
// PK61140 - Ends
} | java | public IServletWrapper getServletWrapper(String servletName, boolean addMapping) throws Exception // PK61140
{
IServletWrapper targetWrapper = null;
IServletConfig sconfig = config.getServletInfo(servletName);
if (sconfig != null) {
IServletWrapper existingServletWrapper = sconfig.getServletWrapper();
if (existingServletWrapper != null)
return existingServletWrapper;
}
// Retrieve the list of mappings associated with 'servletName'
List<String> mappings = config.getServletMappings(servletName);
if (mappings != null) {
for (String mapping : mappings) {
if (mapping.length() > 0 && mapping.charAt(0) != '/' && mapping.charAt(0) != '*')
mapping = '/' + mapping;
RequestProcessor p = requestMapper.map(mapping);
if (p != null) {
if (p instanceof IServletWrapper) {
if (((IServletWrapper) p).getServletName().equals(servletName)) {
targetWrapper = (IServletWrapper) p;
break;
}
}
}
}
}
if (targetWrapper != null)
return targetWrapper;
// Begin 650884
// PK61140 - Starts
// String path = BY_NAME_ONLY + servletName;
// RequestProcessor p = requestMapper.map(path);
// // RequestProcessor p = requestMapper.map(BY_NAME_ONLY + servletName);
//
// // PK61140 - Ends
//
//
// if (p != null)
// if (p instanceof ServletWrapper) {
// if (((ServletWrapper) p).getServletName().equals(servletName))
// targetWrapper = (ServletWrapper) p;
// }
//
// if (targetWrapper != null)
// return targetWrapper;
// End 650884
if (sconfig == null) {
int internalIndex;
if ((internalIndex = getInternalServletIndex(servletName)) >= 0) {
sconfig = loadInternalConfig(servletName, internalIndex);
} else {
// Not found in DD, and not an Internal Servlet, stray??
//
return null;
}
}
// return webExtensionProcessor.createServletWrapper(sconfig); //
// PK61140
// PK61140 - Starts
IServletWrapper sw = webExtensionProcessor.createServletWrapper(sconfig);
// Begin 650884
// if ((sw != null)) {
// if (addMapping) {
// synchronized (sconfig) {
// if (!requestMapper.exists(path)) {
// requestMapper.addMapping(path, sw);
// }
// }
// }
// }
// End 650884
return sw;
// PK61140 - Ends
} | [
"public",
"IServletWrapper",
"getServletWrapper",
"(",
"String",
"servletName",
",",
"boolean",
"addMapping",
")",
"throws",
"Exception",
"// PK61140",
"{",
"IServletWrapper",
"targetWrapper",
"=",
"null",
";",
"IServletConfig",
"sconfig",
"=",
"config",
".",
"getServletInfo",
"(",
"servletName",
")",
";",
"if",
"(",
"sconfig",
"!=",
"null",
")",
"{",
"IServletWrapper",
"existingServletWrapper",
"=",
"sconfig",
".",
"getServletWrapper",
"(",
")",
";",
"if",
"(",
"existingServletWrapper",
"!=",
"null",
")",
"return",
"existingServletWrapper",
";",
"}",
"// Retrieve the list of mappings associated with 'servletName'",
"List",
"<",
"String",
">",
"mappings",
"=",
"config",
".",
"getServletMappings",
"(",
"servletName",
")",
";",
"if",
"(",
"mappings",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"mapping",
":",
"mappings",
")",
"{",
"if",
"(",
"mapping",
".",
"length",
"(",
")",
">",
"0",
"&&",
"mapping",
".",
"charAt",
"(",
"0",
")",
"!=",
"'",
"'",
"&&",
"mapping",
".",
"charAt",
"(",
"0",
")",
"!=",
"'",
"'",
")",
"mapping",
"=",
"'",
"'",
"+",
"mapping",
";",
"RequestProcessor",
"p",
"=",
"requestMapper",
".",
"map",
"(",
"mapping",
")",
";",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"if",
"(",
"p",
"instanceof",
"IServletWrapper",
")",
"{",
"if",
"(",
"(",
"(",
"IServletWrapper",
")",
"p",
")",
".",
"getServletName",
"(",
")",
".",
"equals",
"(",
"servletName",
")",
")",
"{",
"targetWrapper",
"=",
"(",
"IServletWrapper",
")",
"p",
";",
"break",
";",
"}",
"}",
"}",
"}",
"}",
"if",
"(",
"targetWrapper",
"!=",
"null",
")",
"return",
"targetWrapper",
";",
"// Begin 650884",
"// PK61140 - Starts",
"// String path = BY_NAME_ONLY + servletName;",
"// RequestProcessor p = requestMapper.map(path);",
"// // RequestProcessor p = requestMapper.map(BY_NAME_ONLY + servletName);",
"//",
"// // PK61140 - Ends",
"// ",
"//",
"// if (p != null)",
"// if (p instanceof ServletWrapper) {",
"// if (((ServletWrapper) p).getServletName().equals(servletName))",
"// targetWrapper = (ServletWrapper) p;",
"// }",
"//",
"// if (targetWrapper != null)",
"// return targetWrapper;",
"// End 650884",
"if",
"(",
"sconfig",
"==",
"null",
")",
"{",
"int",
"internalIndex",
";",
"if",
"(",
"(",
"internalIndex",
"=",
"getInternalServletIndex",
"(",
"servletName",
")",
")",
">=",
"0",
")",
"{",
"sconfig",
"=",
"loadInternalConfig",
"(",
"servletName",
",",
"internalIndex",
")",
";",
"}",
"else",
"{",
"// Not found in DD, and not an Internal Servlet, stray??",
"//",
"return",
"null",
";",
"}",
"}",
"// return webExtensionProcessor.createServletWrapper(sconfig); //",
"// PK61140",
"// PK61140 - Starts",
"IServletWrapper",
"sw",
"=",
"webExtensionProcessor",
".",
"createServletWrapper",
"(",
"sconfig",
")",
";",
"// Begin 650884",
"// if ((sw != null)) {",
"// if (addMapping) {",
"// synchronized (sconfig) {",
"// if (!requestMapper.exists(path)) {",
"// requestMapper.addMapping(path, sw);",
"// }",
"// }",
"// }",
"// }",
"// End 650884",
"return",
"sw",
";",
"// PK61140 - Ends",
"}"
] | Method getServletWrapper.
@param string
@return Object | [
"Method",
"getServletWrapper",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L1722-L1804 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.loadInternalConfig | private ServletConfig loadInternalConfig(String servletName, int internalIndex) throws ServletException {
ServletConfig sconfig = createConfig("InternalServlet_" + servletName, internalIndex);
sconfig.setServletName(servletName);
sconfig.setDisplayName(servletName);
sconfig.setServletContext(this.getFacade());
sconfig.setIsJsp(false);
sconfig.setClassName(internalServletList[internalIndex][1]);
return sconfig;
} | java | private ServletConfig loadInternalConfig(String servletName, int internalIndex) throws ServletException {
ServletConfig sconfig = createConfig("InternalServlet_" + servletName, internalIndex);
sconfig.setServletName(servletName);
sconfig.setDisplayName(servletName);
sconfig.setServletContext(this.getFacade());
sconfig.setIsJsp(false);
sconfig.setClassName(internalServletList[internalIndex][1]);
return sconfig;
} | [
"private",
"ServletConfig",
"loadInternalConfig",
"(",
"String",
"servletName",
",",
"int",
"internalIndex",
")",
"throws",
"ServletException",
"{",
"ServletConfig",
"sconfig",
"=",
"createConfig",
"(",
"\"InternalServlet_\"",
"+",
"servletName",
",",
"internalIndex",
")",
";",
"sconfig",
".",
"setServletName",
"(",
"servletName",
")",
";",
"sconfig",
".",
"setDisplayName",
"(",
"servletName",
")",
";",
"sconfig",
".",
"setServletContext",
"(",
"this",
".",
"getFacade",
"(",
")",
")",
";",
"sconfig",
".",
"setIsJsp",
"(",
"false",
")",
";",
"sconfig",
".",
"setClassName",
"(",
"internalServletList",
"[",
"internalIndex",
"]",
"[",
"1",
"]",
")",
";",
"return",
"sconfig",
";",
"}"
] | Method loadInternalConfig.
@param servletName | [
"Method",
"loadInternalConfig",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L1974-L1984 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.loadListener | protected Object loadListener(String lClassName) throws InjectionException, Throwable //596191 :: PK97815
{
Object listener = null;
try {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.logp(Level.FINE, CLASS_NAME, "loadListener", "loadListener Classloader " + getClassLoader());
// PK16542 end
// instantiate the listener
listener = java.beans.Beans.instantiate(getClassLoader(), lClassName);
} catch (Throwable th) {
// some exception, log error.
logError("Failed to load listener: " + lClassName, th);
if (WCCustomProperties.STOP_APP_STARTUP_ON_LISTENER_EXCEPTION) { //PI58875
throw th;
}
}
return listener;
} | java | protected Object loadListener(String lClassName) throws InjectionException, Throwable //596191 :: PK97815
{
Object listener = null;
try {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.logp(Level.FINE, CLASS_NAME, "loadListener", "loadListener Classloader " + getClassLoader());
// PK16542 end
// instantiate the listener
listener = java.beans.Beans.instantiate(getClassLoader(), lClassName);
} catch (Throwable th) {
// some exception, log error.
logError("Failed to load listener: " + lClassName, th);
if (WCCustomProperties.STOP_APP_STARTUP_ON_LISTENER_EXCEPTION) { //PI58875
throw th;
}
}
return listener;
} | [
"protected",
"Object",
"loadListener",
"(",
"String",
"lClassName",
")",
"throws",
"InjectionException",
",",
"Throwable",
"//596191 :: PK97815",
"{",
"Object",
"listener",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"loadListener\"",
",",
"\"loadListener Classloader \"",
"+",
"getClassLoader",
"(",
")",
")",
";",
"// PK16542 end",
"// instantiate the listener",
"listener",
"=",
"java",
".",
"beans",
".",
"Beans",
".",
"instantiate",
"(",
"getClassLoader",
"(",
")",
",",
"lClassName",
")",
";",
"}",
"catch",
"(",
"Throwable",
"th",
")",
"{",
"// some exception, log error.",
"logError",
"(",
"\"Failed to load listener: \"",
"+",
"lClassName",
",",
"th",
")",
";",
"if",
"(",
"WCCustomProperties",
".",
"STOP_APP_STARTUP_ON_LISTENER_EXCEPTION",
")",
"{",
"//PI58875",
"throw",
"th",
";",
"}",
"}",
"return",
"listener",
";",
"}"
] | LIDB1234.2 - added method below to load a listener class | [
"LIDB1234",
".",
"2",
"-",
"added",
"method",
"below",
"to",
"load",
"a",
"listener",
"class"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L2319-L2337 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.addToStartWeightList | public void addToStartWeightList(IServletConfig sc) {
// we haven't started sorting the startup weights yet so just ignore. It
// will be added later.
if (this.sortedServletConfigs == null)
return;
int size = this.sortedServletConfigs.size();
int pos = 0;
boolean added = false;
if (size == 0 || !sc.isLoadOnStartup())
sortedServletConfigs.add(sc);
else {
// remove the current entry if it was already added
if (sc.isAddedToLoadOnStartup() && sc.isWeightChanged())
sortedServletConfigs.remove(sc);
int value = sc.getStartUpWeight();
for (IServletConfig curServletConfig : sortedServletConfigs) {
int curStartupWeight = curServletConfig.getStartUpWeight();
if (value < curStartupWeight || !curServletConfig.isLoadOnStartup()) {
sortedServletConfigs.add(pos, sc);
added = true;
break;
}
pos++;
}
if (!added)
sortedServletConfigs.add(sc);
}
sc.setAddedToLoadOnStartup(true);
} | java | public void addToStartWeightList(IServletConfig sc) {
// we haven't started sorting the startup weights yet so just ignore. It
// will be added later.
if (this.sortedServletConfigs == null)
return;
int size = this.sortedServletConfigs.size();
int pos = 0;
boolean added = false;
if (size == 0 || !sc.isLoadOnStartup())
sortedServletConfigs.add(sc);
else {
// remove the current entry if it was already added
if (sc.isAddedToLoadOnStartup() && sc.isWeightChanged())
sortedServletConfigs.remove(sc);
int value = sc.getStartUpWeight();
for (IServletConfig curServletConfig : sortedServletConfigs) {
int curStartupWeight = curServletConfig.getStartUpWeight();
if (value < curStartupWeight || !curServletConfig.isLoadOnStartup()) {
sortedServletConfigs.add(pos, sc);
added = true;
break;
}
pos++;
}
if (!added)
sortedServletConfigs.add(sc);
}
sc.setAddedToLoadOnStartup(true);
} | [
"public",
"void",
"addToStartWeightList",
"(",
"IServletConfig",
"sc",
")",
"{",
"// we haven't started sorting the startup weights yet so just ignore. It",
"// will be added later.",
"if",
"(",
"this",
".",
"sortedServletConfigs",
"==",
"null",
")",
"return",
";",
"int",
"size",
"=",
"this",
".",
"sortedServletConfigs",
".",
"size",
"(",
")",
";",
"int",
"pos",
"=",
"0",
";",
"boolean",
"added",
"=",
"false",
";",
"if",
"(",
"size",
"==",
"0",
"||",
"!",
"sc",
".",
"isLoadOnStartup",
"(",
")",
")",
"sortedServletConfigs",
".",
"add",
"(",
"sc",
")",
";",
"else",
"{",
"// remove the current entry if it was already added",
"if",
"(",
"sc",
".",
"isAddedToLoadOnStartup",
"(",
")",
"&&",
"sc",
".",
"isWeightChanged",
"(",
")",
")",
"sortedServletConfigs",
".",
"remove",
"(",
"sc",
")",
";",
"int",
"value",
"=",
"sc",
".",
"getStartUpWeight",
"(",
")",
";",
"for",
"(",
"IServletConfig",
"curServletConfig",
":",
"sortedServletConfigs",
")",
"{",
"int",
"curStartupWeight",
"=",
"curServletConfig",
".",
"getStartUpWeight",
"(",
")",
";",
"if",
"(",
"value",
"<",
"curStartupWeight",
"||",
"!",
"curServletConfig",
".",
"isLoadOnStartup",
"(",
")",
")",
"{",
"sortedServletConfigs",
".",
"add",
"(",
"pos",
",",
"sc",
")",
";",
"added",
"=",
"true",
";",
"break",
";",
"}",
"pos",
"++",
";",
"}",
"if",
"(",
"!",
"added",
")",
"sortedServletConfigs",
".",
"add",
"(",
"sc",
")",
";",
"}",
"sc",
".",
"setAddedToLoadOnStartup",
"(",
"true",
")",
";",
"}"
] | Method addToStartWeightList. | [
"Method",
"addToStartWeightList",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L3815-L3848 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.notifyStart | public void notifyStart() {
try {
eventSource.onApplicationAvailableForService(new ApplicationEvent(this, this, new com.ibm.ws.webcontainer.util.IteratorEnumerator(config.getServletNames())));
// LIBERTY: next line added by V8 sync
//this.setInitialized(true);
} catch (Exception e) {
com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e, CLASS_NAME + ".started", "3220", this);
// pk435011
logger.logp(Level.SEVERE, CLASS_NAME, "started", "error.on.collaborator.started.call");
}
} | java | public void notifyStart() {
try {
eventSource.onApplicationAvailableForService(new ApplicationEvent(this, this, new com.ibm.ws.webcontainer.util.IteratorEnumerator(config.getServletNames())));
// LIBERTY: next line added by V8 sync
//this.setInitialized(true);
} catch (Exception e) {
com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e, CLASS_NAME + ".started", "3220", this);
// pk435011
logger.logp(Level.SEVERE, CLASS_NAME, "started", "error.on.collaborator.started.call");
}
} | [
"public",
"void",
"notifyStart",
"(",
")",
"{",
"try",
"{",
"eventSource",
".",
"onApplicationAvailableForService",
"(",
"new",
"ApplicationEvent",
"(",
"this",
",",
"this",
",",
"new",
"com",
".",
"ibm",
".",
"ws",
".",
"webcontainer",
".",
"util",
".",
"IteratorEnumerator",
"(",
"config",
".",
"getServletNames",
"(",
")",
")",
")",
")",
";",
"// LIBERTY: next line added by V8 sync",
"//this.setInitialized(true);",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"com",
".",
"ibm",
".",
"wsspi",
".",
"webcontainer",
".",
"util",
".",
"FFDCWrapper",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".started\"",
",",
"\"3220\"",
",",
"this",
")",
";",
"// pk435011",
"logger",
".",
"logp",
"(",
"Level",
".",
"SEVERE",
",",
"CLASS_NAME",
",",
"\"started\"",
",",
"\"error.on.collaborator.started.call\"",
")",
";",
"}",
"}"
] | use the started method above for any started specific requirements | [
"use",
"the",
"started",
"method",
"above",
"for",
"any",
"started",
"specific",
"requirements"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L5455-L5465 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.addMappingFilter | public void addMappingFilter(IServletConfig sConfig, IFilterConfig config) {
IFilterMapping fmapping = new FilterMapping(null, config, sConfig);
_addMapingFilter(config, fmapping);
} | java | public void addMappingFilter(IServletConfig sConfig, IFilterConfig config) {
IFilterMapping fmapping = new FilterMapping(null, config, sConfig);
_addMapingFilter(config, fmapping);
} | [
"public",
"void",
"addMappingFilter",
"(",
"IServletConfig",
"sConfig",
",",
"IFilterConfig",
"config",
")",
"{",
"IFilterMapping",
"fmapping",
"=",
"new",
"FilterMapping",
"(",
"null",
",",
"config",
",",
"sConfig",
")",
";",
"_addMapingFilter",
"(",
"config",
",",
"fmapping",
")",
";",
"}"
] | Adds a filter against a specified servlet config into this context
@param sConfig
@param config | [
"Adds",
"a",
"filter",
"against",
"a",
"specified",
"servlet",
"config",
"into",
"this",
"context"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L5554-L5557 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.initialize | public void initialize() throws ServletException, Throwable {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.entering(CLASS_NAME, "Initialize : app = " + config.getApplicationName() + ", initialized = " + initialized + ", destroyed = " + destroyed);
if (!initialized && !destroyed) {
synchronized (lock) {
if (!initialized && !destroyed &&!com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping()) {
initialize(this.config, this.moduleConfig, this.extensionFactories);
started();
initialized = true;
config.setSessionCookieConfigInitilialized();
}
}
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.exiting(CLASS_NAME, "Initialize : initialized = " + initialized + ", destroyed = " + destroyed);
} | java | public void initialize() throws ServletException, Throwable {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.entering(CLASS_NAME, "Initialize : app = " + config.getApplicationName() + ", initialized = " + initialized + ", destroyed = " + destroyed);
if (!initialized && !destroyed) {
synchronized (lock) {
if (!initialized && !destroyed &&!com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping()) {
initialize(this.config, this.moduleConfig, this.extensionFactories);
started();
initialized = true;
config.setSessionCookieConfigInitilialized();
}
}
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.exiting(CLASS_NAME, "Initialize : initialized = " + initialized + ", destroyed = " + destroyed);
} | [
"public",
"void",
"initialize",
"(",
")",
"throws",
"ServletException",
",",
"Throwable",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"Initialize : app = \"",
"+",
"config",
".",
"getApplicationName",
"(",
")",
"+",
"\", initialized = \"",
"+",
"initialized",
"+",
"\", destroyed = \"",
"+",
"destroyed",
")",
";",
"if",
"(",
"!",
"initialized",
"&&",
"!",
"destroyed",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"!",
"initialized",
"&&",
"!",
"destroyed",
"&&",
"!",
"com",
".",
"ibm",
".",
"ws",
".",
"webcontainer",
".",
"osgi",
".",
"WebContainer",
".",
"isServerStopping",
"(",
")",
")",
"{",
"initialize",
"(",
"this",
".",
"config",
",",
"this",
".",
"moduleConfig",
",",
"this",
".",
"extensionFactories",
")",
";",
"started",
"(",
")",
";",
"initialized",
"=",
"true",
";",
"config",
".",
"setSessionCookieConfigInitilialized",
"(",
")",
";",
"}",
"}",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"Initialize : initialized = \"",
"+",
"initialized",
"+",
"\", destroyed = \"",
"+",
"destroyed",
")",
";",
"}"
] | LIBERTY Added for delayed start. | [
"LIBERTY",
"Added",
"for",
"delayed",
"start",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L6594-L6612 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.setModuleContainer | public void setModuleContainer(com.ibm.wsspi.adaptable.module.Container c){
container = c;
metaInfResourceFinder = new MetaInfResourceFinder(container);
} | java | public void setModuleContainer(com.ibm.wsspi.adaptable.module.Container c){
container = c;
metaInfResourceFinder = new MetaInfResourceFinder(container);
} | [
"public",
"void",
"setModuleContainer",
"(",
"com",
".",
"ibm",
".",
"wsspi",
".",
"adaptable",
".",
"module",
".",
"Container",
"c",
")",
"{",
"container",
"=",
"c",
";",
"metaInfResourceFinder",
"=",
"new",
"MetaInfResourceFinder",
"(",
"container",
")",
";",
"}"
] | LIBERTY add to set the Adaptable API Container | [
"LIBERTY",
"add",
"to",
"set",
"the",
"Adaptable",
"API",
"Container"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L6629-L6632 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java | WebApp.addAllEntries | private void addAllEntries(Set s, com.ibm.wsspi.adaptable.module.Container dir) throws UnableToAdaptException {
for(Entry entry : dir){
String path = entry.getPath();
com.ibm.wsspi.adaptable.module.Container possibleContainer = entry.adapt(com.ibm.wsspi.adaptable.module.Container.class);
//If this container appears to be a directory then we need to add / to the path
//If this container is a nested archive, then we add it as-is.
if(possibleContainer != null && !possibleContainer.isRoot()) {
path = path + "/";
}
s.add(path);
}
} | java | private void addAllEntries(Set s, com.ibm.wsspi.adaptable.module.Container dir) throws UnableToAdaptException {
for(Entry entry : dir){
String path = entry.getPath();
com.ibm.wsspi.adaptable.module.Container possibleContainer = entry.adapt(com.ibm.wsspi.adaptable.module.Container.class);
//If this container appears to be a directory then we need to add / to the path
//If this container is a nested archive, then we add it as-is.
if(possibleContainer != null && !possibleContainer.isRoot()) {
path = path + "/";
}
s.add(path);
}
} | [
"private",
"void",
"addAllEntries",
"(",
"Set",
"s",
",",
"com",
".",
"ibm",
".",
"wsspi",
".",
"adaptable",
".",
"module",
".",
"Container",
"dir",
")",
"throws",
"UnableToAdaptException",
"{",
"for",
"(",
"Entry",
"entry",
":",
"dir",
")",
"{",
"String",
"path",
"=",
"entry",
".",
"getPath",
"(",
")",
";",
"com",
".",
"ibm",
".",
"wsspi",
".",
"adaptable",
".",
"module",
".",
"Container",
"possibleContainer",
"=",
"entry",
".",
"adapt",
"(",
"com",
".",
"ibm",
".",
"wsspi",
".",
"adaptable",
".",
"module",
".",
"Container",
".",
"class",
")",
";",
"//If this container appears to be a directory then we need to add / to the path",
"//If this container is a nested archive, then we add it as-is.",
"if",
"(",
"possibleContainer",
"!=",
"null",
"&&",
"!",
"possibleContainer",
".",
"isRoot",
"(",
")",
")",
"{",
"path",
"=",
"path",
"+",
"\"/\"",
";",
"}",
"s",
".",
"add",
"(",
"path",
")",
";",
"}",
"}"
] | Add all entry paths from the Container into the Set | [
"Add",
"all",
"entry",
"paths",
"from",
"the",
"Container",
"into",
"the",
"Set"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebApp.java#L6703-L6714 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsDestinationCache.java | JsDestinationCache.populateCache | private void populateCache() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, "populateCache", this);
}
try {
HashMap<String, BaseDestination> destList = _bus.getLWMMEConfig().getMessagingEngine().getDestinationList();
Iterator<Entry<String, BaseDestination>> entries = destList.entrySet().iterator();
while (entries != null && entries.hasNext())
{
Entry<String, BaseDestination> entry = entries.next();
BaseDestination bd = (BaseDestination) entry.getValue();
if(bd.isAlias())
{
AliasDestination alias=(AliasDestination)bd;
_rawDestinations.add(alias);
BaseDestinationDefinition dd = ((JsAdminFactoryImpl) _jsaf).createDestinationAliasDefinition(alias);
addEntry(_bus.getName(), dd, alias);
}
else
{
SIBDestination oo = (SIBDestination) entry.getValue();
_rawDestinations.add(oo);
if (oo.getDestinationType() == DestinationType.QUEUE)
{
LWMConfig queue = oo;
DestinationDefinition dd = ((JsAdminFactoryImpl) _jsaf).createDestinationDefinition(queue);
addEntry(_bus.getName(), dd, queue);
} else if (oo.getDestinationType() == DestinationType.TOPICSPACE)
{
LWMConfig topicspace = oo;
DestinationDefinition dd = ((JsAdminFactoryImpl) _jsaf).createDestinationDefinition(topicspace);
// Set auditAllowed.
// Boolean auditAllowed = (Boolean) tsAuditMap.get(dd.getName());
// if (auditAllowed != null) {
// ((DestinationDefinitionImpl) dd).setAuditAllowed(auditAllowed.booleanValue());
// }
addEntry(_bus.getName(), dd, topicspace);
}
}
} // ...end while...
} catch (Exception e) {
SibTr.error(tc, "POPULATE_DESTINATION_FAILED_SIAS0114" + e);
e.printStackTrace();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, "populateCache");
}
} | java | private void populateCache() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, "populateCache", this);
}
try {
HashMap<String, BaseDestination> destList = _bus.getLWMMEConfig().getMessagingEngine().getDestinationList();
Iterator<Entry<String, BaseDestination>> entries = destList.entrySet().iterator();
while (entries != null && entries.hasNext())
{
Entry<String, BaseDestination> entry = entries.next();
BaseDestination bd = (BaseDestination) entry.getValue();
if(bd.isAlias())
{
AliasDestination alias=(AliasDestination)bd;
_rawDestinations.add(alias);
BaseDestinationDefinition dd = ((JsAdminFactoryImpl) _jsaf).createDestinationAliasDefinition(alias);
addEntry(_bus.getName(), dd, alias);
}
else
{
SIBDestination oo = (SIBDestination) entry.getValue();
_rawDestinations.add(oo);
if (oo.getDestinationType() == DestinationType.QUEUE)
{
LWMConfig queue = oo;
DestinationDefinition dd = ((JsAdminFactoryImpl) _jsaf).createDestinationDefinition(queue);
addEntry(_bus.getName(), dd, queue);
} else if (oo.getDestinationType() == DestinationType.TOPICSPACE)
{
LWMConfig topicspace = oo;
DestinationDefinition dd = ((JsAdminFactoryImpl) _jsaf).createDestinationDefinition(topicspace);
// Set auditAllowed.
// Boolean auditAllowed = (Boolean) tsAuditMap.get(dd.getName());
// if (auditAllowed != null) {
// ((DestinationDefinitionImpl) dd).setAuditAllowed(auditAllowed.booleanValue());
// }
addEntry(_bus.getName(), dd, topicspace);
}
}
} // ...end while...
} catch (Exception e) {
SibTr.error(tc, "POPULATE_DESTINATION_FAILED_SIAS0114" + e);
e.printStackTrace();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, "populateCache");
}
} | [
"private",
"void",
"populateCache",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"populateCache\"",
",",
"this",
")",
";",
"}",
"try",
"{",
"HashMap",
"<",
"String",
",",
"BaseDestination",
">",
"destList",
"=",
"_bus",
".",
"getLWMMEConfig",
"(",
")",
".",
"getMessagingEngine",
"(",
")",
".",
"getDestinationList",
"(",
")",
";",
"Iterator",
"<",
"Entry",
"<",
"String",
",",
"BaseDestination",
">",
">",
"entries",
"=",
"destList",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"entries",
"!=",
"null",
"&&",
"entries",
".",
"hasNext",
"(",
")",
")",
"{",
"Entry",
"<",
"String",
",",
"BaseDestination",
">",
"entry",
"=",
"entries",
".",
"next",
"(",
")",
";",
"BaseDestination",
"bd",
"=",
"(",
"BaseDestination",
")",
"entry",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"bd",
".",
"isAlias",
"(",
")",
")",
"{",
"AliasDestination",
"alias",
"=",
"(",
"AliasDestination",
")",
"bd",
";",
"_rawDestinations",
".",
"add",
"(",
"alias",
")",
";",
"BaseDestinationDefinition",
"dd",
"=",
"(",
"(",
"JsAdminFactoryImpl",
")",
"_jsaf",
")",
".",
"createDestinationAliasDefinition",
"(",
"alias",
")",
";",
"addEntry",
"(",
"_bus",
".",
"getName",
"(",
")",
",",
"dd",
",",
"alias",
")",
";",
"}",
"else",
"{",
"SIBDestination",
"oo",
"=",
"(",
"SIBDestination",
")",
"entry",
".",
"getValue",
"(",
")",
";",
"_rawDestinations",
".",
"add",
"(",
"oo",
")",
";",
"if",
"(",
"oo",
".",
"getDestinationType",
"(",
")",
"==",
"DestinationType",
".",
"QUEUE",
")",
"{",
"LWMConfig",
"queue",
"=",
"oo",
";",
"DestinationDefinition",
"dd",
"=",
"(",
"(",
"JsAdminFactoryImpl",
")",
"_jsaf",
")",
".",
"createDestinationDefinition",
"(",
"queue",
")",
";",
"addEntry",
"(",
"_bus",
".",
"getName",
"(",
")",
",",
"dd",
",",
"queue",
")",
";",
"}",
"else",
"if",
"(",
"oo",
".",
"getDestinationType",
"(",
")",
"==",
"DestinationType",
".",
"TOPICSPACE",
")",
"{",
"LWMConfig",
"topicspace",
"=",
"oo",
";",
"DestinationDefinition",
"dd",
"=",
"(",
"(",
"JsAdminFactoryImpl",
")",
"_jsaf",
")",
".",
"createDestinationDefinition",
"(",
"topicspace",
")",
";",
"// Set auditAllowed.",
"// Boolean auditAllowed = (Boolean) tsAuditMap.get(dd.getName());",
"// if (auditAllowed != null) {",
"// ((DestinationDefinitionImpl) dd).setAuditAllowed(auditAllowed.booleanValue());",
"// }",
"addEntry",
"(",
"_bus",
".",
"getName",
"(",
")",
",",
"dd",
",",
"topicspace",
")",
";",
"}",
"}",
"}",
"// ...end while...",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"POPULATE_DESTINATION_FAILED_SIAS0114\"",
"+",
"e",
")",
";",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"populateCache\"",
")",
";",
"}",
"}"
] | Build the cache of DestinationDefinition objects in the configuration | [
"Build",
"the",
"cache",
"of",
"DestinationDefinition",
"objects",
"in",
"the",
"configuration"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsDestinationCache.java#L143-L198 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.activate | @Activate
protected void activate(BundleContext ctx, Map<String, Object> properties) {
SibTr.entry(tc, CLASS_NAME + "activate", properties);
this.properties = properties;
this.bundleLocation = ctx.getBundle().getLocation();
populateDestinationPermissions();
runtimeSecurityService.modifyMessagingServices(this);
SibTr.exit(tc, CLASS_NAME + "activate");
} | java | @Activate
protected void activate(BundleContext ctx, Map<String, Object> properties) {
SibTr.entry(tc, CLASS_NAME + "activate", properties);
this.properties = properties;
this.bundleLocation = ctx.getBundle().getLocation();
populateDestinationPermissions();
runtimeSecurityService.modifyMessagingServices(this);
SibTr.exit(tc, CLASS_NAME + "activate");
} | [
"@",
"Activate",
"protected",
"void",
"activate",
"(",
"BundleContext",
"ctx",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"activate\"",
",",
"properties",
")",
";",
"this",
".",
"properties",
"=",
"properties",
";",
"this",
".",
"bundleLocation",
"=",
"ctx",
".",
"getBundle",
"(",
")",
".",
"getLocation",
"(",
")",
";",
"populateDestinationPermissions",
"(",
")",
";",
"runtimeSecurityService",
".",
"modifyMessagingServices",
"(",
"this",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"activate\"",
")",
";",
"}"
] | Method to activate Messaging Security component
@param properties : Map containing service & config properties populated/provided by config admin
@throws MessagingSecurityException | [
"Method",
"to",
"activate",
"Messaging",
"Security",
"component"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L117-L129 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.modify | @Modified
protected void modify(ComponentContext cc, Map<String, Object> properties) {
SibTr.entry(tc, CLASS_NAME + "modify", properties);
this.properties = properties;
populateDestinationPermissions();
runtimeSecurityService.modifyMessagingServices(this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, CLASS_NAME + "modify");
}
} | java | @Modified
protected void modify(ComponentContext cc, Map<String, Object> properties) {
SibTr.entry(tc, CLASS_NAME + "modify", properties);
this.properties = properties;
populateDestinationPermissions();
runtimeSecurityService.modifyMessagingServices(this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, CLASS_NAME + "modify");
}
} | [
"@",
"Modified",
"protected",
"void",
"modify",
"(",
"ComponentContext",
"cc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"modify\"",
",",
"properties",
")",
";",
"this",
".",
"properties",
"=",
"properties",
";",
"populateDestinationPermissions",
"(",
")",
";",
"runtimeSecurityService",
".",
"modifyMessagingServices",
"(",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"modify\"",
")",
";",
"}",
"}"
] | Called by OSGI framework when there is a modification in server.xml for tag associated with this component
@param cc
Component Context object
@param properties
Properties for this component from server.xml | [
"Called",
"by",
"OSGI",
"framework",
"when",
"there",
"is",
"a",
"modification",
"in",
"server",
".",
"xml",
"for",
"tag",
"associated",
"with",
"this",
"component"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L140-L150 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.deactivate | @Deactivate
protected void deactivate(ComponentContext context) {
SibTr.entry(tc, CLASS_NAME + "deactivate", context);
runtimeSecurityService.modifyMessagingServices(null);
queuePermissions = null;
topicPermissions = null;
temporaryDestinationPermissions = null;
sibAuthenticationService = null;
sibAuthorizationService = null;
this.bundleLocation = null;
SibTr.exit(tc, CLASS_NAME + "deactivate");
} | java | @Deactivate
protected void deactivate(ComponentContext context) {
SibTr.entry(tc, CLASS_NAME + "deactivate", context);
runtimeSecurityService.modifyMessagingServices(null);
queuePermissions = null;
topicPermissions = null;
temporaryDestinationPermissions = null;
sibAuthenticationService = null;
sibAuthorizationService = null;
this.bundleLocation = null;
SibTr.exit(tc, CLASS_NAME + "deactivate");
} | [
"@",
"Deactivate",
"protected",
"void",
"deactivate",
"(",
"ComponentContext",
"context",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"deactivate\"",
",",
"context",
")",
";",
"runtimeSecurityService",
".",
"modifyMessagingServices",
"(",
"null",
")",
";",
"queuePermissions",
"=",
"null",
";",
"topicPermissions",
"=",
"null",
";",
"temporaryDestinationPermissions",
"=",
"null",
";",
"sibAuthenticationService",
"=",
"null",
";",
"sibAuthorizationService",
"=",
"null",
";",
"this",
".",
"bundleLocation",
"=",
"null",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"deactivate\"",
")",
";",
"}"
] | Called by OSGI framework when the feature is removed from server.xml
@param reason
int representation of reason the component is stopping | [
"Called",
"by",
"OSGI",
"framework",
"when",
"the",
"feature",
"is",
"removed",
"from",
"server",
".",
"xml"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L158-L171 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.setSecurityService | @Reference
protected void setSecurityService(SecurityService securityService) {
SibTr.entry(tc, CLASS_NAME + "setSecurityService", securityService);
this.securityService = securityService;
SibTr.exit(tc, CLASS_NAME + "setSecurityService");
} | java | @Reference
protected void setSecurityService(SecurityService securityService) {
SibTr.entry(tc, CLASS_NAME + "setSecurityService", securityService);
this.securityService = securityService;
SibTr.exit(tc, CLASS_NAME + "setSecurityService");
} | [
"@",
"Reference",
"protected",
"void",
"setSecurityService",
"(",
"SecurityService",
"securityService",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"setSecurityService\"",
",",
"securityService",
")",
";",
"this",
".",
"securityService",
"=",
"securityService",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"setSecurityService\"",
")",
";",
"}"
] | Binding Security Service
@param reference | [
"Binding",
"Security",
"Service"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L178-L185 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.unsetSecurityService | protected void unsetSecurityService(SecurityService securityService) {
SibTr.entry(tc, CLASS_NAME + "unsetSecurityService", securityService);
SibTr.exit(tc, CLASS_NAME + "unsetSecurityService");
} | java | protected void unsetSecurityService(SecurityService securityService) {
SibTr.entry(tc, CLASS_NAME + "unsetSecurityService", securityService);
SibTr.exit(tc, CLASS_NAME + "unsetSecurityService");
} | [
"protected",
"void",
"unsetSecurityService",
"(",
"SecurityService",
"securityService",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"unsetSecurityService\"",
",",
"securityService",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"unsetSecurityService\"",
")",
";",
"}"
] | Unbinding Security Service
@param reference | [
"Unbinding",
"Security",
"Service"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L192-L196 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.setConfigAdmin | @Reference
protected void setConfigAdmin(ConfigurationAdmin configAdmin) {
SibTr.entry(tc, CLASS_NAME + "setConfigAdmin", configAdmin);
this.configAdmin = configAdmin;
SibTr.exit(tc, CLASS_NAME + "setConfigAdmin");
} | java | @Reference
protected void setConfigAdmin(ConfigurationAdmin configAdmin) {
SibTr.entry(tc, CLASS_NAME + "setConfigAdmin", configAdmin);
this.configAdmin = configAdmin;
SibTr.exit(tc, CLASS_NAME + "setConfigAdmin");
} | [
"@",
"Reference",
"protected",
"void",
"setConfigAdmin",
"(",
"ConfigurationAdmin",
"configAdmin",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"setConfigAdmin\"",
",",
"configAdmin",
")",
";",
"this",
".",
"configAdmin",
"=",
"configAdmin",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"setConfigAdmin\"",
")",
";",
"}"
] | Binding the Configuration Admin service
@param reference | [
"Binding",
"the",
"Configuration",
"Admin",
"service"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L203-L210 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.unsetConfigAdmin | protected void unsetConfigAdmin(ConfigurationAdmin configAdmin) {
SibTr.entry(tc, CLASS_NAME + "unsetConfigAdmin", configAdmin);
SibTr.exit(tc, CLASS_NAME + "unsetConfigAdmin");
} | java | protected void unsetConfigAdmin(ConfigurationAdmin configAdmin) {
SibTr.entry(tc, CLASS_NAME + "unsetConfigAdmin", configAdmin);
SibTr.exit(tc, CLASS_NAME + "unsetConfigAdmin");
} | [
"protected",
"void",
"unsetConfigAdmin",
"(",
"ConfigurationAdmin",
"configAdmin",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"unsetConfigAdmin\"",
",",
"configAdmin",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"unsetConfigAdmin\"",
")",
";",
"}"
] | Unbinding the Configuration Admin service
@param reference | [
"Unbinding",
"the",
"Configuration",
"Admin",
"service"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L217-L221 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.getMessagingAuthenticationService | @Override
public MessagingAuthenticationService getMessagingAuthenticationService() {
SibTr.entry(tc, CLASS_NAME + "getMessagingAuthenticationService");
if (sibAuthenticationService == null) {
sibAuthenticationService = new MessagingAuthenticationServiceImpl(this);
}
SibTr.exit(tc, CLASS_NAME + "getMessagingAuthenticationService", sibAuthenticationService);
return sibAuthenticationService;
} | java | @Override
public MessagingAuthenticationService getMessagingAuthenticationService() {
SibTr.entry(tc, CLASS_NAME + "getMessagingAuthenticationService");
if (sibAuthenticationService == null) {
sibAuthenticationService = new MessagingAuthenticationServiceImpl(this);
}
SibTr.exit(tc, CLASS_NAME + "getMessagingAuthenticationService", sibAuthenticationService);
return sibAuthenticationService;
} | [
"@",
"Override",
"public",
"MessagingAuthenticationService",
"getMessagingAuthenticationService",
"(",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getMessagingAuthenticationService\"",
")",
";",
"if",
"(",
"sibAuthenticationService",
"==",
"null",
")",
"{",
"sibAuthenticationService",
"=",
"new",
"MessagingAuthenticationServiceImpl",
"(",
"this",
")",
";",
"}",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getMessagingAuthenticationService\"",
",",
"sibAuthenticationService",
")",
";",
"return",
"sibAuthenticationService",
";",
"}"
] | Get Messaging Authentication Service | [
"Get",
"Messaging",
"Authentication",
"Service"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L235-L245 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.getMessagingAuthorizationService | @Override
public MessagingAuthorizationService getMessagingAuthorizationService() {
SibTr.entry(tc, CLASS_NAME + "getMessagingAuthorizationService");
if (sibAuthorizationService == null) {
sibAuthorizationService = new MessagingAuthorizationServiceImpl(this);
}
SibTr.exit(tc, CLASS_NAME + "getMessagingAuthorizationService", sibAuthorizationService);
return sibAuthorizationService;
} | java | @Override
public MessagingAuthorizationService getMessagingAuthorizationService() {
SibTr.entry(tc, CLASS_NAME + "getMessagingAuthorizationService");
if (sibAuthorizationService == null) {
sibAuthorizationService = new MessagingAuthorizationServiceImpl(this);
}
SibTr.exit(tc, CLASS_NAME + "getMessagingAuthorizationService", sibAuthorizationService);
return sibAuthorizationService;
} | [
"@",
"Override",
"public",
"MessagingAuthorizationService",
"getMessagingAuthorizationService",
"(",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getMessagingAuthorizationService\"",
")",
";",
"if",
"(",
"sibAuthorizationService",
"==",
"null",
")",
"{",
"sibAuthorizationService",
"=",
"new",
"MessagingAuthorizationServiceImpl",
"(",
"this",
")",
";",
"}",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getMessagingAuthorizationService\"",
",",
"sibAuthorizationService",
")",
";",
"return",
"sibAuthorizationService",
";",
"}"
] | Get Messaging Authorization Service | [
"Get",
"Messaging",
"Authorization",
"Service"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L250-L260 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.getUserRegistry | public UserRegistry getUserRegistry() {
SibTr.entry(tc, CLASS_NAME + "getUserRegistry");
UserRegistry userRegistry = null;
if (getSecurityService() != null) {
UserRegistryService userRegistryService = securityService
.getUserRegistryService();
try {
if (userRegistryService.isUserRegistryConfigured()) {
userRegistry = userRegistryService.getUserRegistry();
} else {
MessagingSecurityException mse = new MessagingSecurityException();
FFDCFilter.processException(mse, CLASS_NAME + ".getUserRegistry", "1005", this);
SibTr.exception(tc, mse);
SibTr.error(tc, "USER_REGISTRY_NOT_CONFIGURED_MSE1005");
}
} catch (RegistryException re) {
MessagingSecurityException mse = new MessagingSecurityException(re);
FFDCFilter.processException(mse, CLASS_NAME + ".getUserRegistry", "1006", this);
SibTr.exception(tc, mse);
SibTr.error(tc, "USER_REGISTRY_EXCEPTION_MSE1006");
}
}
SibTr.exit(tc, CLASS_NAME + "getUserRegistry", userRegistry);
return userRegistry;
} | java | public UserRegistry getUserRegistry() {
SibTr.entry(tc, CLASS_NAME + "getUserRegistry");
UserRegistry userRegistry = null;
if (getSecurityService() != null) {
UserRegistryService userRegistryService = securityService
.getUserRegistryService();
try {
if (userRegistryService.isUserRegistryConfigured()) {
userRegistry = userRegistryService.getUserRegistry();
} else {
MessagingSecurityException mse = new MessagingSecurityException();
FFDCFilter.processException(mse, CLASS_NAME + ".getUserRegistry", "1005", this);
SibTr.exception(tc, mse);
SibTr.error(tc, "USER_REGISTRY_NOT_CONFIGURED_MSE1005");
}
} catch (RegistryException re) {
MessagingSecurityException mse = new MessagingSecurityException(re);
FFDCFilter.processException(mse, CLASS_NAME + ".getUserRegistry", "1006", this);
SibTr.exception(tc, mse);
SibTr.error(tc, "USER_REGISTRY_EXCEPTION_MSE1006");
}
}
SibTr.exit(tc, CLASS_NAME + "getUserRegistry", userRegistry);
return userRegistry;
} | [
"public",
"UserRegistry",
"getUserRegistry",
"(",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getUserRegistry\"",
")",
";",
"UserRegistry",
"userRegistry",
"=",
"null",
";",
"if",
"(",
"getSecurityService",
"(",
")",
"!=",
"null",
")",
"{",
"UserRegistryService",
"userRegistryService",
"=",
"securityService",
".",
"getUserRegistryService",
"(",
")",
";",
"try",
"{",
"if",
"(",
"userRegistryService",
".",
"isUserRegistryConfigured",
"(",
")",
")",
"{",
"userRegistry",
"=",
"userRegistryService",
".",
"getUserRegistry",
"(",
")",
";",
"}",
"else",
"{",
"MessagingSecurityException",
"mse",
"=",
"new",
"MessagingSecurityException",
"(",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"mse",
",",
"CLASS_NAME",
"+",
"\".getUserRegistry\"",
",",
"\"1005\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"mse",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"USER_REGISTRY_NOT_CONFIGURED_MSE1005\"",
")",
";",
"}",
"}",
"catch",
"(",
"RegistryException",
"re",
")",
"{",
"MessagingSecurityException",
"mse",
"=",
"new",
"MessagingSecurityException",
"(",
"re",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"mse",
",",
"CLASS_NAME",
"+",
"\".getUserRegistry\"",
",",
"\"1006\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"mse",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"USER_REGISTRY_EXCEPTION_MSE1006\"",
")",
";",
"}",
"}",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getUserRegistry\"",
",",
"userRegistry",
")",
";",
"return",
"userRegistry",
";",
"}"
] | Get User Registry from the Liberty Security component
@return UserRegistry | [
"Get",
"User",
"Registry",
"from",
"the",
"Liberty",
"Security",
"component"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L282-L308 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.populateDestinationPermissions | private void populateDestinationPermissions() {
SibTr.entry(tc, CLASS_NAME + "populateDestinationPermissions", properties);
pids.clear();
String[] roles = (String[]) properties
.get(MessagingSecurityConstants.ROLE);
initializeMaps();
if (roles != null) {
checkIfRolesAreUnique(roles);
for (String role : roles) {
Dictionary<String, Object> roleProperties = getDictionaryObject(role);
Set<String> users = null;
Set<String> groups = null;
// Get the list of Users
users = createUserOrGroupSet(roleProperties,
MessagingSecurityConstants.USER);
// Get the list of Groups
groups = createUserOrGroupSet(roleProperties,
MessagingSecurityConstants.GROUP);
if (roleProperties != null) {
populateQueuePermissions(roleProperties, users, groups);
populateTemporarayDestinationPermissions(roleProperties, users, groups);
populateTopicPermissions(roleProperties, users, groups);
}
}
}
if (tc.isDebugEnabled()) {
SibTr.debug(tc, CLASS_NAME + " ***** Queue Permissions *****");
printDestinationPermissions(queuePermissions);
SibTr.debug(tc, CLASS_NAME + " ***** Topic Permissions *****");
printDestinationPermissions(topicPermissions);
SibTr.debug(tc, CLASS_NAME + " ***** Temporary DestinationPermissions *****");
printDestinationPermissions(temporaryDestinationPermissions);
}
SibTr.exit(tc, CLASS_NAME + "populateDestinationPermissions");
} | java | private void populateDestinationPermissions() {
SibTr.entry(tc, CLASS_NAME + "populateDestinationPermissions", properties);
pids.clear();
String[] roles = (String[]) properties
.get(MessagingSecurityConstants.ROLE);
initializeMaps();
if (roles != null) {
checkIfRolesAreUnique(roles);
for (String role : roles) {
Dictionary<String, Object> roleProperties = getDictionaryObject(role);
Set<String> users = null;
Set<String> groups = null;
// Get the list of Users
users = createUserOrGroupSet(roleProperties,
MessagingSecurityConstants.USER);
// Get the list of Groups
groups = createUserOrGroupSet(roleProperties,
MessagingSecurityConstants.GROUP);
if (roleProperties != null) {
populateQueuePermissions(roleProperties, users, groups);
populateTemporarayDestinationPermissions(roleProperties, users, groups);
populateTopicPermissions(roleProperties, users, groups);
}
}
}
if (tc.isDebugEnabled()) {
SibTr.debug(tc, CLASS_NAME + " ***** Queue Permissions *****");
printDestinationPermissions(queuePermissions);
SibTr.debug(tc, CLASS_NAME + " ***** Topic Permissions *****");
printDestinationPermissions(topicPermissions);
SibTr.debug(tc, CLASS_NAME + " ***** Temporary DestinationPermissions *****");
printDestinationPermissions(temporaryDestinationPermissions);
}
SibTr.exit(tc, CLASS_NAME + "populateDestinationPermissions");
} | [
"private",
"void",
"populateDestinationPermissions",
"(",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"populateDestinationPermissions\"",
",",
"properties",
")",
";",
"pids",
".",
"clear",
"(",
")",
";",
"String",
"[",
"]",
"roles",
"=",
"(",
"String",
"[",
"]",
")",
"properties",
".",
"get",
"(",
"MessagingSecurityConstants",
".",
"ROLE",
")",
";",
"initializeMaps",
"(",
")",
";",
"if",
"(",
"roles",
"!=",
"null",
")",
"{",
"checkIfRolesAreUnique",
"(",
"roles",
")",
";",
"for",
"(",
"String",
"role",
":",
"roles",
")",
"{",
"Dictionary",
"<",
"String",
",",
"Object",
">",
"roleProperties",
"=",
"getDictionaryObject",
"(",
"role",
")",
";",
"Set",
"<",
"String",
">",
"users",
"=",
"null",
";",
"Set",
"<",
"String",
">",
"groups",
"=",
"null",
";",
"// Get the list of Users",
"users",
"=",
"createUserOrGroupSet",
"(",
"roleProperties",
",",
"MessagingSecurityConstants",
".",
"USER",
")",
";",
"// Get the list of Groups",
"groups",
"=",
"createUserOrGroupSet",
"(",
"roleProperties",
",",
"MessagingSecurityConstants",
".",
"GROUP",
")",
";",
"if",
"(",
"roleProperties",
"!=",
"null",
")",
"{",
"populateQueuePermissions",
"(",
"roleProperties",
",",
"users",
",",
"groups",
")",
";",
"populateTemporarayDestinationPermissions",
"(",
"roleProperties",
",",
"users",
",",
"groups",
")",
";",
"populateTopicPermissions",
"(",
"roleProperties",
",",
"users",
",",
"groups",
")",
";",
"}",
"}",
"}",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\" ***** Queue Permissions *****\"",
")",
";",
"printDestinationPermissions",
"(",
"queuePermissions",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\" ***** Topic Permissions *****\"",
")",
";",
"printDestinationPermissions",
"(",
"topicPermissions",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\" ***** Temporary DestinationPermissions *****\"",
")",
";",
"printDestinationPermissions",
"(",
"temporaryDestinationPermissions",
")",
";",
"}",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"populateDestinationPermissions\"",
")",
";",
"}"
] | Populate the DestinationPermissions map with the destination and there access list | [
"Populate",
"the",
"DestinationPermissions",
"map",
"with",
"the",
"destination",
"and",
"there",
"access",
"list"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L334-L370 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.getDictionaryObject | private Dictionary<String, Object> getDictionaryObject(String input) {
SibTr.entry(tc, CLASS_NAME + "getDictionaryObject", input);
Dictionary<String, Object> dictionary = null;
Configuration config = null;
try {
pids.add(input);
config = configAdmin.getConfiguration(input, bundleLocation);
} catch (IOException e) {
MessagingSecurityException mse = new MessagingSecurityException(e);
FFDCFilter.processException(mse, CLASS_NAME + ".getDictionaryObject", "1008", this);
SibTr.exception(tc, mse);
SibTr.error(tc, "IO_EXCEPTION_READING_CONFIGURATION_MSE1008");
return new Hashtable<String, Object>();
}
dictionary = config.getProperties();
SibTr.exit(tc, CLASS_NAME + "getDictionaryObject", dictionary);
return dictionary;
} | java | private Dictionary<String, Object> getDictionaryObject(String input) {
SibTr.entry(tc, CLASS_NAME + "getDictionaryObject", input);
Dictionary<String, Object> dictionary = null;
Configuration config = null;
try {
pids.add(input);
config = configAdmin.getConfiguration(input, bundleLocation);
} catch (IOException e) {
MessagingSecurityException mse = new MessagingSecurityException(e);
FFDCFilter.processException(mse, CLASS_NAME + ".getDictionaryObject", "1008", this);
SibTr.exception(tc, mse);
SibTr.error(tc, "IO_EXCEPTION_READING_CONFIGURATION_MSE1008");
return new Hashtable<String, Object>();
}
dictionary = config.getProperties();
SibTr.exit(tc, CLASS_NAME + "getDictionaryObject", dictionary);
return dictionary;
} | [
"private",
"Dictionary",
"<",
"String",
",",
"Object",
">",
"getDictionaryObject",
"(",
"String",
"input",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getDictionaryObject\"",
",",
"input",
")",
";",
"Dictionary",
"<",
"String",
",",
"Object",
">",
"dictionary",
"=",
"null",
";",
"Configuration",
"config",
"=",
"null",
";",
"try",
"{",
"pids",
".",
"add",
"(",
"input",
")",
";",
"config",
"=",
"configAdmin",
".",
"getConfiguration",
"(",
"input",
",",
"bundleLocation",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"MessagingSecurityException",
"mse",
"=",
"new",
"MessagingSecurityException",
"(",
"e",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"mse",
",",
"CLASS_NAME",
"+",
"\".getDictionaryObject\"",
",",
"\"1008\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"mse",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"IO_EXCEPTION_READING_CONFIGURATION_MSE1008\"",
")",
";",
"return",
"new",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"}",
"dictionary",
"=",
"config",
".",
"getProperties",
"(",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"getDictionaryObject\"",
",",
"dictionary",
")",
";",
"return",
"dictionary",
";",
"}"
] | Get the Dictionary object for the given String
@param input
@return | [
"Get",
"the",
"Dictionary",
"object",
"for",
"the",
"given",
"String"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L600-L619 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.printDestinationPermissions | private void printDestinationPermissions(Map<String, ?> destinationPermissions) {
Set<String> destinations = destinationPermissions.keySet();
for (String destination : destinations) {
SibTr.debug(tc, CLASS_NAME + " Destination: " + destination);
Permission permission = (Permission) destinationPermissions.get(destination);
SibTr.debug(tc, " Users having permissions!!!");
Map<String, Set<String>> userRoles = permission.getRoleToUserMap();
Set<String> uRoles = userRoles.keySet();
for (String role : uRoles) {
SibTr.debug(tc, " " + role + ": " + userRoles.get(role));
}
SibTr.debug(tc, " Groups having permissions!!!");
Map<String, Set<String>> groupRoles = permission
.getRoleToGroupMap();
Set<String> gRoles = groupRoles.keySet();
for (String role : gRoles) {
SibTr.debug(tc, " " + role + ": " + groupRoles.get(role));
}
}
} | java | private void printDestinationPermissions(Map<String, ?> destinationPermissions) {
Set<String> destinations = destinationPermissions.keySet();
for (String destination : destinations) {
SibTr.debug(tc, CLASS_NAME + " Destination: " + destination);
Permission permission = (Permission) destinationPermissions.get(destination);
SibTr.debug(tc, " Users having permissions!!!");
Map<String, Set<String>> userRoles = permission.getRoleToUserMap();
Set<String> uRoles = userRoles.keySet();
for (String role : uRoles) {
SibTr.debug(tc, " " + role + ": " + userRoles.get(role));
}
SibTr.debug(tc, " Groups having permissions!!!");
Map<String, Set<String>> groupRoles = permission
.getRoleToGroupMap();
Set<String> gRoles = groupRoles.keySet();
for (String role : gRoles) {
SibTr.debug(tc, " " + role + ": " + groupRoles.get(role));
}
}
} | [
"private",
"void",
"printDestinationPermissions",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"destinationPermissions",
")",
"{",
"Set",
"<",
"String",
">",
"destinations",
"=",
"destinationPermissions",
".",
"keySet",
"(",
")",
";",
"for",
"(",
"String",
"destination",
":",
"destinations",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\" Destination: \"",
"+",
"destination",
")",
";",
"Permission",
"permission",
"=",
"(",
"Permission",
")",
"destinationPermissions",
".",
"get",
"(",
"destination",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\" Users having permissions!!!\"",
")",
";",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"userRoles",
"=",
"permission",
".",
"getRoleToUserMap",
"(",
")",
";",
"Set",
"<",
"String",
">",
"uRoles",
"=",
"userRoles",
".",
"keySet",
"(",
")",
";",
"for",
"(",
"String",
"role",
":",
"uRoles",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\" \"",
"+",
"role",
"+",
"\": \"",
"+",
"userRoles",
".",
"get",
"(",
"role",
")",
")",
";",
"}",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\" Groups having permissions!!!\"",
")",
";",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"groupRoles",
"=",
"permission",
".",
"getRoleToGroupMap",
"(",
")",
";",
"Set",
"<",
"String",
">",
"gRoles",
"=",
"groupRoles",
".",
"keySet",
"(",
")",
";",
"for",
"(",
"String",
"role",
":",
"gRoles",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\" \"",
"+",
"role",
"+",
"\": \"",
"+",
"groupRoles",
".",
"get",
"(",
"role",
")",
")",
";",
"}",
"}",
"}"
] | Print the Destination Permissions, it will be used for debugging purpose | [
"Print",
"the",
"Destination",
"Permissions",
"it",
"will",
"be",
"used",
"for",
"debugging",
"purpose"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L624-L643 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/processor/RecoveryProcessorFactory.java | RecoveryProcessorFactory.getInstance | public static final RecoveryProcessor getInstance() {
if (tc.isEntryEnabled()) {
SibTr.entry(tc, "getInstance");
}
if (_processor == null) {
try {
Class c = Class.forName("com.ibm.ws.sib.processor.impl.RecoveryProcessorImpl");
_processor = (RecoveryProcessor) c.newInstance();
}
catch (Exception e) {
e.printStackTrace();
}
}
if (tc.isEntryEnabled()) {
SibTr.exit(tc, "getMBean", _processor);
}
return _processor;
} | java | public static final RecoveryProcessor getInstance() {
if (tc.isEntryEnabled()) {
SibTr.entry(tc, "getInstance");
}
if (_processor == null) {
try {
Class c = Class.forName("com.ibm.ws.sib.processor.impl.RecoveryProcessorImpl");
_processor = (RecoveryProcessor) c.newInstance();
}
catch (Exception e) {
e.printStackTrace();
}
}
if (tc.isEntryEnabled()) {
SibTr.exit(tc, "getMBean", _processor);
}
return _processor;
} | [
"public",
"static",
"final",
"RecoveryProcessor",
"getInstance",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getInstance\"",
")",
";",
"}",
"if",
"(",
"_processor",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
"c",
"=",
"Class",
".",
"forName",
"(",
"\"com.ibm.ws.sib.processor.impl.RecoveryProcessorImpl\"",
")",
";",
"_processor",
"=",
"(",
"RecoveryProcessor",
")",
"c",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getMBean\"",
",",
"_processor",
")",
";",
"}",
"return",
"_processor",
";",
"}"
] | Returns a reference to the singleton RecoveryProcessor.
@return reference to the singleton RecoveryProcessor. | [
"Returns",
"a",
"reference",
"to",
"the",
"singleton",
"RecoveryProcessor",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/processor/RecoveryProcessorFactory.java#L37-L59 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java | StatusCodes.init | protected void init(int code, String phrase, boolean isError) {
this.myPhrase = phrase;
this.myPhraseBytes = HttpChannelUtils.getEnglishBytes(phrase);
this.myIntCode = code;
if (isError) {
this.myError = new HttpError(code, this.myPhrase);
}
initSpecialArrays();
checkForAllowedBody();
} | java | protected void init(int code, String phrase, boolean isError) {
this.myPhrase = phrase;
this.myPhraseBytes = HttpChannelUtils.getEnglishBytes(phrase);
this.myIntCode = code;
if (isError) {
this.myError = new HttpError(code, this.myPhrase);
}
initSpecialArrays();
checkForAllowedBody();
} | [
"protected",
"void",
"init",
"(",
"int",
"code",
",",
"String",
"phrase",
",",
"boolean",
"isError",
")",
"{",
"this",
".",
"myPhrase",
"=",
"phrase",
";",
"this",
".",
"myPhraseBytes",
"=",
"HttpChannelUtils",
".",
"getEnglishBytes",
"(",
"phrase",
")",
";",
"this",
".",
"myIntCode",
"=",
"code",
";",
"if",
"(",
"isError",
")",
"{",
"this",
".",
"myError",
"=",
"new",
"HttpError",
"(",
"code",
",",
"this",
".",
"myPhrase",
")",
";",
"}",
"initSpecialArrays",
"(",
")",
";",
"checkForAllowedBody",
"(",
")",
";",
"}"
] | Initialize this status code with the input information.
@param code
@param phrase
@param isError | [
"Initialize",
"this",
"status",
"code",
"with",
"the",
"input",
"information",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java#L182-L191 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java | StatusCodes.makeUndefinedValue | public static StatusCodes makeUndefinedValue(int value) {
StatusCodes code = new StatusCodes(StatusCodes.UNDEF);
code.name = Integer.toString(value);
code.byteArray = HttpChannelUtils.getEnglishBytes(code.getName());
code.myIntCode = value;
code.initSpecialArrays();
code.checkForAllowedBody();
code.hashcode = code.ordinal + code.name.hashCode();
code.undefined = true;
return code;
} | java | public static StatusCodes makeUndefinedValue(int value) {
StatusCodes code = new StatusCodes(StatusCodes.UNDEF);
code.name = Integer.toString(value);
code.byteArray = HttpChannelUtils.getEnglishBytes(code.getName());
code.myIntCode = value;
code.initSpecialArrays();
code.checkForAllowedBody();
code.hashcode = code.ordinal + code.name.hashCode();
code.undefined = true;
return code;
} | [
"public",
"static",
"StatusCodes",
"makeUndefinedValue",
"(",
"int",
"value",
")",
"{",
"StatusCodes",
"code",
"=",
"new",
"StatusCodes",
"(",
"StatusCodes",
".",
"UNDEF",
")",
";",
"code",
".",
"name",
"=",
"Integer",
".",
"toString",
"(",
"value",
")",
";",
"code",
".",
"byteArray",
"=",
"HttpChannelUtils",
".",
"getEnglishBytes",
"(",
"code",
".",
"getName",
"(",
")",
")",
";",
"code",
".",
"myIntCode",
"=",
"value",
";",
"code",
".",
"initSpecialArrays",
"(",
")",
";",
"code",
".",
"checkForAllowedBody",
"(",
")",
";",
"code",
".",
"hashcode",
"=",
"code",
".",
"ordinal",
"+",
"code",
".",
"name",
".",
"hashCode",
"(",
")",
";",
"code",
".",
"undefined",
"=",
"true",
";",
"return",
"code",
";",
"}"
] | Make a new "Undefined" enumerated value with the given input.
@param value
@return StatusCodes | [
"Make",
"a",
"new",
"Undefined",
"enumerated",
"value",
"with",
"the",
"given",
"input",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java#L199-L209 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java | StatusCodes.initSpecialArrays | protected void initSpecialArrays() {
int len = getByteArray().length;
// set up the "status code + SPACE + default reason phrase"
this.bytesWithPhrase = new byte[len + 1 + this.myPhraseBytes.length];
System.arraycopy(getByteArray(), 0, this.bytesWithPhrase, 0, len);
this.bytesWithPhrase[len] = BNFHeaders.SPACE;
System.arraycopy(this.myPhraseBytes, 0, this.bytesWithPhrase, len + 1, this.myPhraseBytes.length);
} | java | protected void initSpecialArrays() {
int len = getByteArray().length;
// set up the "status code + SPACE + default reason phrase"
this.bytesWithPhrase = new byte[len + 1 + this.myPhraseBytes.length];
System.arraycopy(getByteArray(), 0, this.bytesWithPhrase, 0, len);
this.bytesWithPhrase[len] = BNFHeaders.SPACE;
System.arraycopy(this.myPhraseBytes, 0, this.bytesWithPhrase, len + 1, this.myPhraseBytes.length);
} | [
"protected",
"void",
"initSpecialArrays",
"(",
")",
"{",
"int",
"len",
"=",
"getByteArray",
"(",
")",
".",
"length",
";",
"// set up the \"status code + SPACE + default reason phrase\"",
"this",
".",
"bytesWithPhrase",
"=",
"new",
"byte",
"[",
"len",
"+",
"1",
"+",
"this",
".",
"myPhraseBytes",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"getByteArray",
"(",
")",
",",
"0",
",",
"this",
".",
"bytesWithPhrase",
",",
"0",
",",
"len",
")",
";",
"this",
".",
"bytesWithPhrase",
"[",
"len",
"]",
"=",
"BNFHeaders",
".",
"SPACE",
";",
"System",
".",
"arraycopy",
"(",
"this",
".",
"myPhraseBytes",
",",
"0",
",",
"this",
".",
"bytesWithPhrase",
",",
"len",
"+",
"1",
",",
"this",
".",
"myPhraseBytes",
".",
"length",
")",
";",
"}"
] | Initialize the special arrays. | [
"Initialize",
"the",
"special",
"arrays",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java#L223-L230 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java | StatusCodes.getByOrdinal | public static StatusCodes getByOrdinal(int i) {
if (0 > i || i >= MAX_CODE) {
throw new IndexOutOfBoundsException("Index " + i + " is out of bounds");
}
return statusCodes[i];
} | java | public static StatusCodes getByOrdinal(int i) {
if (0 > i || i >= MAX_CODE) {
throw new IndexOutOfBoundsException("Index " + i + " is out of bounds");
}
return statusCodes[i];
} | [
"public",
"static",
"StatusCodes",
"getByOrdinal",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"0",
">",
"i",
"||",
"i",
">=",
"MAX_CODE",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Index \"",
"+",
"i",
"+",
"\" is out of bounds\"",
")",
";",
"}",
"return",
"statusCodes",
"[",
"i",
"]",
";",
"}"
] | Query the enumerated value that exists with the specified ordinal
value.
@param i
@return StatusCodes | [
"Query",
"the",
"enumerated",
"value",
"that",
"exists",
"with",
"the",
"specified",
"ordinal",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/values/StatusCodes.java#L249-L254 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/BundleRepositoryRegistry.java | BundleRepositoryRegistry.addBundleRepository | public synchronized static void addBundleRepository(String installDir, String featureType) {
BundleRepositoryHolder bundleRepositoryHolder = new BundleRepositoryHolder(installDir, cacheServerName, featureType);
if (!repositoryHolders.containsKey(featureType))
repositoryHolders.put(featureType, bundleRepositoryHolder);
} | java | public synchronized static void addBundleRepository(String installDir, String featureType) {
BundleRepositoryHolder bundleRepositoryHolder = new BundleRepositoryHolder(installDir, cacheServerName, featureType);
if (!repositoryHolders.containsKey(featureType))
repositoryHolders.put(featureType, bundleRepositoryHolder);
} | [
"public",
"synchronized",
"static",
"void",
"addBundleRepository",
"(",
"String",
"installDir",
",",
"String",
"featureType",
")",
"{",
"BundleRepositoryHolder",
"bundleRepositoryHolder",
"=",
"new",
"BundleRepositoryHolder",
"(",
"installDir",
",",
"cacheServerName",
",",
"featureType",
")",
";",
"if",
"(",
"!",
"repositoryHolders",
".",
"containsKey",
"(",
"featureType",
")",
")",
"repositoryHolders",
".",
"put",
"(",
"featureType",
",",
"bundleRepositoryHolder",
")",
";",
"}"
] | Add a bundle repository to the map if one for that feature type has not
already been added.
@param installDir The install location for the repository. This can vary, i.e. product extensions.
@param featureType The "name" for this repository. "" for default, "usr" for the user extension, etc. | [
"Add",
"a",
"bundle",
"repository",
"to",
"the",
"map",
"if",
"one",
"for",
"that",
"feature",
"type",
"has",
"not",
"already",
"been",
"added",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/BundleRepositoryRegistry.java#L68-L73 | train |
OpenLiberty/open-liberty | dev/com.ibm.json4j/src/com/ibm/json/java/OrderedJSONObject.java | OrderedJSONObject.put | public Object put(Object key, Object value)
{
if (null == key) throw new IllegalArgumentException("key must not be null");
if (!(key instanceof String)) throw new IllegalArgumentException("key must be a String");
if (!isValidObject(value))
{
if (value != null)
{
throw new IllegalArgumentException("Invalid type of value. Type: [" + value.getClass().getName() + "] with value: [" + value.toString() + "]");
}
else
{
throw new IllegalArgumentException("Invalid type of value.");
}
}
/**
* Only put it in the ordering list if it isn't already present.
*/
if (!this.containsKey(key))
{
this.order.add(key);
}
return super.put(key, value);
} | java | public Object put(Object key, Object value)
{
if (null == key) throw new IllegalArgumentException("key must not be null");
if (!(key instanceof String)) throw new IllegalArgumentException("key must be a String");
if (!isValidObject(value))
{
if (value != null)
{
throw new IllegalArgumentException("Invalid type of value. Type: [" + value.getClass().getName() + "] with value: [" + value.toString() + "]");
}
else
{
throw new IllegalArgumentException("Invalid type of value.");
}
}
/**
* Only put it in the ordering list if it isn't already present.
*/
if (!this.containsKey(key))
{
this.order.add(key);
}
return super.put(key, value);
} | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"null",
"==",
"key",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"key must not be null\"",
")",
";",
"if",
"(",
"!",
"(",
"key",
"instanceof",
"String",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"key must be a String\"",
")",
";",
"if",
"(",
"!",
"isValidObject",
"(",
"value",
")",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid type of value. Type: [\"",
"+",
"value",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\"] with value: [\"",
"+",
"value",
".",
"toString",
"(",
")",
"+",
"\"]\"",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid type of value.\"",
")",
";",
"}",
"}",
"/**\n * Only put it in the ordering list if it isn't already present.\n */",
"if",
"(",
"!",
"this",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"this",
".",
"order",
".",
"add",
"(",
"key",
")",
";",
"}",
"return",
"super",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Method to put a JSON'able object into the instance. Note that the order of initial puts controls the order of serialization.
Meaning that the first time an item is put into the object determines is position of serialization. Subsequent puts with the same
key replace the existing entry value and leave serialization position alone. For moving the position, the object must be removed,
then re-put.
@see java.util.HashMap#put(java.lang.Object, java.lang.Object) | [
"Method",
"to",
"put",
"a",
"JSON",
"able",
"object",
"into",
"the",
"instance",
".",
"Note",
"that",
"the",
"order",
"of",
"initial",
"puts",
"controls",
"the",
"order",
"of",
"serialization",
".",
"Meaning",
"that",
"the",
"first",
"time",
"an",
"item",
"is",
"put",
"into",
"the",
"object",
"determines",
"is",
"position",
"of",
"serialization",
".",
"Subsequent",
"puts",
"with",
"the",
"same",
"key",
"replace",
"the",
"existing",
"entry",
"value",
"and",
"leave",
"serialization",
"position",
"alone",
".",
"For",
"moving",
"the",
"position",
"the",
"object",
"must",
"be",
"removed",
"then",
"re",
"-",
"put",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/java/OrderedJSONObject.java#L109-L134 | train |
OpenLiberty/open-liberty | dev/com.ibm.json4j/src/com/ibm/json/java/OrderedJSONObject.java | OrderedJSONObject.remove | public Object remove(Object key)
{
Object retVal = null;
if (null == key) throw new IllegalArgumentException("key must not be null");
if (this.containsKey(key))
{
retVal = super.remove(key);
for (int i = 0; i < this.order.size(); i++)
{
Object obj = this.order.get(i);
if (obj.equals(key))
{
this.order.remove(i);
break;
}
}
}
return retVal;
} | java | public Object remove(Object key)
{
Object retVal = null;
if (null == key) throw new IllegalArgumentException("key must not be null");
if (this.containsKey(key))
{
retVal = super.remove(key);
for (int i = 0; i < this.order.size(); i++)
{
Object obj = this.order.get(i);
if (obj.equals(key))
{
this.order.remove(i);
break;
}
}
}
return retVal;
} | [
"public",
"Object",
"remove",
"(",
"Object",
"key",
")",
"{",
"Object",
"retVal",
"=",
"null",
";",
"if",
"(",
"null",
"==",
"key",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"key must not be null\"",
")",
";",
"if",
"(",
"this",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"retVal",
"=",
"super",
".",
"remove",
"(",
"key",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"order",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Object",
"obj",
"=",
"this",
".",
"order",
".",
"get",
"(",
"i",
")",
";",
"if",
"(",
"obj",
".",
"equals",
"(",
"key",
")",
")",
"{",
"this",
".",
"order",
".",
"remove",
"(",
"i",
")",
";",
"break",
";",
"}",
"}",
"}",
"return",
"retVal",
";",
"}"
] | Method to remove an entry from the OrderedJSONObject instance.
@see java.util.HashMap#remove(java.lang.Object) | [
"Method",
"to",
"remove",
"an",
"entry",
"from",
"the",
"OrderedJSONObject",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/java/OrderedJSONObject.java#L140-L160 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/CpuInfo.java | CpuInfo.getAvailableProcessorsFromFilesystem | private static int getAvailableProcessorsFromFilesystem() {
boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
Double availableProcessorsDouble = null;
int availableProcessorsInt = -1;
//Check for docker files
String periodFileLocation = File.separator + "sys" + File.separator + "fs" + File.separator + "cgroup" + File.separator + "cpu" + File.separator + "cpu.cfs_period_us";
String quotaFileLocation = File.separator + "sys" + File.separator + "fs" + File.separator + "cgroup" + File.separator + "cpu" + File.separator + "cpu.cfs_quota_us";
File cfsPeriod = new File(periodFileLocation);
File cfsQuota = new File(quotaFileLocation);
if (cfsPeriod.exists() && cfsQuota.exists()) { //Found docker files
//Read quota
try {
String quotaContents = readFile(cfsQuota);
double quotaFloat = new Double(quotaContents);
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "quotaFloat = " + quotaFloat);
if (quotaFloat >= 0) {
//Read period
String periodContents = readFile(cfsPeriod);
double periodFloat = new Double(periodContents);
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "periodFloat = " + periodFloat);
if (periodFloat != 0) {
availableProcessorsDouble = quotaFloat / periodFloat;
availableProcessorsDouble = roundToTwoDecimalPlaces(availableProcessorsDouble);
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "Calculated availableProcessors: " + availableProcessorsDouble + ". period=" + periodFloat + ", quota=" + quotaFloat);
}
}
} catch (Throwable e) {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "Caught exception: " + e.getMessage() + ". Using number of processors reported by java");
availableProcessorsDouble = null;
}
} else {
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(tc, "Files " + quotaFileLocation + " : " + cfsQuota.exists());
Tr.debug(tc, "Files " + periodFileLocation + " : " + cfsPeriod.exists());
}
}
availableProcessorsInt = (availableProcessorsDouble == null) ? -1 : availableProcessorsDouble.intValue();
// make sure any z.xy cpu quota was not rounded down (especially to 0 ...) during int conversion
if (availableProcessorsDouble != null && availableProcessorsDouble > availableProcessorsInt)
availableProcessorsInt++;
return availableProcessorsInt;
} | java | private static int getAvailableProcessorsFromFilesystem() {
boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
Double availableProcessorsDouble = null;
int availableProcessorsInt = -1;
//Check for docker files
String periodFileLocation = File.separator + "sys" + File.separator + "fs" + File.separator + "cgroup" + File.separator + "cpu" + File.separator + "cpu.cfs_period_us";
String quotaFileLocation = File.separator + "sys" + File.separator + "fs" + File.separator + "cgroup" + File.separator + "cpu" + File.separator + "cpu.cfs_quota_us";
File cfsPeriod = new File(periodFileLocation);
File cfsQuota = new File(quotaFileLocation);
if (cfsPeriod.exists() && cfsQuota.exists()) { //Found docker files
//Read quota
try {
String quotaContents = readFile(cfsQuota);
double quotaFloat = new Double(quotaContents);
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "quotaFloat = " + quotaFloat);
if (quotaFloat >= 0) {
//Read period
String periodContents = readFile(cfsPeriod);
double periodFloat = new Double(periodContents);
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "periodFloat = " + periodFloat);
if (periodFloat != 0) {
availableProcessorsDouble = quotaFloat / periodFloat;
availableProcessorsDouble = roundToTwoDecimalPlaces(availableProcessorsDouble);
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "Calculated availableProcessors: " + availableProcessorsDouble + ". period=" + periodFloat + ", quota=" + quotaFloat);
}
}
} catch (Throwable e) {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "Caught exception: " + e.getMessage() + ". Using number of processors reported by java");
availableProcessorsDouble = null;
}
} else {
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(tc, "Files " + quotaFileLocation + " : " + cfsQuota.exists());
Tr.debug(tc, "Files " + periodFileLocation + " : " + cfsPeriod.exists());
}
}
availableProcessorsInt = (availableProcessorsDouble == null) ? -1 : availableProcessorsDouble.intValue();
// make sure any z.xy cpu quota was not rounded down (especially to 0 ...) during int conversion
if (availableProcessorsDouble != null && availableProcessorsDouble > availableProcessorsInt)
availableProcessorsInt++;
return availableProcessorsInt;
} | [
"private",
"static",
"int",
"getAvailableProcessorsFromFilesystem",
"(",
")",
"{",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"Double",
"availableProcessorsDouble",
"=",
"null",
";",
"int",
"availableProcessorsInt",
"=",
"-",
"1",
";",
"//Check for docker files",
"String",
"periodFileLocation",
"=",
"File",
".",
"separator",
"+",
"\"sys\"",
"+",
"File",
".",
"separator",
"+",
"\"fs\"",
"+",
"File",
".",
"separator",
"+",
"\"cgroup\"",
"+",
"File",
".",
"separator",
"+",
"\"cpu\"",
"+",
"File",
".",
"separator",
"+",
"\"cpu.cfs_period_us\"",
";",
"String",
"quotaFileLocation",
"=",
"File",
".",
"separator",
"+",
"\"sys\"",
"+",
"File",
".",
"separator",
"+",
"\"fs\"",
"+",
"File",
".",
"separator",
"+",
"\"cgroup\"",
"+",
"File",
".",
"separator",
"+",
"\"cpu\"",
"+",
"File",
".",
"separator",
"+",
"\"cpu.cfs_quota_us\"",
";",
"File",
"cfsPeriod",
"=",
"new",
"File",
"(",
"periodFileLocation",
")",
";",
"File",
"cfsQuota",
"=",
"new",
"File",
"(",
"quotaFileLocation",
")",
";",
"if",
"(",
"cfsPeriod",
".",
"exists",
"(",
")",
"&&",
"cfsQuota",
".",
"exists",
"(",
")",
")",
"{",
"//Found docker files",
"//Read quota",
"try",
"{",
"String",
"quotaContents",
"=",
"readFile",
"(",
"cfsQuota",
")",
";",
"double",
"quotaFloat",
"=",
"new",
"Double",
"(",
"quotaContents",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"quotaFloat = \"",
"+",
"quotaFloat",
")",
";",
"if",
"(",
"quotaFloat",
">=",
"0",
")",
"{",
"//Read period",
"String",
"periodContents",
"=",
"readFile",
"(",
"cfsPeriod",
")",
";",
"double",
"periodFloat",
"=",
"new",
"Double",
"(",
"periodContents",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"periodFloat = \"",
"+",
"periodFloat",
")",
";",
"if",
"(",
"periodFloat",
"!=",
"0",
")",
"{",
"availableProcessorsDouble",
"=",
"quotaFloat",
"/",
"periodFloat",
";",
"availableProcessorsDouble",
"=",
"roundToTwoDecimalPlaces",
"(",
"availableProcessorsDouble",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Calculated availableProcessors: \"",
"+",
"availableProcessorsDouble",
"+",
"\". period=\"",
"+",
"periodFloat",
"+",
"\", quota=\"",
"+",
"quotaFloat",
")",
";",
"}",
"}",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Caught exception: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
"+",
"\". Using number of processors reported by java\"",
")",
";",
"availableProcessorsDouble",
"=",
"null",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Files \"",
"+",
"quotaFileLocation",
"+",
"\" : \"",
"+",
"cfsQuota",
".",
"exists",
"(",
")",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Files \"",
"+",
"periodFileLocation",
"+",
"\" : \"",
"+",
"cfsPeriod",
".",
"exists",
"(",
")",
")",
";",
"}",
"}",
"availableProcessorsInt",
"=",
"(",
"availableProcessorsDouble",
"==",
"null",
")",
"?",
"-",
"1",
":",
"availableProcessorsDouble",
".",
"intValue",
"(",
")",
";",
"// make sure any z.xy cpu quota was not rounded down (especially to 0 ...) during int conversion",
"if",
"(",
"availableProcessorsDouble",
"!=",
"null",
"&&",
"availableProcessorsDouble",
">",
"availableProcessorsInt",
")",
"availableProcessorsInt",
"++",
";",
"return",
"availableProcessorsInt",
";",
"}"
] | utility below parses cpu limits info from Docker files | [
"utility",
"below",
"parses",
"cpu",
"limits",
"info",
"from",
"Docker",
"files"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/CpuInfo.java#L150-L200 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestProbeService.java | RequestProbeService.processAllEntryProbeExtensions | public static void processAllEntryProbeExtensions(Event event, RequestContext requestContext) {
if (event == requestContext.getRootEvent()) {
// Add the request to Active Request list
requestContext.setRequestContextIndex(activeRequests.add(requestContext));
}
List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
for (int i = 0; i < probeExtnList.size(); i ++) {
ProbeExtension probeExtension = probeExtnList.get(i);
try{
// Entry enabled??
if (probeExtension.invokeForEventEntry()) {
// To be sampled ??
if (requestContext.getRequestId().getSequenceNumber() % probeExtension.getRequestSampleRate() == 0) {
if (event == requestContext.getRootEvent() && probeExtension.invokeForRootEventsOnly() == true
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processEntryEvent(event, requestContext);
}
if (probeExtension.invokeForRootEventsOnly() == false
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processEntryEvent(event, requestContext);
}
}
}
}catch(Exception e){
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
Tr.debug(tc, "----------------Probe extension invocation failure---------------");
Tr.debug(tc, probeExtension.getClass().getName() + ".processEntryEvent failed because of the following reason:" );
Tr.debug(tc, e.getMessage());
}
FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllEntryProbeExtensions", "148");
}
}
} | java | public static void processAllEntryProbeExtensions(Event event, RequestContext requestContext) {
if (event == requestContext.getRootEvent()) {
// Add the request to Active Request list
requestContext.setRequestContextIndex(activeRequests.add(requestContext));
}
List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
for (int i = 0; i < probeExtnList.size(); i ++) {
ProbeExtension probeExtension = probeExtnList.get(i);
try{
// Entry enabled??
if (probeExtension.invokeForEventEntry()) {
// To be sampled ??
if (requestContext.getRequestId().getSequenceNumber() % probeExtension.getRequestSampleRate() == 0) {
if (event == requestContext.getRootEvent() && probeExtension.invokeForRootEventsOnly() == true
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processEntryEvent(event, requestContext);
}
if (probeExtension.invokeForRootEventsOnly() == false
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processEntryEvent(event, requestContext);
}
}
}
}catch(Exception e){
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
Tr.debug(tc, "----------------Probe extension invocation failure---------------");
Tr.debug(tc, probeExtension.getClass().getName() + ".processEntryEvent failed because of the following reason:" );
Tr.debug(tc, e.getMessage());
}
FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllEntryProbeExtensions", "148");
}
}
} | [
"public",
"static",
"void",
"processAllEntryProbeExtensions",
"(",
"Event",
"event",
",",
"RequestContext",
"requestContext",
")",
"{",
"if",
"(",
"event",
"==",
"requestContext",
".",
"getRootEvent",
"(",
")",
")",
"{",
"// Add the request to Active Request list",
"requestContext",
".",
"setRequestContextIndex",
"(",
"activeRequests",
".",
"add",
"(",
"requestContext",
")",
")",
";",
"}",
"List",
"<",
"ProbeExtension",
">",
"probeExtnList",
"=",
"RequestProbeService",
".",
"getProbeExtensions",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"probeExtnList",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"ProbeExtension",
"probeExtension",
"=",
"probeExtnList",
".",
"get",
"(",
"i",
")",
";",
"try",
"{",
"// Entry enabled??",
"if",
"(",
"probeExtension",
".",
"invokeForEventEntry",
"(",
")",
")",
"{",
"// To be sampled ??",
"if",
"(",
"requestContext",
".",
"getRequestId",
"(",
")",
".",
"getSequenceNumber",
"(",
")",
"%",
"probeExtension",
".",
"getRequestSampleRate",
"(",
")",
"==",
"0",
")",
"{",
"if",
"(",
"event",
"==",
"requestContext",
".",
"getRootEvent",
"(",
")",
"&&",
"probeExtension",
".",
"invokeForRootEventsOnly",
"(",
")",
"==",
"true",
"&&",
"(",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
"==",
"null",
"||",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
".",
"contains",
"(",
"event",
".",
"getType",
"(",
")",
")",
")",
")",
"{",
"probeExtension",
".",
"processEntryEvent",
"(",
"event",
",",
"requestContext",
")",
";",
"}",
"if",
"(",
"probeExtension",
".",
"invokeForRootEventsOnly",
"(",
")",
"==",
"false",
"&&",
"(",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
"==",
"null",
"||",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
".",
"contains",
"(",
"event",
".",
"getType",
"(",
")",
")",
")",
")",
"{",
"probeExtension",
".",
"processEntryEvent",
"(",
"event",
",",
"requestContext",
")",
";",
"}",
"}",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"----------------Probe extension invocation failure---------------\"",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"probeExtension",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\".processEntryEvent failed because of the following reason:\"",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"RequestProbeService",
".",
"class",
".",
"getName",
"(",
")",
"+",
"\".processAllEntryProbeExtensions\"",
",",
"\"148\"",
")",
";",
"}",
"}",
"}"
] | Iterate through all the probe extensions and process all the entry method
of the available probe extension
@param event
: Event for which the probe extensions to be processed.
@param requestContext
: Request context for the active request. | [
"Iterate",
"through",
"all",
"the",
"probe",
"extensions",
"and",
"process",
"all",
"the",
"entry",
"method",
"of",
"the",
"available",
"probe",
"extension"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestProbeService.java#L124-L157 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestProbeService.java | RequestProbeService.processAllExitProbeExtensions | public static void processAllExitProbeExtensions(Event event, RequestContext requestContext) {
List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
for (int i = 0; i < probeExtnList.size(); i ++) {
ProbeExtension probeExtension = probeExtnList.get(i);
try{
// Exit enabled??
if (probeExtension.invokeForEventExit()) {
// To be sampled ??
if (requestContext.getRequestId().getSequenceNumber() % probeExtension.getRequestSampleRate() == 0) {
if (event == requestContext.getRootEvent() && probeExtension.invokeForRootEventsOnly() == true
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processExitEvent(event, requestContext);
}
if (probeExtension.invokeForRootEventsOnly() == false
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processExitEvent(event, requestContext);
}
}
}
}catch(Exception e){
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
Tr.debug(tc, "----------------Probe extension invocation failure---------------");
Tr.debug(tc, probeExtension.getClass().getName() + ".processExitEvent failed because of the following reason:" );
Tr.debug(tc, e.getMessage());
}
FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllExitProbeExtensions", "185");
}
}
if (event == requestContext.getRootEvent()) {
// Remove the request from active request list
try{
RequestContext storedRequestContext = activeRequests.get(requestContext.getRequestContextIndex());
// 1) Check to handle stale requests.
// A long running stale request from the last time the feature was enabled could potentially
// end up evicting a valid request that is occupying the same slot in the list.
// 2) Also check if the returned request context is null, this can happen when we remove the feature while
// a request is executing as we clean up the active requests list and the slot no longer holds a request context.
if(storedRequestContext != null && (storedRequestContext.getRequestId() == requestContext.getRequestId()))
activeRequests.remove(requestContext.getRequestContextIndex());
}catch(ArrayIndexOutOfBoundsException e){
//Do nothing as this can fail for an in-flight request when the feature is disabled
//Rational being, the active request list gets reset and this index can no longer be valid.
}
}
} | java | public static void processAllExitProbeExtensions(Event event, RequestContext requestContext) {
List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
for (int i = 0; i < probeExtnList.size(); i ++) {
ProbeExtension probeExtension = probeExtnList.get(i);
try{
// Exit enabled??
if (probeExtension.invokeForEventExit()) {
// To be sampled ??
if (requestContext.getRequestId().getSequenceNumber() % probeExtension.getRequestSampleRate() == 0) {
if (event == requestContext.getRootEvent() && probeExtension.invokeForRootEventsOnly() == true
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processExitEvent(event, requestContext);
}
if (probeExtension.invokeForRootEventsOnly() == false
&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
probeExtension.processExitEvent(event, requestContext);
}
}
}
}catch(Exception e){
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
Tr.debug(tc, "----------------Probe extension invocation failure---------------");
Tr.debug(tc, probeExtension.getClass().getName() + ".processExitEvent failed because of the following reason:" );
Tr.debug(tc, e.getMessage());
}
FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllExitProbeExtensions", "185");
}
}
if (event == requestContext.getRootEvent()) {
// Remove the request from active request list
try{
RequestContext storedRequestContext = activeRequests.get(requestContext.getRequestContextIndex());
// 1) Check to handle stale requests.
// A long running stale request from the last time the feature was enabled could potentially
// end up evicting a valid request that is occupying the same slot in the list.
// 2) Also check if the returned request context is null, this can happen when we remove the feature while
// a request is executing as we clean up the active requests list and the slot no longer holds a request context.
if(storedRequestContext != null && (storedRequestContext.getRequestId() == requestContext.getRequestId()))
activeRequests.remove(requestContext.getRequestContextIndex());
}catch(ArrayIndexOutOfBoundsException e){
//Do nothing as this can fail for an in-flight request when the feature is disabled
//Rational being, the active request list gets reset and this index can no longer be valid.
}
}
} | [
"public",
"static",
"void",
"processAllExitProbeExtensions",
"(",
"Event",
"event",
",",
"RequestContext",
"requestContext",
")",
"{",
"List",
"<",
"ProbeExtension",
">",
"probeExtnList",
"=",
"RequestProbeService",
".",
"getProbeExtensions",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"probeExtnList",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"ProbeExtension",
"probeExtension",
"=",
"probeExtnList",
".",
"get",
"(",
"i",
")",
";",
"try",
"{",
"// Exit enabled??",
"if",
"(",
"probeExtension",
".",
"invokeForEventExit",
"(",
")",
")",
"{",
"// To be sampled ??",
"if",
"(",
"requestContext",
".",
"getRequestId",
"(",
")",
".",
"getSequenceNumber",
"(",
")",
"%",
"probeExtension",
".",
"getRequestSampleRate",
"(",
")",
"==",
"0",
")",
"{",
"if",
"(",
"event",
"==",
"requestContext",
".",
"getRootEvent",
"(",
")",
"&&",
"probeExtension",
".",
"invokeForRootEventsOnly",
"(",
")",
"==",
"true",
"&&",
"(",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
"==",
"null",
"||",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
".",
"contains",
"(",
"event",
".",
"getType",
"(",
")",
")",
")",
")",
"{",
"probeExtension",
".",
"processExitEvent",
"(",
"event",
",",
"requestContext",
")",
";",
"}",
"if",
"(",
"probeExtension",
".",
"invokeForRootEventsOnly",
"(",
")",
"==",
"false",
"&&",
"(",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
"==",
"null",
"||",
"probeExtension",
".",
"invokeForEventTypes",
"(",
")",
".",
"contains",
"(",
"event",
".",
"getType",
"(",
")",
")",
")",
")",
"{",
"probeExtension",
".",
"processExitEvent",
"(",
"event",
",",
"requestContext",
")",
";",
"}",
"}",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"----------------Probe extension invocation failure---------------\"",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"probeExtension",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\".processExitEvent failed because of the following reason:\"",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"RequestProbeService",
".",
"class",
".",
"getName",
"(",
")",
"+",
"\".processAllExitProbeExtensions\"",
",",
"\"185\"",
")",
";",
"}",
"}",
"if",
"(",
"event",
"==",
"requestContext",
".",
"getRootEvent",
"(",
")",
")",
"{",
"// Remove the request from active request list",
"try",
"{",
"RequestContext",
"storedRequestContext",
"=",
"activeRequests",
".",
"get",
"(",
"requestContext",
".",
"getRequestContextIndex",
"(",
")",
")",
";",
"// 1) Check to handle stale requests.",
"// A long running stale request from the last time the feature was enabled could potentially ",
"// end up evicting a valid request that is occupying the same slot in the list.",
"// 2) Also check if the returned request context is null, this can happen when we remove the feature while",
"// a request is executing as we clean up the active requests list and the slot no longer holds a request context.",
"if",
"(",
"storedRequestContext",
"!=",
"null",
"&&",
"(",
"storedRequestContext",
".",
"getRequestId",
"(",
")",
"==",
"requestContext",
".",
"getRequestId",
"(",
")",
")",
")",
"activeRequests",
".",
"remove",
"(",
"requestContext",
".",
"getRequestContextIndex",
"(",
")",
")",
";",
"}",
"catch",
"(",
"ArrayIndexOutOfBoundsException",
"e",
")",
"{",
"//Do nothing as this can fail for an in-flight request when the feature is disabled",
"//Rational being, the active request list gets reset and this index can no longer be valid.",
"}",
"}",
"}"
] | Iterate through all the probe extensions and process all the exit method
of the available probe extension
@param event
: Event for which the probe extensions to be processed.
@param requestContext
: Request context for the active request. | [
"Iterate",
"through",
"all",
"the",
"probe",
"extensions",
"and",
"process",
"all",
"the",
"exit",
"method",
"of",
"the",
"available",
"probe",
"extension"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestProbeService.java#L168-L213 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestProbeService.java | RequestProbeService.processAllCounterProbeExtensions | public static void processAllCounterProbeExtensions(Event event){
List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
for (int i = 0; i < probeExtnList.size(); i ++) {
ProbeExtension probeExtension = probeExtnList.get(i);
try{
//Check if this probe extension is interested in
//counter events
if(probeExtension.invokeForCounter()){
probeExtension.processCounter(event);
}
}catch(Exception e){
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
Tr.debug(tc, "----------------Probe extension invocation failure---------------");
Tr.debug(tc, probeExtension.getClass().getName() + ".processCounterEvent failed because of the following reason:" );
Tr.debug(tc, e.getMessage());
}
FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllCounterProbeExtensions", "215");
}
}
} | java | public static void processAllCounterProbeExtensions(Event event){
List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
for (int i = 0; i < probeExtnList.size(); i ++) {
ProbeExtension probeExtension = probeExtnList.get(i);
try{
//Check if this probe extension is interested in
//counter events
if(probeExtension.invokeForCounter()){
probeExtension.processCounter(event);
}
}catch(Exception e){
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
Tr.debug(tc, "----------------Probe extension invocation failure---------------");
Tr.debug(tc, probeExtension.getClass().getName() + ".processCounterEvent failed because of the following reason:" );
Tr.debug(tc, e.getMessage());
}
FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllCounterProbeExtensions", "215");
}
}
} | [
"public",
"static",
"void",
"processAllCounterProbeExtensions",
"(",
"Event",
"event",
")",
"{",
"List",
"<",
"ProbeExtension",
">",
"probeExtnList",
"=",
"RequestProbeService",
".",
"getProbeExtensions",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"probeExtnList",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"ProbeExtension",
"probeExtension",
"=",
"probeExtnList",
".",
"get",
"(",
"i",
")",
";",
"try",
"{",
"//Check if this probe extension is interested in ",
"//counter events",
"if",
"(",
"probeExtension",
".",
"invokeForCounter",
"(",
")",
")",
"{",
"probeExtension",
".",
"processCounter",
"(",
"event",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"----------------Probe extension invocation failure---------------\"",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"probeExtension",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\".processCounterEvent failed because of the following reason:\"",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"RequestProbeService",
".",
"class",
".",
"getName",
"(",
")",
"+",
"\".processAllCounterProbeExtensions\"",
",",
"\"215\"",
")",
";",
"}",
"}",
"}"
] | Iterate through all the probe extensions and process the counter methods
of interested probe extensions
@param event
: Event for which the probe extensions to be processed. | [
"Iterate",
"through",
"all",
"the",
"probe",
"extensions",
"and",
"process",
"the",
"counter",
"methods",
"of",
"interested",
"probe",
"extensions"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.request.probes/src/com/ibm/ws/request/probe/RequestProbeService.java#L222-L242 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java | TokenPropagationHelper.setSecurityService | @Reference(name = KEY_SECURITY_SERVICE, policy = ReferencePolicy.DYNAMIC)
protected void setSecurityService(SecurityService securitysvc) {
securityService = securitysvc;
} | java | @Reference(name = KEY_SECURITY_SERVICE, policy = ReferencePolicy.DYNAMIC)
protected void setSecurityService(SecurityService securitysvc) {
securityService = securitysvc;
} | [
"@",
"Reference",
"(",
"name",
"=",
"KEY_SECURITY_SERVICE",
",",
"policy",
"=",
"ReferencePolicy",
".",
"DYNAMIC",
")",
"protected",
"void",
"setSecurityService",
"(",
"SecurityService",
"securitysvc",
")",
"{",
"securityService",
"=",
"securitysvc",
";",
"}"
] | serviceReferences are bad, avoid and do this instead. | [
"serviceReferences",
"are",
"bad",
"avoid",
"and",
"do",
"this",
"instead",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java#L73-L76 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java | TokenPropagationHelper.getUserName | public static String getUserName() throws Exception {
Subject subject = getRunAsSubjectInternal();
if (subject == null) {
return null;
}
Set<Principal> principals = subject.getPrincipals();
Iterator<Principal> principalsIterator = principals.iterator();
if (principalsIterator.hasNext()) {
Principal principal = principalsIterator.next();
return principal.getName();
}
return null;
} | java | public static String getUserName() throws Exception {
Subject subject = getRunAsSubjectInternal();
if (subject == null) {
return null;
}
Set<Principal> principals = subject.getPrincipals();
Iterator<Principal> principalsIterator = principals.iterator();
if (principalsIterator.hasNext()) {
Principal principal = principalsIterator.next();
return principal.getName();
}
return null;
} | [
"public",
"static",
"String",
"getUserName",
"(",
")",
"throws",
"Exception",
"{",
"Subject",
"subject",
"=",
"getRunAsSubjectInternal",
"(",
")",
";",
"if",
"(",
"subject",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Set",
"<",
"Principal",
">",
"principals",
"=",
"subject",
".",
"getPrincipals",
"(",
")",
";",
"Iterator",
"<",
"Principal",
">",
"principalsIterator",
"=",
"principals",
".",
"iterator",
"(",
")",
";",
"if",
"(",
"principalsIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"Principal",
"principal",
"=",
"principalsIterator",
".",
"next",
"(",
")",
";",
"return",
"principal",
".",
"getName",
"(",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Gets the username from the principal of the subject.
@return
@throws WSSecurityException | [
"Gets",
"the",
"username",
"from",
"the",
"principal",
"of",
"the",
"subject",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java#L157-L169 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java | TokenPropagationHelper.pushSubject | public static synchronized boolean pushSubject(String username) {
if (securityService == null || username == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "returning false because user or securityService is null,"
+ " user= " + username + " secsvc= " + securityService);
}
return false;
}
AuthenticationService authenticationService = securityService.getAuthenticationService();
Subject tempSubject = new Subject();
Hashtable<String, Object> hashtable = new Hashtable<String, Object>();
if (!authenticationService.isAllowHashTableLoginWithIdOnly()) {
hashtable.put(AuthenticationConstants.INTERNAL_ASSERTION_KEY, Boolean.TRUE);
}
hashtable.put("com.ibm.wsspi.security.cred.userId", username);
tempSubject.getPublicCredentials().add(hashtable);
try {
Subject new_subject = authenticationService.authenticate(JaasLoginConfigConstants.SYSTEM_WEB_INBOUND, tempSubject);
return setRunAsSubject(new_subject);
} catch (AuthenticationException e) {
FFDCFilter.processException(e,
TokenPropagationHelper.class.getName(), "pushSubject",
new Object[] { username });
Tr.error(tc, "ERROR_AUTHENTICATE", new Object[] { e.getMessage() }); // CWWKS6103E
return false;
} catch (Exception e) {
FFDCFilter.processException(e,
TokenPropagationHelper.class.getName(), "pushSubject",
new Object[] { username });
return false;
}
} | java | public static synchronized boolean pushSubject(String username) {
if (securityService == null || username == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "returning false because user or securityService is null,"
+ " user= " + username + " secsvc= " + securityService);
}
return false;
}
AuthenticationService authenticationService = securityService.getAuthenticationService();
Subject tempSubject = new Subject();
Hashtable<String, Object> hashtable = new Hashtable<String, Object>();
if (!authenticationService.isAllowHashTableLoginWithIdOnly()) {
hashtable.put(AuthenticationConstants.INTERNAL_ASSERTION_KEY, Boolean.TRUE);
}
hashtable.put("com.ibm.wsspi.security.cred.userId", username);
tempSubject.getPublicCredentials().add(hashtable);
try {
Subject new_subject = authenticationService.authenticate(JaasLoginConfigConstants.SYSTEM_WEB_INBOUND, tempSubject);
return setRunAsSubject(new_subject);
} catch (AuthenticationException e) {
FFDCFilter.processException(e,
TokenPropagationHelper.class.getName(), "pushSubject",
new Object[] { username });
Tr.error(tc, "ERROR_AUTHENTICATE", new Object[] { e.getMessage() }); // CWWKS6103E
return false;
} catch (Exception e) {
FFDCFilter.processException(e,
TokenPropagationHelper.class.getName(), "pushSubject",
new Object[] { username });
return false;
}
} | [
"public",
"static",
"synchronized",
"boolean",
"pushSubject",
"(",
"String",
"username",
")",
"{",
"if",
"(",
"securityService",
"==",
"null",
"||",
"username",
"==",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"returning false because user or securityService is null,\"",
"+",
"\" user= \"",
"+",
"username",
"+",
"\" secsvc= \"",
"+",
"securityService",
")",
";",
"}",
"return",
"false",
";",
"}",
"AuthenticationService",
"authenticationService",
"=",
"securityService",
".",
"getAuthenticationService",
"(",
")",
";",
"Subject",
"tempSubject",
"=",
"new",
"Subject",
"(",
")",
";",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"hashtable",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"if",
"(",
"!",
"authenticationService",
".",
"isAllowHashTableLoginWithIdOnly",
"(",
")",
")",
"{",
"hashtable",
".",
"put",
"(",
"AuthenticationConstants",
".",
"INTERNAL_ASSERTION_KEY",
",",
"Boolean",
".",
"TRUE",
")",
";",
"}",
"hashtable",
".",
"put",
"(",
"\"com.ibm.wsspi.security.cred.userId\"",
",",
"username",
")",
";",
"tempSubject",
".",
"getPublicCredentials",
"(",
")",
".",
"add",
"(",
"hashtable",
")",
";",
"try",
"{",
"Subject",
"new_subject",
"=",
"authenticationService",
".",
"authenticate",
"(",
"JaasLoginConfigConstants",
".",
"SYSTEM_WEB_INBOUND",
",",
"tempSubject",
")",
";",
"return",
"setRunAsSubject",
"(",
"new_subject",
")",
";",
"}",
"catch",
"(",
"AuthenticationException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"TokenPropagationHelper",
".",
"class",
".",
"getName",
"(",
")",
",",
"\"pushSubject\"",
",",
"new",
"Object",
"[",
"]",
"{",
"username",
"}",
")",
";",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"ERROR_AUTHENTICATE\"",
",",
"new",
"Object",
"[",
"]",
"{",
"e",
".",
"getMessage",
"(",
")",
"}",
")",
";",
"// CWWKS6103E",
"return",
"false",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"TokenPropagationHelper",
".",
"class",
".",
"getName",
"(",
")",
",",
"\"pushSubject\"",
",",
"new",
"Object",
"[",
"]",
"{",
"username",
"}",
")",
";",
"return",
"false",
";",
"}",
"}"
] | Authenticate the username, create it's Subject and push it on to the thread.
It's up to the caller to save off the prior subject and make sure it gets restored,
and guard against any threading issues.
@param username
@return true if successful | [
"Authenticate",
"the",
"username",
"create",
"it",
"s",
"Subject",
"and",
"push",
"it",
"on",
"to",
"the",
"thread",
".",
"It",
"s",
"up",
"to",
"the",
"caller",
"to",
"save",
"off",
"the",
"prior",
"subject",
"and",
"make",
"sure",
"it",
"gets",
"restored",
"and",
"guard",
"against",
"any",
"threading",
"issues",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java#L253-L286 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java | TokenPropagationHelper.setRunAsSubject | public static synchronized boolean setRunAsSubject(Subject subj) {
Subject before = null;
try {
before = getRunAsSubject();
final Subject fsubj = subj;
AccessController.doPrivileged(
new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
WSSubject.setRunAsSubject(fsubj);
return null;
}
});
} catch (PrivilegedActionException e) {
FFDCFilter.processException(e,
TokenPropagationHelper.class.getName(), "setRunAsSubject",
new Object[] {});
return false;
}
if (tc.isDebugEnabled()) {
Tr.debug(tc, "setRunAsSubject, runAsSubject before = ", before);
Tr.debug(tc, "setRunAsSubject, runAsSubject after = ", subj);
}
return true;
} | java | public static synchronized boolean setRunAsSubject(Subject subj) {
Subject before = null;
try {
before = getRunAsSubject();
final Subject fsubj = subj;
AccessController.doPrivileged(
new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
WSSubject.setRunAsSubject(fsubj);
return null;
}
});
} catch (PrivilegedActionException e) {
FFDCFilter.processException(e,
TokenPropagationHelper.class.getName(), "setRunAsSubject",
new Object[] {});
return false;
}
if (tc.isDebugEnabled()) {
Tr.debug(tc, "setRunAsSubject, runAsSubject before = ", before);
Tr.debug(tc, "setRunAsSubject, runAsSubject after = ", subj);
}
return true;
} | [
"public",
"static",
"synchronized",
"boolean",
"setRunAsSubject",
"(",
"Subject",
"subj",
")",
"{",
"Subject",
"before",
"=",
"null",
";",
"try",
"{",
"before",
"=",
"getRunAsSubject",
"(",
")",
";",
"final",
"Subject",
"fsubj",
"=",
"subj",
";",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"Object",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Object",
"run",
"(",
")",
"throws",
"Exception",
"{",
"WSSubject",
".",
"setRunAsSubject",
"(",
"fsubj",
")",
";",
"return",
"null",
";",
"}",
"}",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"TokenPropagationHelper",
".",
"class",
".",
"getName",
"(",
")",
",",
"\"setRunAsSubject\"",
",",
"new",
"Object",
"[",
"]",
"{",
"}",
")",
";",
"return",
"false",
";",
"}",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setRunAsSubject, runAsSubject before = \"",
",",
"before",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setRunAsSubject, runAsSubject after = \"",
",",
"subj",
")",
";",
"}",
"return",
"true",
";",
"}"
] | set the runAsSubject. Contain any exceptions with FFDC.
@param subj
- the subject to push onto the thread.
@return true if successful | [
"set",
"the",
"runAsSubject",
".",
"Contain",
"any",
"exceptions",
"with",
"FFDC",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/token/propagation/TokenPropagationHelper.java#L295-L322 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/TopicWildcardTranslation.java | TopicWildcardTranslation.getInstance | public static TopicWildcardTranslation getInstance() throws Exception
{
if (tcInt.isEntryEnabled()) Tr.entry(tcInt, "getInstance");
if (twt == null)
{
try
{
Class cls = Class.forName(UtConstants.TWT_FACTORY_CLASS);
twt = (TopicWildcardTranslation) cls.newInstance();
}
catch(InstantiationException ie)
{
// No FFDC code needed
if (tcInt.isDebugEnabled())Tr.debug(tcInt, "Unable to instantiate TopicWildcardTranslation", ie);
if (tcInt.isEntryEnabled())Tr.exit(tcInt, "getInstance");
twt = null;
throw ie;
}
}
if (tcInt.isEntryEnabled()) Tr.exit(tcInt, "getInstance");
return twt;
} | java | public static TopicWildcardTranslation getInstance() throws Exception
{
if (tcInt.isEntryEnabled()) Tr.entry(tcInt, "getInstance");
if (twt == null)
{
try
{
Class cls = Class.forName(UtConstants.TWT_FACTORY_CLASS);
twt = (TopicWildcardTranslation) cls.newInstance();
}
catch(InstantiationException ie)
{
// No FFDC code needed
if (tcInt.isDebugEnabled())Tr.debug(tcInt, "Unable to instantiate TopicWildcardTranslation", ie);
if (tcInt.isEntryEnabled())Tr.exit(tcInt, "getInstance");
twt = null;
throw ie;
}
}
if (tcInt.isEntryEnabled()) Tr.exit(tcInt, "getInstance");
return twt;
} | [
"public",
"static",
"TopicWildcardTranslation",
"getInstance",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"tcInt",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tcInt",
",",
"\"getInstance\"",
")",
";",
"if",
"(",
"twt",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
"cls",
"=",
"Class",
".",
"forName",
"(",
"UtConstants",
".",
"TWT_FACTORY_CLASS",
")",
";",
"twt",
"=",
"(",
"TopicWildcardTranslation",
")",
"cls",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"InstantiationException",
"ie",
")",
"{",
"// No FFDC code needed",
"if",
"(",
"tcInt",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tcInt",
",",
"\"Unable to instantiate TopicWildcardTranslation\"",
",",
"ie",
")",
";",
"if",
"(",
"tcInt",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tcInt",
",",
"\"getInstance\"",
")",
";",
"twt",
"=",
"null",
";",
"throw",
"ie",
";",
"}",
"}",
"if",
"(",
"tcInt",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tcInt",
",",
"\"getInstance\"",
")",
";",
"return",
"twt",
";",
"}"
] | Obtain the singleton instance of the wildcard mapping class.
@return TopicWildcardTranslation singleton object
@throws Exception If it was not possible to instantiate the implementation class | [
"Obtain",
"the",
"singleton",
"instance",
"of",
"the",
"wildcard",
"mapping",
"class",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/TopicWildcardTranslation.java#L41-L67 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/model/FilterVersion.java | FilterVersion.getFilterRange | public static VersionRange getFilterRange(FilterVersion minVersion, FilterVersion maxVersion) {
VersionRange vr = null;
Version vmin = minVersion == null ? Version.emptyVersion : new Version(minVersion.getValue());
Version vmax = maxVersion == null ? null : new Version(maxVersion.getValue());
char leftType = (minVersion == null || minVersion.getInclusive()) ? VersionRange.LEFT_CLOSED : VersionRange.LEFT_OPEN;
char rightType = (maxVersion == null || maxVersion.getInclusive()) ? VersionRange.RIGHT_CLOSED : VersionRange.RIGHT_OPEN;
vr = new VersionRange(leftType, vmin, vmax, rightType);
return vr;
} | java | public static VersionRange getFilterRange(FilterVersion minVersion, FilterVersion maxVersion) {
VersionRange vr = null;
Version vmin = minVersion == null ? Version.emptyVersion : new Version(minVersion.getValue());
Version vmax = maxVersion == null ? null : new Version(maxVersion.getValue());
char leftType = (minVersion == null || minVersion.getInclusive()) ? VersionRange.LEFT_CLOSED : VersionRange.LEFT_OPEN;
char rightType = (maxVersion == null || maxVersion.getInclusive()) ? VersionRange.RIGHT_CLOSED : VersionRange.RIGHT_OPEN;
vr = new VersionRange(leftType, vmin, vmax, rightType);
return vr;
} | [
"public",
"static",
"VersionRange",
"getFilterRange",
"(",
"FilterVersion",
"minVersion",
",",
"FilterVersion",
"maxVersion",
")",
"{",
"VersionRange",
"vr",
"=",
"null",
";",
"Version",
"vmin",
"=",
"minVersion",
"==",
"null",
"?",
"Version",
".",
"emptyVersion",
":",
"new",
"Version",
"(",
"minVersion",
".",
"getValue",
"(",
")",
")",
";",
"Version",
"vmax",
"=",
"maxVersion",
"==",
"null",
"?",
"null",
":",
"new",
"Version",
"(",
"maxVersion",
".",
"getValue",
"(",
")",
")",
";",
"char",
"leftType",
"=",
"(",
"minVersion",
"==",
"null",
"||",
"minVersion",
".",
"getInclusive",
"(",
")",
")",
"?",
"VersionRange",
".",
"LEFT_CLOSED",
":",
"VersionRange",
".",
"LEFT_OPEN",
";",
"char",
"rightType",
"=",
"(",
"maxVersion",
"==",
"null",
"||",
"maxVersion",
".",
"getInclusive",
"(",
")",
")",
"?",
"VersionRange",
".",
"RIGHT_CLOSED",
":",
"VersionRange",
".",
"RIGHT_OPEN",
";",
"vr",
"=",
"new",
"VersionRange",
"(",
"leftType",
",",
"vmin",
",",
"vmax",
",",
"rightType",
")",
";",
"return",
"vr",
";",
"}"
] | This method creates a version range from the supplied min and max FilterVersion
@param minVersion The min version in the range. Can be null, if so treated as {@link Version#emptyVersion}
@param maxVersion The max version. Can be null, null in a version range is treated as infinite
@return A version range object representing the min and max values supplied | [
"This",
"method",
"creates",
"a",
"version",
"range",
"from",
"the",
"supplied",
"min",
"and",
"max",
"FilterVersion"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/model/FilterVersion.java#L111-L119 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/FileLogSet.java | FileLogSet.update | public boolean update(File directory, String fileName, String fileExtension, int maxFiles) {
this.maxFiles = maxFiles;
boolean updateLocation = !directory.equals(this.directory) || !fileName.equals(this.fileName) || !fileExtension.equals(this.fileExtension);
if (updateLocation) {
this.directory = directory;
this.fileName = fileName;
this.fileExtension = fileExtension;
filePattern = LoggingFileUtils.compileLogFileRegex(fileName, fileExtension);
// The location was updated, so remove our list of cached files.
files = null;
}
if (maxFiles <= 0) {
files = null;
} else {
if (files == null) {
files = new ArrayList<String>();
// Sort and add all existing files.
String[] existing = LoggingFileUtils.safelyFindFiles(directory, filePattern);
if (existing != null) {
Arrays.sort(existing, NaturalComparator.instance);
files.addAll(Arrays.asList(existing));
}
}
// Delete excess old files if necessary.
int maxTrackedFiles = getMaxDateFiles();
while (files.size() > maxTrackedFiles) {
removeFile(0);
}
// If the location was updated, initialize the counter from the
// remaining files (if any).
if (updateLocation) {
if (files.isEmpty()) {
lastDateString = null;
} else {
Matcher matcher = filePattern.matcher(files.get(files.size() - 1));
if (!matcher.matches())
throw new IllegalStateException();
lastDateString = matcher.group(1);
lastCounter = Integer.parseInt(matcher.group(2));
}
}
}
return updateLocation;
} | java | public boolean update(File directory, String fileName, String fileExtension, int maxFiles) {
this.maxFiles = maxFiles;
boolean updateLocation = !directory.equals(this.directory) || !fileName.equals(this.fileName) || !fileExtension.equals(this.fileExtension);
if (updateLocation) {
this.directory = directory;
this.fileName = fileName;
this.fileExtension = fileExtension;
filePattern = LoggingFileUtils.compileLogFileRegex(fileName, fileExtension);
// The location was updated, so remove our list of cached files.
files = null;
}
if (maxFiles <= 0) {
files = null;
} else {
if (files == null) {
files = new ArrayList<String>();
// Sort and add all existing files.
String[] existing = LoggingFileUtils.safelyFindFiles(directory, filePattern);
if (existing != null) {
Arrays.sort(existing, NaturalComparator.instance);
files.addAll(Arrays.asList(existing));
}
}
// Delete excess old files if necessary.
int maxTrackedFiles = getMaxDateFiles();
while (files.size() > maxTrackedFiles) {
removeFile(0);
}
// If the location was updated, initialize the counter from the
// remaining files (if any).
if (updateLocation) {
if (files.isEmpty()) {
lastDateString = null;
} else {
Matcher matcher = filePattern.matcher(files.get(files.size() - 1));
if (!matcher.matches())
throw new IllegalStateException();
lastDateString = matcher.group(1);
lastCounter = Integer.parseInt(matcher.group(2));
}
}
}
return updateLocation;
} | [
"public",
"boolean",
"update",
"(",
"File",
"directory",
",",
"String",
"fileName",
",",
"String",
"fileExtension",
",",
"int",
"maxFiles",
")",
"{",
"this",
".",
"maxFiles",
"=",
"maxFiles",
";",
"boolean",
"updateLocation",
"=",
"!",
"directory",
".",
"equals",
"(",
"this",
".",
"directory",
")",
"||",
"!",
"fileName",
".",
"equals",
"(",
"this",
".",
"fileName",
")",
"||",
"!",
"fileExtension",
".",
"equals",
"(",
"this",
".",
"fileExtension",
")",
";",
"if",
"(",
"updateLocation",
")",
"{",
"this",
".",
"directory",
"=",
"directory",
";",
"this",
".",
"fileName",
"=",
"fileName",
";",
"this",
".",
"fileExtension",
"=",
"fileExtension",
";",
"filePattern",
"=",
"LoggingFileUtils",
".",
"compileLogFileRegex",
"(",
"fileName",
",",
"fileExtension",
")",
";",
"// The location was updated, so remove our list of cached files.",
"files",
"=",
"null",
";",
"}",
"if",
"(",
"maxFiles",
"<=",
"0",
")",
"{",
"files",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"files",
"==",
"null",
")",
"{",
"files",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"// Sort and add all existing files.",
"String",
"[",
"]",
"existing",
"=",
"LoggingFileUtils",
".",
"safelyFindFiles",
"(",
"directory",
",",
"filePattern",
")",
";",
"if",
"(",
"existing",
"!=",
"null",
")",
"{",
"Arrays",
".",
"sort",
"(",
"existing",
",",
"NaturalComparator",
".",
"instance",
")",
";",
"files",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"existing",
")",
")",
";",
"}",
"}",
"// Delete excess old files if necessary.",
"int",
"maxTrackedFiles",
"=",
"getMaxDateFiles",
"(",
")",
";",
"while",
"(",
"files",
".",
"size",
"(",
")",
">",
"maxTrackedFiles",
")",
"{",
"removeFile",
"(",
"0",
")",
";",
"}",
"// If the location was updated, initialize the counter from the",
"// remaining files (if any).",
"if",
"(",
"updateLocation",
")",
"{",
"if",
"(",
"files",
".",
"isEmpty",
"(",
")",
")",
"{",
"lastDateString",
"=",
"null",
";",
"}",
"else",
"{",
"Matcher",
"matcher",
"=",
"filePattern",
".",
"matcher",
"(",
"files",
".",
"get",
"(",
"files",
".",
"size",
"(",
")",
"-",
"1",
")",
")",
";",
"if",
"(",
"!",
"matcher",
".",
"matches",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"lastDateString",
"=",
"matcher",
".",
"group",
"(",
"1",
")",
";",
"lastCounter",
"=",
"Integer",
".",
"parseInt",
"(",
"matcher",
".",
"group",
"(",
"2",
")",
")",
";",
"}",
"}",
"}",
"return",
"updateLocation",
";",
"}"
] | Updates the configuration for this set of logs.
@param directory the log directory
@param fileName the file base name (e.g., "messages")
@param fileExtension the file extension (e.g., ".log")
@param maxFiles the maximum number of files, or 0 for unlimited
@return true if the directory, name, or extension changed | [
"Updates",
"the",
"configuration",
"for",
"this",
"set",
"of",
"logs",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/FileLogSet.java#L126-L177 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/FileLogSet.java | FileLogSet.addFile | private void addFile(int index, String file) {
if (maxFiles > 0) {
int numFiles = files.size();
int maxDateFiles = getMaxDateFiles();
// If there is no max or we have fewer than max, then we're done.
if (maxDateFiles <= 0 || numFiles < maxDateFiles) {
files.add(index, file);
} else {
// The file names we deal with (messages_xx.xx.xx_xx.xx.xx.log)
// have dates, and we want to always be using the "most recent",
// so delete everything "newer" (index and after), which might be
// present if the system clock goes backwards, and then delete
// the oldest files until only maxDateFiles-1 remain.
while (files.size() > index) {
removeFile(files.size() - 1);
}
while (files.size() >= maxDateFiles) {
removeFile(0);
}
files.add(file);
}
}
} | java | private void addFile(int index, String file) {
if (maxFiles > 0) {
int numFiles = files.size();
int maxDateFiles = getMaxDateFiles();
// If there is no max or we have fewer than max, then we're done.
if (maxDateFiles <= 0 || numFiles < maxDateFiles) {
files.add(index, file);
} else {
// The file names we deal with (messages_xx.xx.xx_xx.xx.xx.log)
// have dates, and we want to always be using the "most recent",
// so delete everything "newer" (index and after), which might be
// present if the system clock goes backwards, and then delete
// the oldest files until only maxDateFiles-1 remain.
while (files.size() > index) {
removeFile(files.size() - 1);
}
while (files.size() >= maxDateFiles) {
removeFile(0);
}
files.add(file);
}
}
} | [
"private",
"void",
"addFile",
"(",
"int",
"index",
",",
"String",
"file",
")",
"{",
"if",
"(",
"maxFiles",
">",
"0",
")",
"{",
"int",
"numFiles",
"=",
"files",
".",
"size",
"(",
")",
";",
"int",
"maxDateFiles",
"=",
"getMaxDateFiles",
"(",
")",
";",
"// If there is no max or we have fewer than max, then we're done.",
"if",
"(",
"maxDateFiles",
"<=",
"0",
"||",
"numFiles",
"<",
"maxDateFiles",
")",
"{",
"files",
".",
"add",
"(",
"index",
",",
"file",
")",
";",
"}",
"else",
"{",
"// The file names we deal with (messages_xx.xx.xx_xx.xx.xx.log)",
"// have dates, and we want to always be using the \"most recent\",",
"// so delete everything \"newer\" (index and after), which might be",
"// present if the system clock goes backwards, and then delete",
"// the oldest files until only maxDateFiles-1 remain.",
"while",
"(",
"files",
".",
"size",
"(",
")",
">",
"index",
")",
"{",
"removeFile",
"(",
"files",
".",
"size",
"(",
")",
"-",
"1",
")",
";",
"}",
"while",
"(",
"files",
".",
"size",
"(",
")",
">=",
"maxDateFiles",
")",
"{",
"removeFile",
"(",
"0",
")",
";",
"}",
"files",
".",
"add",
"(",
"file",
")",
";",
"}",
"}",
"}"
] | Adds a file name to the files list at the specified index. If adding
this file would cause the number of files to exceed the maximum, remove
all files after the specified index, and then remove the oldest files
until the number is reduced to the maximum.
@param index the index in the files list to insert the file
@param file the file name | [
"Adds",
"a",
"file",
"name",
"to",
"the",
"files",
"list",
"at",
"the",
"specified",
"index",
".",
"If",
"adding",
"this",
"file",
"would",
"cause",
"the",
"number",
"of",
"files",
"to",
"exceed",
"the",
"maximum",
"remove",
"all",
"files",
"after",
"the",
"specified",
"index",
"and",
"then",
"remove",
"the",
"oldest",
"files",
"until",
"the",
"number",
"is",
"reduced",
"to",
"the",
"maximum",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/FileLogSet.java#L387-L411 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.instantiateMessage | protected JsJmsMessage instantiateMessage() throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "instantiateMessage");
// Create a new message object.
JsJmsMessage newMsg = jmfact.createJmsMessage();
messageClass = CLASS_NONE;
// d317373 default the MSG_TYPE to be DATAGRAM until setReplyTo is called
newMsg.setNonNullProperty(ApiJmsConstants.MSG_TYPE_PROPERTY, Integer.valueOf(ApiJmsConstants.MQMT_DATAGRAM));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "instantiateMessage", newMsg);
return newMsg;
} | java | protected JsJmsMessage instantiateMessage() throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "instantiateMessage");
// Create a new message object.
JsJmsMessage newMsg = jmfact.createJmsMessage();
messageClass = CLASS_NONE;
// d317373 default the MSG_TYPE to be DATAGRAM until setReplyTo is called
newMsg.setNonNullProperty(ApiJmsConstants.MSG_TYPE_PROPERTY, Integer.valueOf(ApiJmsConstants.MQMT_DATAGRAM));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "instantiateMessage", newMsg);
return newMsg;
} | [
"protected",
"JsJmsMessage",
"instantiateMessage",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"instantiateMessage\"",
")",
";",
"// Create a new message object.",
"JsJmsMessage",
"newMsg",
"=",
"jmfact",
".",
"createJmsMessage",
"(",
")",
";",
"messageClass",
"=",
"CLASS_NONE",
";",
"// d317373 default the MSG_TYPE to be DATAGRAM until setReplyTo is called",
"newMsg",
".",
"setNonNullProperty",
"(",
"ApiJmsConstants",
".",
"MSG_TYPE_PROPERTY",
",",
"Integer",
".",
"valueOf",
"(",
"ApiJmsConstants",
".",
"MQMT_DATAGRAM",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"instantiateMessage\"",
",",
"newMsg",
")",
";",
"return",
"newMsg",
";",
"}"
] | This method carries out the instantiation of the MFP message object for this
JMS message class. The method is overridden by subclasses to instantiate the
correct subclass and carry out any reference setting required.
It is safe to assume by this point that the jmfact reference has been
initialized, otherwise you wouldn't have got this far! | [
"This",
"method",
"carries",
"out",
"the",
"instantiation",
"of",
"the",
"MFP",
"message",
"object",
"for",
"this",
"JMS",
"message",
"class",
".",
"The",
"method",
"is",
"overridden",
"by",
"subclasses",
"to",
"instantiate",
"the",
"correct",
"subclass",
"and",
"carry",
"out",
"any",
"reference",
"setting",
"required",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1668-L1682 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.getMsgReference | protected JsJmsMessage getMsgReference() throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getMsgReference");
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getMsgReference", msg);
return msg;
} | java | protected JsJmsMessage getMsgReference() throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getMsgReference");
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getMsgReference", msg);
return msg;
} | [
"protected",
"JsJmsMessage",
"getMsgReference",
"(",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getMsgReference\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getMsgReference\"",
",",
"msg",
")",
";",
"return",
"msg",
";",
"}"
] | Get a Jetstream message representing the content of this JMS message.
Used during the sending of messages.
@return a Jetstream message which can be used to represent this message.
@throws JMSException if a problem arises during the transformation of the JMS message
to a Jetstream message. | [
"Get",
"a",
"Jetstream",
"message",
"representing",
"the",
"content",
"of",
"this",
"JMS",
"message",
".",
"Used",
"during",
"the",
"sending",
"of",
"messages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1692-L1698 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.setDestReference | protected void setDestReference(Destination d) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setDestReference", d);
dest = d;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "setDestReference");
} | java | protected void setDestReference(Destination d) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setDestReference", d);
dest = d;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "setDestReference");
} | [
"protected",
"void",
"setDestReference",
"(",
"Destination",
"d",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setDestReference\"",
",",
"d",
")",
";",
"dest",
"=",
"d",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setDestReference\"",
")",
";",
"}"
] | Update the destination cache reference without setting any
data into the core message.
@param d | [
"Update",
"the",
"destination",
"cache",
"reference",
"without",
"setting",
"any",
"data",
"into",
"the",
"core",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1722-L1728 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.checkBodyWriteable | protected void checkBodyWriteable(String callingMethodName) throws JMSException {
if (bodyReadOnly) {
throw (javax.jms.MessageNotWriteableException) JmsErrorUtils.newThrowable(javax.jms.MessageNotWriteableException.class,
"READ_ONLY_MESSAGE_BODY_CWSIA0107",
new Object[] { callingMethodName },
tc
);
}
} | java | protected void checkBodyWriteable(String callingMethodName) throws JMSException {
if (bodyReadOnly) {
throw (javax.jms.MessageNotWriteableException) JmsErrorUtils.newThrowable(javax.jms.MessageNotWriteableException.class,
"READ_ONLY_MESSAGE_BODY_CWSIA0107",
new Object[] { callingMethodName },
tc
);
}
} | [
"protected",
"void",
"checkBodyWriteable",
"(",
"String",
"callingMethodName",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"bodyReadOnly",
")",
"{",
"throw",
"(",
"javax",
".",
"jms",
".",
"MessageNotWriteableException",
")",
"JmsErrorUtils",
".",
"newThrowable",
"(",
"javax",
".",
"jms",
".",
"MessageNotWriteableException",
".",
"class",
",",
"\"READ_ONLY_MESSAGE_BODY_CWSIA0107\"",
",",
"new",
"Object",
"[",
"]",
"{",
"callingMethodName",
"}",
",",
"tc",
")",
";",
"}",
"}"
] | If the message body is read-only, throw a MessageNotWriteableException. | [
"If",
"the",
"message",
"body",
"is",
"read",
"-",
"only",
"throw",
"a",
"MessageNotWriteableException",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1733-L1741 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.checkBodyReadable | protected void checkBodyReadable(String callingMethodName) throws MessageNotReadableException
{
if (!bodyReadOnly) {
throw (javax.jms.MessageNotReadableException) JmsErrorUtils.newThrowable(javax.jms.MessageNotReadableException.class,
"WRITE_ONLY_MESSAGE_BODY_CWSIA0109",
new Object[] { callingMethodName },
tc
);
}
} | java | protected void checkBodyReadable(String callingMethodName) throws MessageNotReadableException
{
if (!bodyReadOnly) {
throw (javax.jms.MessageNotReadableException) JmsErrorUtils.newThrowable(javax.jms.MessageNotReadableException.class,
"WRITE_ONLY_MESSAGE_BODY_CWSIA0109",
new Object[] { callingMethodName },
tc
);
}
} | [
"protected",
"void",
"checkBodyReadable",
"(",
"String",
"callingMethodName",
")",
"throws",
"MessageNotReadableException",
"{",
"if",
"(",
"!",
"bodyReadOnly",
")",
"{",
"throw",
"(",
"javax",
".",
"jms",
".",
"MessageNotReadableException",
")",
"JmsErrorUtils",
".",
"newThrowable",
"(",
"javax",
".",
"jms",
".",
"MessageNotReadableException",
".",
"class",
",",
"\"WRITE_ONLY_MESSAGE_BODY_CWSIA0109\"",
",",
"new",
"Object",
"[",
"]",
"{",
"callingMethodName",
"}",
",",
"tc",
")",
";",
"}",
"}"
] | If the message body is write-only, throw a MessageNotReadableException. | [
"If",
"the",
"message",
"body",
"is",
"write",
"-",
"only",
"throw",
"a",
"MessageNotReadableException",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1746-L1755 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.checkPropertiesWriteable | protected void checkPropertiesWriteable(String callingMethodName) throws JMSException {
if (propertiesReadOnly) {
throw (javax.jms.MessageNotWriteableException) JmsErrorUtils.newThrowable(javax.jms.MessageNotWriteableException.class,
"READ_ONLY_MESSAGE_PROPERTY_CWSIA0108",
new Object[] { callingMethodName },
tc
);
}
} | java | protected void checkPropertiesWriteable(String callingMethodName) throws JMSException {
if (propertiesReadOnly) {
throw (javax.jms.MessageNotWriteableException) JmsErrorUtils.newThrowable(javax.jms.MessageNotWriteableException.class,
"READ_ONLY_MESSAGE_PROPERTY_CWSIA0108",
new Object[] { callingMethodName },
tc
);
}
} | [
"protected",
"void",
"checkPropertiesWriteable",
"(",
"String",
"callingMethodName",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"propertiesReadOnly",
")",
"{",
"throw",
"(",
"javax",
".",
"jms",
".",
"MessageNotWriteableException",
")",
"JmsErrorUtils",
".",
"newThrowable",
"(",
"javax",
".",
"jms",
".",
"MessageNotWriteableException",
".",
"class",
",",
"\"READ_ONLY_MESSAGE_PROPERTY_CWSIA0108\"",
",",
"new",
"Object",
"[",
"]",
"{",
"callingMethodName",
"}",
",",
"tc",
")",
";",
"}",
"}"
] | If the message properties are read-only, throw a MessageNotWriteableException. | [
"If",
"the",
"message",
"properties",
"are",
"read",
"-",
"only",
"throw",
"a",
"MessageNotWriteableException",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1760-L1768 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.getReliability | public Reliability getReliability() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getReliability");
Reliability r = msg.getReliability();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getReliablity", r);
return r;
} | java | public Reliability getReliability() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getReliability");
Reliability r = msg.getReliability();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getReliablity", r);
return r;
} | [
"public",
"Reliability",
"getReliability",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getReliability\"",
")",
";",
"Reliability",
"r",
"=",
"msg",
".",
"getReliability",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getReliablity\"",
",",
"r",
")",
";",
"return",
"r",
";",
"}"
] | This method retrieves the underlying reliability that is set for this
message. The outgoing value can also be determined by examining the
persistence and NPM properties, however inbound cannot be found in this
way.
@return Reliablity | [
"This",
"method",
"retrieves",
"the",
"underlying",
"reliability",
"that",
"is",
"set",
"for",
"this",
"message",
".",
"The",
"outgoing",
"value",
"can",
"also",
"be",
"determined",
"by",
"examining",
"the",
"persistence",
"and",
"NPM",
"properties",
"however",
"inbound",
"cannot",
"be",
"found",
"in",
"this",
"way",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1778-L1785 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.setBodyReadOnly | protected void setBodyReadOnly() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setBodyReadOnly");
bodyReadOnly = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setBodyReadOnly");
} | java | protected void setBodyReadOnly() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setBodyReadOnly");
bodyReadOnly = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setBodyReadOnly");
} | [
"protected",
"void",
"setBodyReadOnly",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setBodyReadOnly\"",
")",
";",
"bodyReadOnly",
"=",
"true",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setBodyReadOnly\"",
")",
";",
"}"
] | Mark the body of the message as read only.
Needed for the reset methods of Bytes and Stream messages. | [
"Mark",
"the",
"body",
"of",
"the",
"message",
"as",
"read",
"only",
".",
"Needed",
"for",
"the",
"reset",
"methods",
"of",
"Bytes",
"and",
"Stream",
"messages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1872-L1878 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.clearLocalProperties | void clearLocalProperties() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "clearLocalProperties");
if (locallyStoredPropertyValues != null)
locallyStoredPropertyValues.clear();
// d255144 Also clear the local version of the messageID
localJMSMessageID = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "clearLocalProperties");
} | java | void clearLocalProperties() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "clearLocalProperties");
if (locallyStoredPropertyValues != null)
locallyStoredPropertyValues.clear();
// d255144 Also clear the local version of the messageID
localJMSMessageID = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "clearLocalProperties");
} | [
"void",
"clearLocalProperties",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"clearLocalProperties\"",
")",
";",
"if",
"(",
"locallyStoredPropertyValues",
"!=",
"null",
")",
"locallyStoredPropertyValues",
".",
"clear",
"(",
")",
";",
"// d255144 Also clear the local version of the messageID",
"localJMSMessageID",
"=",
"null",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"clearLocalProperties\"",
")",
";",
"}"
] | Clear special case properties held in this
message. Invoked at send time. | [
"Clear",
"special",
"case",
"properties",
"held",
"in",
"this",
"message",
".",
"Invoked",
"at",
"send",
"time",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1887-L1898 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.invalidateToStringCache | void invalidateToStringCache() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "invalidateToStringCache");
// Invalidate the toString cache.
cachedToString = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "invalidateToStringCache");
} | java | void invalidateToStringCache() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "invalidateToStringCache");
// Invalidate the toString cache.
cachedToString = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "invalidateToStringCache");
} | [
"void",
"invalidateToStringCache",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"invalidateToStringCache\"",
")",
";",
"// Invalidate the toString cache.",
"cachedToString",
"=",
"null",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"invalidateToStringCache\"",
")",
";",
"}"
] | Called by the sendMessage method of JmsMsgProducerImpl in order to
invalidate the toString of the message when we send it. | [
"Called",
"by",
"the",
"sendMessage",
"method",
"of",
"JmsMsgProducerImpl",
"in",
"order",
"to",
"invalidate",
"the",
"toString",
"of",
"the",
"message",
"when",
"we",
"send",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1904-L1913 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.checkPropName | static void checkPropName(String name, String callingMethodName) throws IllegalArgumentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkPropName", new Object[] { name, callingMethodName });
if ((name == null) || ("".equals(name))) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Invalid field name: " + name + " as parameter to " + callingMethodName);
throw (IllegalArgumentException) JmsErrorUtils.newThrowable(IllegalArgumentException.class,
"INVALID_FIELD_NAME_CWSIA0106",
null, // no inserts for CWSIA0106
tc
);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkPropName");
} | java | static void checkPropName(String name, String callingMethodName) throws IllegalArgumentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkPropName", new Object[] { name, callingMethodName });
if ((name == null) || ("".equals(name))) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Invalid field name: " + name + " as parameter to " + callingMethodName);
throw (IllegalArgumentException) JmsErrorUtils.newThrowable(IllegalArgumentException.class,
"INVALID_FIELD_NAME_CWSIA0106",
null, // no inserts for CWSIA0106
tc
);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkPropName");
} | [
"static",
"void",
"checkPropName",
"(",
"String",
"name",
",",
"String",
"callingMethodName",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"checkPropName\"",
",",
"new",
"Object",
"[",
"]",
"{",
"name",
",",
"callingMethodName",
"}",
")",
";",
"if",
"(",
"(",
"name",
"==",
"null",
")",
"||",
"(",
"\"\"",
".",
"equals",
"(",
"name",
")",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Invalid field name: \"",
"+",
"name",
"+",
"\" as parameter to \"",
"+",
"callingMethodName",
")",
";",
"throw",
"(",
"IllegalArgumentException",
")",
"JmsErrorUtils",
".",
"newThrowable",
"(",
"IllegalArgumentException",
".",
"class",
",",
"\"INVALID_FIELD_NAME_CWSIA0106\"",
",",
"null",
",",
"// no inserts for CWSIA0106",
"tc",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"checkPropName\"",
")",
";",
"}"
] | This method checks the property name to see whether it is null or empty,
and throws an IllegalArgumentException if it is.
Note that this is used from MapMessage for the body, as well as from this
class for the header. | [
"This",
"method",
"checks",
"the",
"property",
"name",
"to",
"see",
"whether",
"it",
"is",
"null",
"or",
"empty",
"and",
"throws",
"an",
"IllegalArgumentException",
"if",
"it",
"is",
".",
"Note",
"that",
"this",
"is",
"used",
"from",
"MapMessage",
"for",
"the",
"body",
"as",
"well",
"as",
"from",
"this",
"class",
"for",
"the",
"header",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L1939-L1955 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.persistence/src/com/ibm/wsspi/persistence/internal/DatabaseManager.java | DatabaseManager.getDatabasePlatformClassName | public String getDatabasePlatformClassName(PUInfoImpl pui) {
SessionLog traceLogger = new TraceLog();
Properties properties = pui.getProperties();
String productName = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_PRODUCT_NAME);
String vendorNameAndVersion = null;
// check persistent properties
if (productName != null) {
vendorNameAndVersion = productName;
String majorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MAJOR_VERSION);
if (majorVersion != null) {
vendorNameAndVersion += majorVersion;
String minorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MINOR_VERSION);
if (minorVersion != null) {
vendorNameAndVersion += minorVersion;
}
}
} else {
vendorNameAndVersion = getVendorNameAndVersion(pui.getJtaDataSource());
if (vendorNameAndVersion == null) {
getVendorNameAndVersion(pui.getNonJtaDataSource());
}
}
return DBPlatformHelper.getDBPlatform(vendorNameAndVersion, traceLogger);
} | java | public String getDatabasePlatformClassName(PUInfoImpl pui) {
SessionLog traceLogger = new TraceLog();
Properties properties = pui.getProperties();
String productName = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_PRODUCT_NAME);
String vendorNameAndVersion = null;
// check persistent properties
if (productName != null) {
vendorNameAndVersion = productName;
String majorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MAJOR_VERSION);
if (majorVersion != null) {
vendorNameAndVersion += majorVersion;
String minorVersion = properties.getProperty(PersistenceUnitProperties.SCHEMA_DATABASE_MINOR_VERSION);
if (minorVersion != null) {
vendorNameAndVersion += minorVersion;
}
}
} else {
vendorNameAndVersion = getVendorNameAndVersion(pui.getJtaDataSource());
if (vendorNameAndVersion == null) {
getVendorNameAndVersion(pui.getNonJtaDataSource());
}
}
return DBPlatformHelper.getDBPlatform(vendorNameAndVersion, traceLogger);
} | [
"public",
"String",
"getDatabasePlatformClassName",
"(",
"PUInfoImpl",
"pui",
")",
"{",
"SessionLog",
"traceLogger",
"=",
"new",
"TraceLog",
"(",
")",
";",
"Properties",
"properties",
"=",
"pui",
".",
"getProperties",
"(",
")",
";",
"String",
"productName",
"=",
"properties",
".",
"getProperty",
"(",
"PersistenceUnitProperties",
".",
"SCHEMA_DATABASE_PRODUCT_NAME",
")",
";",
"String",
"vendorNameAndVersion",
"=",
"null",
";",
"// check persistent properties",
"if",
"(",
"productName",
"!=",
"null",
")",
"{",
"vendorNameAndVersion",
"=",
"productName",
";",
"String",
"majorVersion",
"=",
"properties",
".",
"getProperty",
"(",
"PersistenceUnitProperties",
".",
"SCHEMA_DATABASE_MAJOR_VERSION",
")",
";",
"if",
"(",
"majorVersion",
"!=",
"null",
")",
"{",
"vendorNameAndVersion",
"+=",
"majorVersion",
";",
"String",
"minorVersion",
"=",
"properties",
".",
"getProperty",
"(",
"PersistenceUnitProperties",
".",
"SCHEMA_DATABASE_MINOR_VERSION",
")",
";",
"if",
"(",
"minorVersion",
"!=",
"null",
")",
"{",
"vendorNameAndVersion",
"+=",
"minorVersion",
";",
"}",
"}",
"}",
"else",
"{",
"vendorNameAndVersion",
"=",
"getVendorNameAndVersion",
"(",
"pui",
".",
"getJtaDataSource",
"(",
")",
")",
";",
"if",
"(",
"vendorNameAndVersion",
"==",
"null",
")",
"{",
"getVendorNameAndVersion",
"(",
"pui",
".",
"getNonJtaDataSource",
"(",
")",
")",
";",
"}",
"}",
"return",
"DBPlatformHelper",
".",
"getDBPlatform",
"(",
"vendorNameAndVersion",
",",
"traceLogger",
")",
";",
"}"
] | Returns the EclipseLink database platform class name based on the properties passed in or by
detecting it through the connection, if one is available. | [
"Returns",
"the",
"EclipseLink",
"database",
"platform",
"class",
"name",
"based",
"on",
"the",
"properties",
"passed",
"in",
"or",
"by",
"detecting",
"it",
"through",
"the",
"connection",
"if",
"one",
"is",
"available",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.persistence/src/com/ibm/wsspi/persistence/internal/DatabaseManager.java#L140-L167 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.persistence/src/com/ibm/wsspi/persistence/internal/DatabaseManager.java | DatabaseManager.supportsUnicodeStaticCheck | @FFDCIgnore(SQLException.class)
private Boolean supportsUnicodeStaticCheck(DataSource ds) {
Boolean res = null;
try {
Connection conn = ds.getConnection();
String product = null;
try {
DatabaseMetaData dmd = conn.getMetaData();
product = dmd.getDatabaseProductName();
if (tc.isDebugEnabled()) {
Tr.debug(tc, "supportsUnicodeStaticCheck : getDatabaseProductName = " + product);
}
} finally {
conn.close();
}
for (Pattern supportedPattern : _unicodeSupportPlatform) {
if (supportedPattern.matcher(product).matches()) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "matched _unicodeSupportPlatform=" + supportedPattern.pattern());
}
return Boolean.TRUE;
}
}
for (Pattern unsupported : _noUnicodeSupportPlatform) {
if (unsupported.matcher(product).matches()) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "matched _noUnicodeSupportPlatform=" + unsupported.pattern());
}
return Boolean.FALSE;
}
}
} catch (SQLException e) {
// Unexpected
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Something went wrong in supportsUnicodeStaticCheck() -- ", e);
}
}
return res;
} | java | @FFDCIgnore(SQLException.class)
private Boolean supportsUnicodeStaticCheck(DataSource ds) {
Boolean res = null;
try {
Connection conn = ds.getConnection();
String product = null;
try {
DatabaseMetaData dmd = conn.getMetaData();
product = dmd.getDatabaseProductName();
if (tc.isDebugEnabled()) {
Tr.debug(tc, "supportsUnicodeStaticCheck : getDatabaseProductName = " + product);
}
} finally {
conn.close();
}
for (Pattern supportedPattern : _unicodeSupportPlatform) {
if (supportedPattern.matcher(product).matches()) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "matched _unicodeSupportPlatform=" + supportedPattern.pattern());
}
return Boolean.TRUE;
}
}
for (Pattern unsupported : _noUnicodeSupportPlatform) {
if (unsupported.matcher(product).matches()) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "matched _noUnicodeSupportPlatform=" + unsupported.pattern());
}
return Boolean.FALSE;
}
}
} catch (SQLException e) {
// Unexpected
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Something went wrong in supportsUnicodeStaticCheck() -- ", e);
}
}
return res;
} | [
"@",
"FFDCIgnore",
"(",
"SQLException",
".",
"class",
")",
"private",
"Boolean",
"supportsUnicodeStaticCheck",
"(",
"DataSource",
"ds",
")",
"{",
"Boolean",
"res",
"=",
"null",
";",
"try",
"{",
"Connection",
"conn",
"=",
"ds",
".",
"getConnection",
"(",
")",
";",
"String",
"product",
"=",
"null",
";",
"try",
"{",
"DatabaseMetaData",
"dmd",
"=",
"conn",
".",
"getMetaData",
"(",
")",
";",
"product",
"=",
"dmd",
".",
"getDatabaseProductName",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"supportsUnicodeStaticCheck : getDatabaseProductName = \"",
"+",
"product",
")",
";",
"}",
"}",
"finally",
"{",
"conn",
".",
"close",
"(",
")",
";",
"}",
"for",
"(",
"Pattern",
"supportedPattern",
":",
"_unicodeSupportPlatform",
")",
"{",
"if",
"(",
"supportedPattern",
".",
"matcher",
"(",
"product",
")",
".",
"matches",
"(",
")",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"matched _unicodeSupportPlatform=\"",
"+",
"supportedPattern",
".",
"pattern",
"(",
")",
")",
";",
"}",
"return",
"Boolean",
".",
"TRUE",
";",
"}",
"}",
"for",
"(",
"Pattern",
"unsupported",
":",
"_noUnicodeSupportPlatform",
")",
"{",
"if",
"(",
"unsupported",
".",
"matcher",
"(",
"product",
")",
".",
"matches",
"(",
")",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"matched _noUnicodeSupportPlatform=\"",
"+",
"unsupported",
".",
"pattern",
"(",
")",
")",
";",
"}",
"return",
"Boolean",
".",
"FALSE",
";",
"}",
"}",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"// Unexpected",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Something went wrong in supportsUnicodeStaticCheck() -- \"",
",",
"e",
")",
";",
"}",
"}",
"return",
"res",
";",
"}"
] | Consults the static collections contained within this class and attempts to determine
whether the provided DataSource supports unicode.
@return True if ds supports unicode. False if ds doesn't support unicode. null if unknown. | [
"Consults",
"the",
"static",
"collections",
"contained",
"within",
"this",
"class",
"and",
"attempts",
"to",
"determine",
"whether",
"the",
"provided",
"DataSource",
"supports",
"unicode",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.persistence/src/com/ibm/wsspi/persistence/internal/DatabaseManager.java#L175-L213 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security.common/src/com/ibm/ws/messaging/security/Authorization.java | Authorization.setMessagingAuthorizationService | public void setMessagingAuthorizationService(
MessagingAuthorizationService messagingAuthorizationService) {
SibTr.entry(tc, CLASS_NAME + "setMessagingAuthorizationService", messagingAuthorizationService);
this.messagingAuthorizationService = messagingAuthorizationService;
SibTr.exit(tc, CLASS_NAME + "setMessagingAuthorizationService");
} | java | public void setMessagingAuthorizationService(
MessagingAuthorizationService messagingAuthorizationService) {
SibTr.entry(tc, CLASS_NAME + "setMessagingAuthorizationService", messagingAuthorizationService);
this.messagingAuthorizationService = messagingAuthorizationService;
SibTr.exit(tc, CLASS_NAME + "setMessagingAuthorizationService");
} | [
"public",
"void",
"setMessagingAuthorizationService",
"(",
"MessagingAuthorizationService",
"messagingAuthorizationService",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"setMessagingAuthorizationService\"",
",",
"messagingAuthorizationService",
")",
";",
"this",
".",
"messagingAuthorizationService",
"=",
"messagingAuthorizationService",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"setMessagingAuthorizationService\"",
")",
";",
"}"
] | Set the Messaging Authorization Service
@param messagingAuthorizationService
MessagingAuthorization is set to Null when MessagingSecurity is disabled | [
"Set",
"the",
"Messaging",
"Authorization",
"Service"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security.common/src/com/ibm/ws/messaging/security/Authorization.java#L201-L208 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/AppDefinedResourceFactory.java | AppDefinedResourceFactory.destroy | @Override
public void destroy() throws Exception {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "destroy", id);
tracker.close();
StringBuilder filter = new StringBuilder(FilterUtils.createPropertyFilter(AbstractConnectionFactoryService.ID, id));
filter.insert(filter.length() - 1, '*');
builder.removeExistingConfigurations(filter.toString());
if (trace && tc.isEntryEnabled())
Tr.exit(this, tc, "destroy");
} | java | @Override
public void destroy() throws Exception {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "destroy", id);
tracker.close();
StringBuilder filter = new StringBuilder(FilterUtils.createPropertyFilter(AbstractConnectionFactoryService.ID, id));
filter.insert(filter.length() - 1, '*');
builder.removeExistingConfigurations(filter.toString());
if (trace && tc.isEntryEnabled())
Tr.exit(this, tc, "destroy");
} | [
"@",
"Override",
"public",
"void",
"destroy",
"(",
")",
"throws",
"Exception",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"destroy\"",
",",
"id",
")",
";",
"tracker",
".",
"close",
"(",
")",
";",
"StringBuilder",
"filter",
"=",
"new",
"StringBuilder",
"(",
"FilterUtils",
".",
"createPropertyFilter",
"(",
"AbstractConnectionFactoryService",
".",
"ID",
",",
"id",
")",
")",
";",
"filter",
".",
"insert",
"(",
"filter",
".",
"length",
"(",
")",
"-",
"1",
",",
"'",
"'",
")",
";",
"builder",
".",
"removeExistingConfigurations",
"(",
"filter",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"destroy\"",
")",
";",
"}"
] | Destroy this application-defined resource by removing its configuration
and the configuration of all other services that were created for it.
@throws Exception if an error occurs. | [
"Destroy",
"this",
"application",
"-",
"defined",
"resource",
"by",
"removing",
"its",
"configuration",
"and",
"the",
"configuration",
"of",
"all",
"other",
"services",
"that",
"were",
"created",
"for",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/AppDefinedResourceFactory.java#L125-L140 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java | DestinationChangeListener.addMPDestinationChangeListener | public void addMPDestinationChangeListener(MPDestinationChangeListener destinationChangeListener)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addMPDestinationChangeListener",
new Object[]{destinationChangeListener});
_destinationChangeListeners.add(destinationChangeListener);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addMPDestinationChangeListener");
} | java | public void addMPDestinationChangeListener(MPDestinationChangeListener destinationChangeListener)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addMPDestinationChangeListener",
new Object[]{destinationChangeListener});
_destinationChangeListeners.add(destinationChangeListener);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addMPDestinationChangeListener");
} | [
"public",
"void",
"addMPDestinationChangeListener",
"(",
"MPDestinationChangeListener",
"destinationChangeListener",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addMPDestinationChangeListener\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destinationChangeListener",
"}",
")",
";",
"_destinationChangeListeners",
".",
"add",
"(",
"destinationChangeListener",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addMPDestinationChangeListener\"",
")",
";",
"}"
] | This method is used internal to MP only and is used to register additional
destination change listeners that are need as well as the main MP listener
registered at startup.
Adding a destinationLocationChangeListener will not override an existing one
but will add to a list of ones that will be called.
@param destinationLocationChangeListener | [
"This",
"method",
"is",
"used",
"internal",
"to",
"MP",
"only",
"and",
"is",
"used",
"to",
"register",
"additional",
"destination",
"change",
"listeners",
"that",
"are",
"need",
"as",
"well",
"as",
"the",
"main",
"MP",
"listener",
"registered",
"at",
"startup",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java#L264-L274 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java | DestinationChangeListener.removeMPDestinationChangeListener | public void removeMPDestinationChangeListener(MPDestinationChangeListener destinationChangeListener)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeMPDestinationChangeListener",
new Object[]{destinationChangeListener});
_destinationChangeListeners.remove(destinationChangeListener);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeMPDestinationChangeListener");
} | java | public void removeMPDestinationChangeListener(MPDestinationChangeListener destinationChangeListener)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeMPDestinationChangeListener",
new Object[]{destinationChangeListener});
_destinationChangeListeners.remove(destinationChangeListener);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeMPDestinationChangeListener");
} | [
"public",
"void",
"removeMPDestinationChangeListener",
"(",
"MPDestinationChangeListener",
"destinationChangeListener",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeMPDestinationChangeListener\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destinationChangeListener",
"}",
")",
";",
"_destinationChangeListeners",
".",
"remove",
"(",
"destinationChangeListener",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeMPDestinationChangeListener\"",
")",
";",
"}"
] | This method is used internal to MP only and is used to remove a
destination change listener that was registered. This method will only remove a
destinationLocationChangeListener that was registered via addMPDestinationChangeListener
@param destinationLocationChangeListener | [
"This",
"method",
"is",
"used",
"internal",
"to",
"MP",
"only",
"and",
"is",
"used",
"to",
"remove",
"a",
"destination",
"change",
"listener",
"that",
"was",
"registered",
".",
"This",
"method",
"will",
"only",
"remove",
"a",
"destinationLocationChangeListener",
"that",
"was",
"registered",
"via",
"addMPDestinationChangeListener"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java#L283-L293 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java | DestinationChangeListener.getDestinationLocalitySet | private Set getDestinationLocalitySet (BaseDestinationHandler destinationHandler, Capability capability)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getDestinationLocalitySet",
new Object[]{destinationHandler, capability});
// Check if the localisation should be deleted
Set localitySet = null;
//Get the locality sets as known by admin
try
{
localitySet = _messageProcessor.getSIBDestinationLocalitySet(null, destinationHandler.getUuid().toString(), true);
}
catch(SIBExceptionBase e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DestinationChangeListener.getDestinationLocalitySet",
"1:368:1.45",
this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getDestinationLocalitySet", localitySet);
return localitySet;
} | java | private Set getDestinationLocalitySet (BaseDestinationHandler destinationHandler, Capability capability)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getDestinationLocalitySet",
new Object[]{destinationHandler, capability});
// Check if the localisation should be deleted
Set localitySet = null;
//Get the locality sets as known by admin
try
{
localitySet = _messageProcessor.getSIBDestinationLocalitySet(null, destinationHandler.getUuid().toString(), true);
}
catch(SIBExceptionBase e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DestinationChangeListener.getDestinationLocalitySet",
"1:368:1.45",
this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getDestinationLocalitySet", localitySet);
return localitySet;
} | [
"private",
"Set",
"getDestinationLocalitySet",
"(",
"BaseDestinationHandler",
"destinationHandler",
",",
"Capability",
"capability",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getDestinationLocalitySet\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destinationHandler",
",",
"capability",
"}",
")",
";",
"// Check if the localisation should be deleted",
"Set",
"localitySet",
"=",
"null",
";",
"//Get the locality sets as known by admin",
"try",
"{",
"localitySet",
"=",
"_messageProcessor",
".",
"getSIBDestinationLocalitySet",
"(",
"null",
",",
"destinationHandler",
".",
"getUuid",
"(",
")",
".",
"toString",
"(",
")",
",",
"true",
")",
";",
"}",
"catch",
"(",
"SIBExceptionBase",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DestinationChangeListener.getDestinationLocalitySet\"",
",",
"\"1:368:1.45\"",
",",
"this",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getDestinationLocalitySet\"",
",",
"localitySet",
")",
";",
"return",
"localitySet",
";",
"}"
] | Retrieve the Locality Set defined in Admin.
@param destinationHandler
@param capability
@return | [
"Retrieve",
"the",
"Locality",
"Set",
"defined",
"in",
"Admin",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java#L302-L330 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java | DestinationChangeListener.cleanupDestination | private void cleanupDestination(PtoPMessageItemStream ptoPMessageItemStream,
BaseDestinationHandler destinationHandler,
SIBUuid8 meUuid,
Capability capability)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "cleanupDestination",
new Object[]{ptoPMessageItemStream, destinationHandler, meUuid, capability});
// The localisation is not known in WCCM or WLM, so mark it for deletion
try
{
ptoPMessageItemStream.markAsToBeDeleted(_txManager.createAutoCommitTransaction());
//Capability == GET Close any remote consumers from the destination
destinationHandler.closeRemoteConsumer(meUuid);
}
catch(SIResourceException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DestinationChangeListener.cleanupDestination",
"1:424:1.45",
this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "cleanupDestination");
} | java | private void cleanupDestination(PtoPMessageItemStream ptoPMessageItemStream,
BaseDestinationHandler destinationHandler,
SIBUuid8 meUuid,
Capability capability)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "cleanupDestination",
new Object[]{ptoPMessageItemStream, destinationHandler, meUuid, capability});
// The localisation is not known in WCCM or WLM, so mark it for deletion
try
{
ptoPMessageItemStream.markAsToBeDeleted(_txManager.createAutoCommitTransaction());
//Capability == GET Close any remote consumers from the destination
destinationHandler.closeRemoteConsumer(meUuid);
}
catch(SIResourceException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DestinationChangeListener.cleanupDestination",
"1:424:1.45",
this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "cleanupDestination");
} | [
"private",
"void",
"cleanupDestination",
"(",
"PtoPMessageItemStream",
"ptoPMessageItemStream",
",",
"BaseDestinationHandler",
"destinationHandler",
",",
"SIBUuid8",
"meUuid",
",",
"Capability",
"capability",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"cleanupDestination\"",
",",
"new",
"Object",
"[",
"]",
"{",
"ptoPMessageItemStream",
",",
"destinationHandler",
",",
"meUuid",
",",
"capability",
"}",
")",
";",
"// The localisation is not known in WCCM or WLM, so mark it for deletion",
"try",
"{",
"ptoPMessageItemStream",
".",
"markAsToBeDeleted",
"(",
"_txManager",
".",
"createAutoCommitTransaction",
"(",
")",
")",
";",
"//Capability == GET Close any remote consumers from the destination",
"destinationHandler",
".",
"closeRemoteConsumer",
"(",
"meUuid",
")",
";",
"}",
"catch",
"(",
"SIResourceException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DestinationChangeListener.cleanupDestination\"",
",",
"\"1:424:1.45\"",
",",
"this",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"cleanupDestination\"",
")",
";",
"}"
] | Cleanup destinations unknown to both WLM and WCCM.
@param ptoPMessageItemStream
@param destinationHandler
@param meUuid
@param capability | [
"Cleanup",
"destinations",
"unknown",
"to",
"both",
"WLM",
"and",
"WCCM",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationChangeListener.java#L340-L367 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.compareToAparList | private void compareToAparList(ExecutionContext context, CommandConsole console, Map<String, Set<String>> installedIFixes, File wlpInstallationDirectory) {
// console.printlnInfoMessage("WLP Directory [ " + wlpInstallationDirectory.getPath() + " ]");
// console.printlnInfoMessage("Installed IFixes [ " + installedIFixes.keySet() + " ]");
// First grab the apar list
String aparListString = context.getOptionValue(APAR_TO_COMPARE_OPTION);
List<String> aparList;
// Service 83179: String.split yields a singleton list on an empty string!
aparListString = aparListString.trim();
if (aparListString.isEmpty()) {
aparList = Collections.emptyList();
} else {
// Service 83179: Trim spaces and duplicates; delimit on space and tab, too.
aparList = new ArrayList<String>();
String[] aparListArray = aparListString.split(",| |\t");
for (String apar : aparListArray) {
apar = apar.trim();
if (!apar.isEmpty() && !aparList.contains(apar)) {
aparList.add(apar);
}
}
}
// console.printlnInfoMessage("APAR List String [ " + aparListString + " ]");
// console.printlnInfoMessage("APAR List [ " + Arrays.toString(aparList) + " ]");
// We now know what APARs to look for so load which ones are installed from both iFixes and Fix Packs
Set<String> aparsInstalled = null;
try {
aparsInstalled = findFixPackAparIds(wlpInstallationDirectory, console, context);
} catch (IllegalArgumentException e) {
// These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user
console.printlnErrorMessage(e.getMessage());
return;
} catch (ZipException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", wlpInstallationDirectory, e.getMessage()));
return;
} catch (IOException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", wlpInstallationDirectory, e.getMessage()));
return;
}
// console.printlnInfoMessage("Installed APARs [ " + aparsInstalled + " ]");
aparsInstalled.addAll(installedIFixes.keySet());
// Service 83179: Use a list: Keep the missing APARs in the order as originally specified.
List<String> missingApars = new ArrayList<String>();
for (String apar : aparList) {
if (!aparsInstalled.contains(apar)) {
missingApars.add(apar);
}
}
// console.printlnInfoMessage("Missing APARS [ " + missingApars.size() + " ] [ " + missingApars + " ]");
if (missingApars.isEmpty()) {
// Output a message saying all APARs were present
console.printlnInfoMessage(getMessage("compare.all.apars.present"));
} else {
// Output a message saying which APARs were missing
console.printlnInfoMessage(getMessage("compare.missing.apars", missingApars.toString()));
}
} | java | private void compareToAparList(ExecutionContext context, CommandConsole console, Map<String, Set<String>> installedIFixes, File wlpInstallationDirectory) {
// console.printlnInfoMessage("WLP Directory [ " + wlpInstallationDirectory.getPath() + " ]");
// console.printlnInfoMessage("Installed IFixes [ " + installedIFixes.keySet() + " ]");
// First grab the apar list
String aparListString = context.getOptionValue(APAR_TO_COMPARE_OPTION);
List<String> aparList;
// Service 83179: String.split yields a singleton list on an empty string!
aparListString = aparListString.trim();
if (aparListString.isEmpty()) {
aparList = Collections.emptyList();
} else {
// Service 83179: Trim spaces and duplicates; delimit on space and tab, too.
aparList = new ArrayList<String>();
String[] aparListArray = aparListString.split(",| |\t");
for (String apar : aparListArray) {
apar = apar.trim();
if (!apar.isEmpty() && !aparList.contains(apar)) {
aparList.add(apar);
}
}
}
// console.printlnInfoMessage("APAR List String [ " + aparListString + " ]");
// console.printlnInfoMessage("APAR List [ " + Arrays.toString(aparList) + " ]");
// We now know what APARs to look for so load which ones are installed from both iFixes and Fix Packs
Set<String> aparsInstalled = null;
try {
aparsInstalled = findFixPackAparIds(wlpInstallationDirectory, console, context);
} catch (IllegalArgumentException e) {
// These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user
console.printlnErrorMessage(e.getMessage());
return;
} catch (ZipException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", wlpInstallationDirectory, e.getMessage()));
return;
} catch (IOException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", wlpInstallationDirectory, e.getMessage()));
return;
}
// console.printlnInfoMessage("Installed APARs [ " + aparsInstalled + " ]");
aparsInstalled.addAll(installedIFixes.keySet());
// Service 83179: Use a list: Keep the missing APARs in the order as originally specified.
List<String> missingApars = new ArrayList<String>();
for (String apar : aparList) {
if (!aparsInstalled.contains(apar)) {
missingApars.add(apar);
}
}
// console.printlnInfoMessage("Missing APARS [ " + missingApars.size() + " ] [ " + missingApars + " ]");
if (missingApars.isEmpty()) {
// Output a message saying all APARs were present
console.printlnInfoMessage(getMessage("compare.all.apars.present"));
} else {
// Output a message saying which APARs were missing
console.printlnInfoMessage(getMessage("compare.missing.apars", missingApars.toString()));
}
} | [
"private",
"void",
"compareToAparList",
"(",
"ExecutionContext",
"context",
",",
"CommandConsole",
"console",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"installedIFixes",
",",
"File",
"wlpInstallationDirectory",
")",
"{",
"// console.printlnInfoMessage(\"WLP Directory [ \" + wlpInstallationDirectory.getPath() + \" ]\");",
"// console.printlnInfoMessage(\"Installed IFixes [ \" + installedIFixes.keySet() + \" ]\");",
"// First grab the apar list",
"String",
"aparListString",
"=",
"context",
".",
"getOptionValue",
"(",
"APAR_TO_COMPARE_OPTION",
")",
";",
"List",
"<",
"String",
">",
"aparList",
";",
"// Service 83179: String.split yields a singleton list on an empty string!",
"aparListString",
"=",
"aparListString",
".",
"trim",
"(",
")",
";",
"if",
"(",
"aparListString",
".",
"isEmpty",
"(",
")",
")",
"{",
"aparList",
"=",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"else",
"{",
"// Service 83179: Trim spaces and duplicates; delimit on space and tab, too.",
"aparList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"String",
"[",
"]",
"aparListArray",
"=",
"aparListString",
".",
"split",
"(",
"\",| |\\t\"",
")",
";",
"for",
"(",
"String",
"apar",
":",
"aparListArray",
")",
"{",
"apar",
"=",
"apar",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"apar",
".",
"isEmpty",
"(",
")",
"&&",
"!",
"aparList",
".",
"contains",
"(",
"apar",
")",
")",
"{",
"aparList",
".",
"add",
"(",
"apar",
")",
";",
"}",
"}",
"}",
"// console.printlnInfoMessage(\"APAR List String [ \" + aparListString + \" ]\");",
"// console.printlnInfoMessage(\"APAR List [ \" + Arrays.toString(aparList) + \" ]\");",
"// We now know what APARs to look for so load which ones are installed from both iFixes and Fix Packs",
"Set",
"<",
"String",
">",
"aparsInstalled",
"=",
"null",
";",
"try",
"{",
"aparsInstalled",
"=",
"findFixPackAparIds",
"(",
"wlpInstallationDirectory",
",",
"console",
",",
"context",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
"// These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user",
"console",
".",
"printlnErrorMessage",
"(",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"return",
";",
"}",
"catch",
"(",
"ZipException",
"e",
")",
"{",
"console",
".",
"printlnErrorMessage",
"(",
"getMessage",
"(",
"\"compare.error.reading.install\"",
",",
"wlpInstallationDirectory",
",",
"e",
".",
"getMessage",
"(",
")",
")",
")",
";",
"return",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"console",
".",
"printlnErrorMessage",
"(",
"getMessage",
"(",
"\"compare.error.reading.install\"",
",",
"wlpInstallationDirectory",
",",
"e",
".",
"getMessage",
"(",
")",
")",
")",
";",
"return",
";",
"}",
"// console.printlnInfoMessage(\"Installed APARs [ \" + aparsInstalled + \" ]\");",
"aparsInstalled",
".",
"addAll",
"(",
"installedIFixes",
".",
"keySet",
"(",
")",
")",
";",
"// Service 83179: Use a list: Keep the missing APARs in the order as originally specified.",
"List",
"<",
"String",
">",
"missingApars",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"apar",
":",
"aparList",
")",
"{",
"if",
"(",
"!",
"aparsInstalled",
".",
"contains",
"(",
"apar",
")",
")",
"{",
"missingApars",
".",
"add",
"(",
"apar",
")",
";",
"}",
"}",
"// console.printlnInfoMessage(\"Missing APARS [ \" + missingApars.size() + \" ] [ \" + missingApars + \" ]\");",
"if",
"(",
"missingApars",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Output a message saying all APARs were present",
"console",
".",
"printlnInfoMessage",
"(",
"getMessage",
"(",
"\"compare.all.apars.present\"",
")",
")",
";",
"}",
"else",
"{",
"// Output a message saying which APARs were missing",
"console",
".",
"printlnInfoMessage",
"(",
"getMessage",
"(",
"\"compare.missing.apars\"",
",",
"missingApars",
".",
"toString",
"(",
")",
")",
")",
";",
"}",
"}"
] | Compares the current install to a list of APARs in the console arguments
@param context
@param console
@param wlpInstallationDirectory
@param installedIFixes | [
"Compares",
"the",
"current",
"install",
"to",
"a",
"list",
"of",
"APARs",
"in",
"the",
"console",
"arguments"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L131-L193 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.compareToInstallLocation | private void compareToInstallLocation(ExecutionContext context, CommandConsole console, Map<String, Set<String>> aparToIFixMap, File wlpInstallationDirectory) {
String installToCompareToLocation = context.getOptionValue(INSTALL_LOCATION_TO_COMPARE_TO_OPTION);
File installToCompareToFile = new File(installToCompareToLocation);
if (!installToCompareToFile.exists()) {
console.printlnErrorMessage(getMessage("compare.to.option.does.not.exist", installToCompareToLocation));
return;
}
Set<String> aparsForNewInstall = null;
try {
aparsForNewInstall = findFixPackAparIds(installToCompareToFile, console, context);
} catch (IllegalArgumentException e) {
// These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user
console.printlnErrorMessage(e.getMessage());
return;
} catch (ZipException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", installToCompareToLocation, e.getMessage()));
return;
} catch (IOException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", installToCompareToLocation, e.getMessage()));
return;
}
// Go through all of the APARs that are currently installed and make sure they are in the new version
Map<String, Set<String>> missingApars = new HashMap<String, Set<String>>();
for (Map.Entry<String, Set<String>> aparIFixInfo : aparToIFixMap.entrySet()) {
String apar = aparIFixInfo.getKey();
if (!aparsForNewInstall.contains(apar)) {
missingApars.put(apar, aparIFixInfo.getValue());
}
}
// Output the result, this will consist of a message saying if there were any missing iFixes then details on what was missing and what was included
if (missingApars.isEmpty()) {
console.printlnInfoMessage(getMessage("compare.all.ifixes.present", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
} else {
console.printlnInfoMessage(getMessage("compare.ifixes.missing", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
console.printlnInfoMessage("");
console.printlnInfoMessage(getMessage("compare.list.missing.ifixes", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
printAparIFixInfo(console, missingApars);
}
// Now print the included APARs by removing all of the missing ones
for (String missingApar : missingApars.keySet()) {
aparToIFixMap.remove(missingApar);
}
if (!aparToIFixMap.isEmpty()) {
console.printlnInfoMessage("");
console.printlnInfoMessage(getMessage("compare.list.included.ifixes", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
printAparIFixInfo(console, aparToIFixMap);
}
} | java | private void compareToInstallLocation(ExecutionContext context, CommandConsole console, Map<String, Set<String>> aparToIFixMap, File wlpInstallationDirectory) {
String installToCompareToLocation = context.getOptionValue(INSTALL_LOCATION_TO_COMPARE_TO_OPTION);
File installToCompareToFile = new File(installToCompareToLocation);
if (!installToCompareToFile.exists()) {
console.printlnErrorMessage(getMessage("compare.to.option.does.not.exist", installToCompareToLocation));
return;
}
Set<String> aparsForNewInstall = null;
try {
aparsForNewInstall = findFixPackAparIds(installToCompareToFile, console, context);
} catch (IllegalArgumentException e) {
// These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user
console.printlnErrorMessage(e.getMessage());
return;
} catch (ZipException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", installToCompareToLocation, e.getMessage()));
return;
} catch (IOException e) {
console.printlnErrorMessage(getMessage("compare.error.reading.install", installToCompareToLocation, e.getMessage()));
return;
}
// Go through all of the APARs that are currently installed and make sure they are in the new version
Map<String, Set<String>> missingApars = new HashMap<String, Set<String>>();
for (Map.Entry<String, Set<String>> aparIFixInfo : aparToIFixMap.entrySet()) {
String apar = aparIFixInfo.getKey();
if (!aparsForNewInstall.contains(apar)) {
missingApars.put(apar, aparIFixInfo.getValue());
}
}
// Output the result, this will consist of a message saying if there were any missing iFixes then details on what was missing and what was included
if (missingApars.isEmpty()) {
console.printlnInfoMessage(getMessage("compare.all.ifixes.present", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
} else {
console.printlnInfoMessage(getMessage("compare.ifixes.missing", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
console.printlnInfoMessage("");
console.printlnInfoMessage(getMessage("compare.list.missing.ifixes", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
printAparIFixInfo(console, missingApars);
}
// Now print the included APARs by removing all of the missing ones
for (String missingApar : missingApars.keySet()) {
aparToIFixMap.remove(missingApar);
}
if (!aparToIFixMap.isEmpty()) {
console.printlnInfoMessage("");
console.printlnInfoMessage(getMessage("compare.list.included.ifixes", wlpInstallationDirectory.getAbsolutePath(), installToCompareToLocation));
printAparIFixInfo(console, aparToIFixMap);
}
} | [
"private",
"void",
"compareToInstallLocation",
"(",
"ExecutionContext",
"context",
",",
"CommandConsole",
"console",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"aparToIFixMap",
",",
"File",
"wlpInstallationDirectory",
")",
"{",
"String",
"installToCompareToLocation",
"=",
"context",
".",
"getOptionValue",
"(",
"INSTALL_LOCATION_TO_COMPARE_TO_OPTION",
")",
";",
"File",
"installToCompareToFile",
"=",
"new",
"File",
"(",
"installToCompareToLocation",
")",
";",
"if",
"(",
"!",
"installToCompareToFile",
".",
"exists",
"(",
")",
")",
"{",
"console",
".",
"printlnErrorMessage",
"(",
"getMessage",
"(",
"\"compare.to.option.does.not.exist\"",
",",
"installToCompareToLocation",
")",
")",
";",
"return",
";",
"}",
"Set",
"<",
"String",
">",
"aparsForNewInstall",
"=",
"null",
";",
"try",
"{",
"aparsForNewInstall",
"=",
"findFixPackAparIds",
"(",
"installToCompareToFile",
",",
"console",
",",
"context",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
"// These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user",
"console",
".",
"printlnErrorMessage",
"(",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"return",
";",
"}",
"catch",
"(",
"ZipException",
"e",
")",
"{",
"console",
".",
"printlnErrorMessage",
"(",
"getMessage",
"(",
"\"compare.error.reading.install\"",
",",
"installToCompareToLocation",
",",
"e",
".",
"getMessage",
"(",
")",
")",
")",
";",
"return",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"console",
".",
"printlnErrorMessage",
"(",
"getMessage",
"(",
"\"compare.error.reading.install\"",
",",
"installToCompareToLocation",
",",
"e",
".",
"getMessage",
"(",
")",
")",
")",
";",
"return",
";",
"}",
"// Go through all of the APARs that are currently installed and make sure they are in the new version",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"missingApars",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"aparIFixInfo",
":",
"aparToIFixMap",
".",
"entrySet",
"(",
")",
")",
"{",
"String",
"apar",
"=",
"aparIFixInfo",
".",
"getKey",
"(",
")",
";",
"if",
"(",
"!",
"aparsForNewInstall",
".",
"contains",
"(",
"apar",
")",
")",
"{",
"missingApars",
".",
"put",
"(",
"apar",
",",
"aparIFixInfo",
".",
"getValue",
"(",
")",
")",
";",
"}",
"}",
"// Output the result, this will consist of a message saying if there were any missing iFixes then details on what was missing and what was included",
"if",
"(",
"missingApars",
".",
"isEmpty",
"(",
")",
")",
"{",
"console",
".",
"printlnInfoMessage",
"(",
"getMessage",
"(",
"\"compare.all.ifixes.present\"",
",",
"wlpInstallationDirectory",
".",
"getAbsolutePath",
"(",
")",
",",
"installToCompareToLocation",
")",
")",
";",
"}",
"else",
"{",
"console",
".",
"printlnInfoMessage",
"(",
"getMessage",
"(",
"\"compare.ifixes.missing\"",
",",
"wlpInstallationDirectory",
".",
"getAbsolutePath",
"(",
")",
",",
"installToCompareToLocation",
")",
")",
";",
"console",
".",
"printlnInfoMessage",
"(",
"\"\"",
")",
";",
"console",
".",
"printlnInfoMessage",
"(",
"getMessage",
"(",
"\"compare.list.missing.ifixes\"",
",",
"wlpInstallationDirectory",
".",
"getAbsolutePath",
"(",
")",
",",
"installToCompareToLocation",
")",
")",
";",
"printAparIFixInfo",
"(",
"console",
",",
"missingApars",
")",
";",
"}",
"// Now print the included APARs by removing all of the missing ones",
"for",
"(",
"String",
"missingApar",
":",
"missingApars",
".",
"keySet",
"(",
")",
")",
"{",
"aparToIFixMap",
".",
"remove",
"(",
"missingApar",
")",
";",
"}",
"if",
"(",
"!",
"aparToIFixMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"console",
".",
"printlnInfoMessage",
"(",
"\"\"",
")",
";",
"console",
".",
"printlnInfoMessage",
"(",
"getMessage",
"(",
"\"compare.list.included.ifixes\"",
",",
"wlpInstallationDirectory",
".",
"getAbsolutePath",
"(",
")",
",",
"installToCompareToLocation",
")",
")",
";",
"printAparIFixInfo",
"(",
"console",
",",
"aparToIFixMap",
")",
";",
"}",
"}"
] | Compares the current install to one supplied in the console arguments
@param context
@param console
@param wlpInstallationDirectory
@param installedIFixes | [
"Compares",
"the",
"current",
"install",
"to",
"one",
"supplied",
"in",
"the",
"console",
"arguments"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L203-L251 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.printAparIFixInfo | private void printAparIFixInfo(CommandConsole console, Map<String, Set<String>> aparToIFixMap) {
for (Map.Entry<String, Set<String>> aparIFixInfo : aparToIFixMap.entrySet()) {
console.printlnInfoMessage(getMessage("compare.ifix.apar.info", aparIFixInfo.getKey(), aparIFixInfo.getValue()));
}
} | java | private void printAparIFixInfo(CommandConsole console, Map<String, Set<String>> aparToIFixMap) {
for (Map.Entry<String, Set<String>> aparIFixInfo : aparToIFixMap.entrySet()) {
console.printlnInfoMessage(getMessage("compare.ifix.apar.info", aparIFixInfo.getKey(), aparIFixInfo.getValue()));
}
} | [
"private",
"void",
"printAparIFixInfo",
"(",
"CommandConsole",
"console",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"aparToIFixMap",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"aparIFixInfo",
":",
"aparToIFixMap",
".",
"entrySet",
"(",
")",
")",
"{",
"console",
".",
"printlnInfoMessage",
"(",
"getMessage",
"(",
"\"compare.ifix.apar.info\"",
",",
"aparIFixInfo",
".",
"getKey",
"(",
")",
",",
"aparIFixInfo",
".",
"getValue",
"(",
")",
")",
")",
";",
"}",
"}"
] | This will print the map of APARs to iFixes by giving a line to each APAR listing which iFixes it is in
@param console The console to print to
@param aparToIFixMap The map to print | [
"This",
"will",
"print",
"the",
"map",
"of",
"APARs",
"to",
"iFixes",
"by",
"giving",
"a",
"line",
"to",
"each",
"APAR",
"listing",
"which",
"iFixes",
"it",
"is",
"in"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L259-L263 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.getProductVersion | private Version getProductVersion(File wlpInstallationDirectory) throws VersionParsingException {
// First get the properties
Map<String, ProductInfo> productProperties = VersionUtils.getAllProductInfo(wlpInstallationDirectory);
// Get the properties for WAS
ProductInfo wasProperties = productProperties.get("com.ibm.websphere.appserver");
if (wasProperties == null) {
throw new VersionParsingException(getMessage("compare.no.was.properties.found"));
}
Version version = convertVersion(wasProperties);
return version;
} | java | private Version getProductVersion(File wlpInstallationDirectory) throws VersionParsingException {
// First get the properties
Map<String, ProductInfo> productProperties = VersionUtils.getAllProductInfo(wlpInstallationDirectory);
// Get the properties for WAS
ProductInfo wasProperties = productProperties.get("com.ibm.websphere.appserver");
if (wasProperties == null) {
throw new VersionParsingException(getMessage("compare.no.was.properties.found"));
}
Version version = convertVersion(wasProperties);
return version;
} | [
"private",
"Version",
"getProductVersion",
"(",
"File",
"wlpInstallationDirectory",
")",
"throws",
"VersionParsingException",
"{",
"// First get the properties",
"Map",
"<",
"String",
",",
"ProductInfo",
">",
"productProperties",
"=",
"VersionUtils",
".",
"getAllProductInfo",
"(",
"wlpInstallationDirectory",
")",
";",
"// Get the properties for WAS",
"ProductInfo",
"wasProperties",
"=",
"productProperties",
".",
"get",
"(",
"\"com.ibm.websphere.appserver\"",
")",
";",
"if",
"(",
"wasProperties",
"==",
"null",
")",
"{",
"throw",
"new",
"VersionParsingException",
"(",
"getMessage",
"(",
"\"compare.no.was.properties.found\"",
")",
")",
";",
"}",
"Version",
"version",
"=",
"convertVersion",
"(",
"wasProperties",
")",
";",
"return",
"version",
";",
"}"
] | Gets the product version from the properties file for the "com.ibm.websphere.appserver" product
@param wlpInstallationDirectory
@return The product version as parsed by the OSGi {@link Version} class
@throws VersionParsingException | [
"Gets",
"the",
"product",
"version",
"from",
"the",
"properties",
"file",
"for",
"the",
"com",
".",
"ibm",
".",
"websphere",
".",
"appserver",
"product"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L368-L381 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.readLine | private String readLine(InputStream stream) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
return reader.readLine();
} | java | private String readLine(InputStream stream) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
return reader.readLine();
} | [
"private",
"String",
"readLine",
"(",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"stream",
")",
")",
";",
"return",
"reader",
".",
"readLine",
"(",
")",
";",
"}"
] | This will read a single line from the input stream as a string.
@param stream
The stream to read
@return The line that was read
@throws IOException
If there was a problem reading the line | [
"This",
"will",
"read",
"a",
"single",
"line",
"from",
"the",
"input",
"stream",
"as",
"a",
"string",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L732-L735 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/SingleThreadModelServlet.java | SingleThreadModelServlet.service | public void service(ServletRequest req, ServletResponse resp)
throws ServletException, IOException
{
try
{
TimedServletPoolElement e = _pool.getNextElement();
e.getServlet().service(req, resp);
_pool.returnElement(e);
_pool.removeExpiredElements();
}
catch (Throwable th)
{
com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.servlet.SingleThreadModelServlet.service", "84", this);
throw new ServletErrorReport(th);
}
} | java | public void service(ServletRequest req, ServletResponse resp)
throws ServletException, IOException
{
try
{
TimedServletPoolElement e = _pool.getNextElement();
e.getServlet().service(req, resp);
_pool.returnElement(e);
_pool.removeExpiredElements();
}
catch (Throwable th)
{
com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.servlet.SingleThreadModelServlet.service", "84", this);
throw new ServletErrorReport(th);
}
} | [
"public",
"void",
"service",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"try",
"{",
"TimedServletPoolElement",
"e",
"=",
"_pool",
".",
"getNextElement",
"(",
")",
";",
"e",
".",
"getServlet",
"(",
")",
".",
"service",
"(",
"req",
",",
"resp",
")",
";",
"_pool",
".",
"returnElement",
"(",
"e",
")",
";",
"_pool",
".",
"removeExpiredElements",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"th",
")",
"{",
"com",
".",
"ibm",
".",
"wsspi",
".",
"webcontainer",
".",
"util",
".",
"FFDCWrapper",
".",
"processException",
"(",
"th",
",",
"\"com.ibm.ws.webcontainer.servlet.SingleThreadModelServlet.service\"",
",",
"\"84\"",
",",
"this",
")",
";",
"throw",
"new",
"ServletErrorReport",
"(",
"th",
")",
";",
"}",
"}"
] | Overloaded by subclasses to perform the servlet's request handling operation. | [
"Overloaded",
"by",
"subclasses",
"to",
"perform",
"the",
"servlet",
"s",
"request",
"handling",
"operation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/SingleThreadModelServlet.java#L116-L131 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.find | public ModuleItem find(String name) {
if (children == null)
return null;
else
return (ModuleItem) children.get(name);
/*
* for(int i=0; i<children.size(); i++)
* {
* ModuleItem item = (ModuleItem)children.get(i);
* if(item.instance != null)
* {
* if(item.instance.getName().equals(name))
* return item;
* }
* }
* return null;
*/
} | java | public ModuleItem find(String name) {
if (children == null)
return null;
else
return (ModuleItem) children.get(name);
/*
* for(int i=0; i<children.size(); i++)
* {
* ModuleItem item = (ModuleItem)children.get(i);
* if(item.instance != null)
* {
* if(item.instance.getName().equals(name))
* return item;
* }
* }
* return null;
*/
} | [
"public",
"ModuleItem",
"find",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"children",
"==",
"null",
")",
"return",
"null",
";",
"else",
"return",
"(",
"ModuleItem",
")",
"children",
".",
"get",
"(",
"name",
")",
";",
"/*\n * for(int i=0; i<children.size(); i++)\n * {\n * ModuleItem item = (ModuleItem)children.get(i);\n * if(item.instance != null)\n * {\n * if(item.instance.getName().equals(name))\n * return item;\n * }\n * }\n * return null;\n */",
"}"
] | Find an immediate child | [
"Find",
"an",
"immediate",
"child"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L65-L83 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.find | public ModuleItem find(String[] path, int index) {
if (path == null)
return null;
if (path.length == 0)
return this;
ModuleItem item = find(path[index]);
if (item == null)
return null;
if (index == path.length - 1)
return item;
else
return item.find(path, index + 1);
} | java | public ModuleItem find(String[] path, int index) {
if (path == null)
return null;
if (path.length == 0)
return this;
ModuleItem item = find(path[index]);
if (item == null)
return null;
if (index == path.length - 1)
return item;
else
return item.find(path, index + 1);
} | [
"public",
"ModuleItem",
"find",
"(",
"String",
"[",
"]",
"path",
",",
"int",
"index",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"path",
".",
"length",
"==",
"0",
")",
"return",
"this",
";",
"ModuleItem",
"item",
"=",
"find",
"(",
"path",
"[",
"index",
"]",
")",
";",
"if",
"(",
"item",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"index",
"==",
"path",
".",
"length",
"-",
"1",
")",
"return",
"item",
";",
"else",
"return",
"item",
".",
"find",
"(",
"path",
",",
"index",
"+",
"1",
")",
";",
"}"
] | Find a child in the subtree - do it recursively | [
"Find",
"a",
"child",
"in",
"the",
"subtree",
"-",
"do",
"it",
"recursively"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L86-L101 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.add | public synchronized ModuleItem add(String[] path, int index) {
if (path == null)
return null;
if (path.length == 0)
return this;
ModuleItem item = find(path[index]);
// custom module shouldn't go inside if{}
if (item == null) {
// Create Aggregate Module
String[] myPath = new String[index + 1];
System.arraycopy(path, 0, myPath, 0, myPath.length);
if (myPath.length == 1) { // first layer will have aggregation
ModuleAggregate aggregate = new ModuleAggregate(myPath[0]);
item = find(path[index]);
} else if (myPath.length == 3) { // this is supposed to be submdoule layer
new ModuleAggregate(myPath[0], myPath[1], myPath[2]);
item = find(path[index]);
} else { // lower levels will not have aggregation
//item = new ModuleItem(new PmiModuleDummyImpl(myPath));
Tr.warning(tc, "PMI9999E", "Parent module not found.");
}
// Add aggregate module to tree
add(item);
}
if (index == path.length - 1)
return item;
else
return item.add(path, index + 1);
} | java | public synchronized ModuleItem add(String[] path, int index) {
if (path == null)
return null;
if (path.length == 0)
return this;
ModuleItem item = find(path[index]);
// custom module shouldn't go inside if{}
if (item == null) {
// Create Aggregate Module
String[] myPath = new String[index + 1];
System.arraycopy(path, 0, myPath, 0, myPath.length);
if (myPath.length == 1) { // first layer will have aggregation
ModuleAggregate aggregate = new ModuleAggregate(myPath[0]);
item = find(path[index]);
} else if (myPath.length == 3) { // this is supposed to be submdoule layer
new ModuleAggregate(myPath[0], myPath[1], myPath[2]);
item = find(path[index]);
} else { // lower levels will not have aggregation
//item = new ModuleItem(new PmiModuleDummyImpl(myPath));
Tr.warning(tc, "PMI9999E", "Parent module not found.");
}
// Add aggregate module to tree
add(item);
}
if (index == path.length - 1)
return item;
else
return item.add(path, index + 1);
} | [
"public",
"synchronized",
"ModuleItem",
"add",
"(",
"String",
"[",
"]",
"path",
",",
"int",
"index",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"path",
".",
"length",
"==",
"0",
")",
"return",
"this",
";",
"ModuleItem",
"item",
"=",
"find",
"(",
"path",
"[",
"index",
"]",
")",
";",
"// custom module shouldn't go inside if{}",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"// Create Aggregate Module",
"String",
"[",
"]",
"myPath",
"=",
"new",
"String",
"[",
"index",
"+",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"path",
",",
"0",
",",
"myPath",
",",
"0",
",",
"myPath",
".",
"length",
")",
";",
"if",
"(",
"myPath",
".",
"length",
"==",
"1",
")",
"{",
"// first layer will have aggregation",
"ModuleAggregate",
"aggregate",
"=",
"new",
"ModuleAggregate",
"(",
"myPath",
"[",
"0",
"]",
")",
";",
"item",
"=",
"find",
"(",
"path",
"[",
"index",
"]",
")",
";",
"}",
"else",
"if",
"(",
"myPath",
".",
"length",
"==",
"3",
")",
"{",
"// this is supposed to be submdoule layer",
"new",
"ModuleAggregate",
"(",
"myPath",
"[",
"0",
"]",
",",
"myPath",
"[",
"1",
"]",
",",
"myPath",
"[",
"2",
"]",
")",
";",
"item",
"=",
"find",
"(",
"path",
"[",
"index",
"]",
")",
";",
"}",
"else",
"{",
"// lower levels will not have aggregation",
"//item = new ModuleItem(new PmiModuleDummyImpl(myPath)); ",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"PMI9999E\"",
",",
"\"Parent module not found.\"",
")",
";",
"}",
"// Add aggregate module to tree",
"add",
"(",
"item",
")",
";",
"}",
"if",
"(",
"index",
"==",
"path",
".",
"length",
"-",
"1",
")",
"return",
"item",
";",
"else",
"return",
"item",
".",
"add",
"(",
"path",
",",
"index",
"+",
"1",
")",
";",
"}"
] | Find and add a child in the subtree if not found - do it recursively | [
"Find",
"and",
"add",
"a",
"child",
"in",
"the",
"subtree",
"if",
"not",
"found",
"-",
"do",
"it",
"recursively"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L104-L137 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.children | public ModuleItem[] children() {
if (children == null)
return null;
ModuleItem[] members = new ModuleItem[children.size()];
children.values().toArray(members);
return members;
} | java | public ModuleItem[] children() {
if (children == null)
return null;
ModuleItem[] members = new ModuleItem[children.size()];
children.values().toArray(members);
return members;
} | [
"public",
"ModuleItem",
"[",
"]",
"children",
"(",
")",
"{",
"if",
"(",
"children",
"==",
"null",
")",
"return",
"null",
";",
"ModuleItem",
"[",
"]",
"members",
"=",
"new",
"ModuleItem",
"[",
"children",
".",
"size",
"(",
")",
"]",
";",
"children",
".",
"values",
"(",
")",
".",
"toArray",
"(",
"members",
")",
";",
"return",
"members",
";",
"}"
] | Return an array of children - synchronized? | [
"Return",
"an",
"array",
"of",
"children",
"-",
"synchronized?"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L198-L205 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.remove | public synchronized void remove(ModuleItem item) {
if (item == null || children == null)
return;
// remove from all the parents which have links to it due to aggregate data
PmiModule removeInstance = item.getInstance();
if (!(removeInstance instanceof PmiModuleAggregate)) {
// recursively remove aggregate data for parents
ModuleItem myParent = this;
PmiModule parModule = null;
while (myParent != null) {
parModule = myParent.getInstance();
// if parent is aggregate
if (parModule != null && parModule instanceof PmiModuleAggregate)
((PmiModuleAggregate) parModule).remove(removeInstance);
myParent = myParent.getParent();
}
}
// remove any children
item._cleanChildren();
// remove ModuleItem
children.remove(item.getInstance().getName());
if (myStatsWithChildren != null) {
updateStatsTree();
}
//bStatsTreeNeedsUpdate = true;
// remove mbean mapping and deactivate any CustomStats mbean
//_cleanMBean(item);
item.getInstance().cleanup();
item = null;
} | java | public synchronized void remove(ModuleItem item) {
if (item == null || children == null)
return;
// remove from all the parents which have links to it due to aggregate data
PmiModule removeInstance = item.getInstance();
if (!(removeInstance instanceof PmiModuleAggregate)) {
// recursively remove aggregate data for parents
ModuleItem myParent = this;
PmiModule parModule = null;
while (myParent != null) {
parModule = myParent.getInstance();
// if parent is aggregate
if (parModule != null && parModule instanceof PmiModuleAggregate)
((PmiModuleAggregate) parModule).remove(removeInstance);
myParent = myParent.getParent();
}
}
// remove any children
item._cleanChildren();
// remove ModuleItem
children.remove(item.getInstance().getName());
if (myStatsWithChildren != null) {
updateStatsTree();
}
//bStatsTreeNeedsUpdate = true;
// remove mbean mapping and deactivate any CustomStats mbean
//_cleanMBean(item);
item.getInstance().cleanup();
item = null;
} | [
"public",
"synchronized",
"void",
"remove",
"(",
"ModuleItem",
"item",
")",
"{",
"if",
"(",
"item",
"==",
"null",
"||",
"children",
"==",
"null",
")",
"return",
";",
"// remove from all the parents which have links to it due to aggregate data",
"PmiModule",
"removeInstance",
"=",
"item",
".",
"getInstance",
"(",
")",
";",
"if",
"(",
"!",
"(",
"removeInstance",
"instanceof",
"PmiModuleAggregate",
")",
")",
"{",
"// recursively remove aggregate data for parents",
"ModuleItem",
"myParent",
"=",
"this",
";",
"PmiModule",
"parModule",
"=",
"null",
";",
"while",
"(",
"myParent",
"!=",
"null",
")",
"{",
"parModule",
"=",
"myParent",
".",
"getInstance",
"(",
")",
";",
"// if parent is aggregate",
"if",
"(",
"parModule",
"!=",
"null",
"&&",
"parModule",
"instanceof",
"PmiModuleAggregate",
")",
"(",
"(",
"PmiModuleAggregate",
")",
"parModule",
")",
".",
"remove",
"(",
"removeInstance",
")",
";",
"myParent",
"=",
"myParent",
".",
"getParent",
"(",
")",
";",
"}",
"}",
"// remove any children",
"item",
".",
"_cleanChildren",
"(",
")",
";",
"// remove ModuleItem",
"children",
".",
"remove",
"(",
"item",
".",
"getInstance",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"myStatsWithChildren",
"!=",
"null",
")",
"{",
"updateStatsTree",
"(",
")",
";",
"}",
"//bStatsTreeNeedsUpdate = true;",
"// remove mbean mapping and deactivate any CustomStats mbean",
"//_cleanMBean(item);",
"item",
".",
"getInstance",
"(",
")",
".",
"cleanup",
"(",
")",
";",
"item",
"=",
"null",
";",
"}"
] | Remove a child from it - synchronized | [
"Remove",
"a",
"child",
"from",
"it",
"-",
"synchronized"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L301-L337 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.listMembers | public DataDescriptor[] listMembers(DataDescriptor dd, boolean jmxBased) {
// take care of data members
SpdData[] dataList = null;
int dataLength = 0;
if (!jmxBased) {
dataList = instance.listData();
if (dataList != null)
dataLength = dataList.length;
}
// take care of non-data members
String[] nameList = null;
int itemLength = 0;
ModuleItem[] items = children();
if (items != null) {
itemLength = items.length;
nameList = new String[itemLength];
for (int i = 0; i < itemLength; i++) {
String[] path = items[i].getInstance().getPath();
nameList[i] = path[path.length - 1];
}
}
// create the returned array
// return both item (instance/submodule) descriptor and data descriptor if any
if (itemLength == 0 && dataLength == 0)
return null;
DataDescriptor[] res = new DataDescriptor[itemLength + dataLength];
for (int i = 0; i < itemLength; i++) {
res[i] = new DataDescriptor(dd, nameList[i]);
}
for (int i = 0; i < dataLength; i++) {
res[i + itemLength] = new DataDescriptor(dd, dataList[i].getId());
}
return res;
} | java | public DataDescriptor[] listMembers(DataDescriptor dd, boolean jmxBased) {
// take care of data members
SpdData[] dataList = null;
int dataLength = 0;
if (!jmxBased) {
dataList = instance.listData();
if (dataList != null)
dataLength = dataList.length;
}
// take care of non-data members
String[] nameList = null;
int itemLength = 0;
ModuleItem[] items = children();
if (items != null) {
itemLength = items.length;
nameList = new String[itemLength];
for (int i = 0; i < itemLength; i++) {
String[] path = items[i].getInstance().getPath();
nameList[i] = path[path.length - 1];
}
}
// create the returned array
// return both item (instance/submodule) descriptor and data descriptor if any
if (itemLength == 0 && dataLength == 0)
return null;
DataDescriptor[] res = new DataDescriptor[itemLength + dataLength];
for (int i = 0; i < itemLength; i++) {
res[i] = new DataDescriptor(dd, nameList[i]);
}
for (int i = 0; i < dataLength; i++) {
res[i + itemLength] = new DataDescriptor(dd, dataList[i].getId());
}
return res;
} | [
"public",
"DataDescriptor",
"[",
"]",
"listMembers",
"(",
"DataDescriptor",
"dd",
",",
"boolean",
"jmxBased",
")",
"{",
"// take care of data members",
"SpdData",
"[",
"]",
"dataList",
"=",
"null",
";",
"int",
"dataLength",
"=",
"0",
";",
"if",
"(",
"!",
"jmxBased",
")",
"{",
"dataList",
"=",
"instance",
".",
"listData",
"(",
")",
";",
"if",
"(",
"dataList",
"!=",
"null",
")",
"dataLength",
"=",
"dataList",
".",
"length",
";",
"}",
"// take care of non-data members",
"String",
"[",
"]",
"nameList",
"=",
"null",
";",
"int",
"itemLength",
"=",
"0",
";",
"ModuleItem",
"[",
"]",
"items",
"=",
"children",
"(",
")",
";",
"if",
"(",
"items",
"!=",
"null",
")",
"{",
"itemLength",
"=",
"items",
".",
"length",
";",
"nameList",
"=",
"new",
"String",
"[",
"itemLength",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"itemLength",
";",
"i",
"++",
")",
"{",
"String",
"[",
"]",
"path",
"=",
"items",
"[",
"i",
"]",
".",
"getInstance",
"(",
")",
".",
"getPath",
"(",
")",
";",
"nameList",
"[",
"i",
"]",
"=",
"path",
"[",
"path",
".",
"length",
"-",
"1",
"]",
";",
"}",
"}",
"// create the returned array",
"// return both item (instance/submodule) descriptor and data descriptor if any",
"if",
"(",
"itemLength",
"==",
"0",
"&&",
"dataLength",
"==",
"0",
")",
"return",
"null",
";",
"DataDescriptor",
"[",
"]",
"res",
"=",
"new",
"DataDescriptor",
"[",
"itemLength",
"+",
"dataLength",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"itemLength",
";",
"i",
"++",
")",
"{",
"res",
"[",
"i",
"]",
"=",
"new",
"DataDescriptor",
"(",
"dd",
",",
"nameList",
"[",
"i",
"]",
")",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"dataLength",
";",
"i",
"++",
")",
"{",
"res",
"[",
"i",
"+",
"itemLength",
"]",
"=",
"new",
"DataDescriptor",
"(",
"dd",
",",
"dataList",
"[",
"i",
"]",
".",
"getId",
"(",
")",
")",
";",
"}",
"return",
"res",
";",
"}"
] | dd is the DataDescriptor for this module | [
"dd",
"is",
"the",
"DataDescriptor",
"for",
"this",
"module"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L340-L379 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.getStats | public StatsImpl getStats(boolean recursive) {
// DO THIS METHOD NEED SYNCHRONIZED ACCESS?
// When multiple threads get inside the method and stats tree is updated
if (recursive) {
/*
* // if leaf then do not create myStatsWithChildren. Instead return myStats
* if (children == null && !bStatsTreeNeedsUpdate)
* {
* // return myStats
* if (myStats == null)
* {
* if (instance != null)
* myStats = instance.getStats (instance.listStatistics(), null);
* else
* myStats = new StatsImpl("server", TYPE_SERVER, level, null, null);
* }
*
* return myStats;
* }
* else
*/
// first time here
if (myStatsWithChildren == null) {
ArrayList dataMembers = null;
if (instance != null)
dataMembers = instance.listStatistics();
ArrayList colMembers = null; // return subcollection members
// getStats from children
ModuleItem[] items = children();
if (items != null) {
colMembers = new ArrayList(items.length);
for (int i = 0; i < items.length; i++) {
colMembers.add(items[i].getStats(recursive));
}
}
if (instance != null)
myStatsWithChildren = instance.getStats(dataMembers, colMembers);
else
myStatsWithChildren = new StatsImpl("server", TYPE_SERVER, level, null, colMembers);
} else {
updateStatisticsForStatsTree(System.currentTimeMillis()); // update external & aggregate statistics
}
return myStatsWithChildren;
}
// NON-RECURSIVE
else {
if (myStats == null) {
if (instance != null)
myStats = instance.getStats(instance.listStatistics(), null);
else
myStats = new StatsImpl("server", TYPE_SERVER, level, null, null);
} else {
if (instance != null)
instance.updateStatistics(); // update external & aggregate statistics
myStats.setTime(System.currentTimeMillis());
}
return myStats;
}
/*
* ArrayList dataMembers = instance.listStatistics();
* ArrayList colMembers = null; // return subcollection members
*
* if (recursive)
* {
* ModuleItem[] items = children();
*
* // getStats from children
* if(items != null)
* {
* colMembers = new ArrayList(items.length);
* for(int i=0; i<items.length; i++)
* {
* colMembers.add(items[i].getStats(recursive));
* }
* }
* }
*
* // return Stats - individual instance will return different XXXStats instance
* // Note: construct dataMembers in ModuleItem and pass it to instance
* // because getStats will be overwritten by subclasses
* // and we don't want to duplicate the same code.
*
* return instance.getStats(dataMembers, colMembers);
*/
} | java | public StatsImpl getStats(boolean recursive) {
// DO THIS METHOD NEED SYNCHRONIZED ACCESS?
// When multiple threads get inside the method and stats tree is updated
if (recursive) {
/*
* // if leaf then do not create myStatsWithChildren. Instead return myStats
* if (children == null && !bStatsTreeNeedsUpdate)
* {
* // return myStats
* if (myStats == null)
* {
* if (instance != null)
* myStats = instance.getStats (instance.listStatistics(), null);
* else
* myStats = new StatsImpl("server", TYPE_SERVER, level, null, null);
* }
*
* return myStats;
* }
* else
*/
// first time here
if (myStatsWithChildren == null) {
ArrayList dataMembers = null;
if (instance != null)
dataMembers = instance.listStatistics();
ArrayList colMembers = null; // return subcollection members
// getStats from children
ModuleItem[] items = children();
if (items != null) {
colMembers = new ArrayList(items.length);
for (int i = 0; i < items.length; i++) {
colMembers.add(items[i].getStats(recursive));
}
}
if (instance != null)
myStatsWithChildren = instance.getStats(dataMembers, colMembers);
else
myStatsWithChildren = new StatsImpl("server", TYPE_SERVER, level, null, colMembers);
} else {
updateStatisticsForStatsTree(System.currentTimeMillis()); // update external & aggregate statistics
}
return myStatsWithChildren;
}
// NON-RECURSIVE
else {
if (myStats == null) {
if (instance != null)
myStats = instance.getStats(instance.listStatistics(), null);
else
myStats = new StatsImpl("server", TYPE_SERVER, level, null, null);
} else {
if (instance != null)
instance.updateStatistics(); // update external & aggregate statistics
myStats.setTime(System.currentTimeMillis());
}
return myStats;
}
/*
* ArrayList dataMembers = instance.listStatistics();
* ArrayList colMembers = null; // return subcollection members
*
* if (recursive)
* {
* ModuleItem[] items = children();
*
* // getStats from children
* if(items != null)
* {
* colMembers = new ArrayList(items.length);
* for(int i=0; i<items.length; i++)
* {
* colMembers.add(items[i].getStats(recursive));
* }
* }
* }
*
* // return Stats - individual instance will return different XXXStats instance
* // Note: construct dataMembers in ModuleItem and pass it to instance
* // because getStats will be overwritten by subclasses
* // and we don't want to duplicate the same code.
*
* return instance.getStats(dataMembers, colMembers);
*/
} | [
"public",
"StatsImpl",
"getStats",
"(",
"boolean",
"recursive",
")",
"{",
"// DO THIS METHOD NEED SYNCHRONIZED ACCESS?",
"// When multiple threads get inside the method and stats tree is updated",
"if",
"(",
"recursive",
")",
"{",
"/*\n * // if leaf then do not create myStatsWithChildren. Instead return myStats\n * if (children == null && !bStatsTreeNeedsUpdate)\n * {\n * // return myStats\n * if (myStats == null)\n * {\n * if (instance != null)\n * myStats = instance.getStats (instance.listStatistics(), null);\n * else\n * myStats = new StatsImpl(\"server\", TYPE_SERVER, level, null, null);\n * }\n * \n * return myStats;\n * }\n * else\n */",
"// first time here",
"if",
"(",
"myStatsWithChildren",
"==",
"null",
")",
"{",
"ArrayList",
"dataMembers",
"=",
"null",
";",
"if",
"(",
"instance",
"!=",
"null",
")",
"dataMembers",
"=",
"instance",
".",
"listStatistics",
"(",
")",
";",
"ArrayList",
"colMembers",
"=",
"null",
";",
"// return subcollection members",
"// getStats from children",
"ModuleItem",
"[",
"]",
"items",
"=",
"children",
"(",
")",
";",
"if",
"(",
"items",
"!=",
"null",
")",
"{",
"colMembers",
"=",
"new",
"ArrayList",
"(",
"items",
".",
"length",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"items",
".",
"length",
";",
"i",
"++",
")",
"{",
"colMembers",
".",
"add",
"(",
"items",
"[",
"i",
"]",
".",
"getStats",
"(",
"recursive",
")",
")",
";",
"}",
"}",
"if",
"(",
"instance",
"!=",
"null",
")",
"myStatsWithChildren",
"=",
"instance",
".",
"getStats",
"(",
"dataMembers",
",",
"colMembers",
")",
";",
"else",
"myStatsWithChildren",
"=",
"new",
"StatsImpl",
"(",
"\"server\"",
",",
"TYPE_SERVER",
",",
"level",
",",
"null",
",",
"colMembers",
")",
";",
"}",
"else",
"{",
"updateStatisticsForStatsTree",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"// update external & aggregate statistics",
"}",
"return",
"myStatsWithChildren",
";",
"}",
"// NON-RECURSIVE",
"else",
"{",
"if",
"(",
"myStats",
"==",
"null",
")",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"myStats",
"=",
"instance",
".",
"getStats",
"(",
"instance",
".",
"listStatistics",
"(",
")",
",",
"null",
")",
";",
"else",
"myStats",
"=",
"new",
"StatsImpl",
"(",
"\"server\"",
",",
"TYPE_SERVER",
",",
"level",
",",
"null",
",",
"null",
")",
";",
"}",
"else",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"instance",
".",
"updateStatistics",
"(",
")",
";",
"// update external & aggregate statistics",
"myStats",
".",
"setTime",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"}",
"return",
"myStats",
";",
"}",
"/*\n * ArrayList dataMembers = instance.listStatistics();\n * ArrayList colMembers = null; // return subcollection members\n * \n * if (recursive)\n * {\n * ModuleItem[] items = children();\n * \n * // getStats from children\n * if(items != null)\n * {\n * colMembers = new ArrayList(items.length);\n * for(int i=0; i<items.length; i++)\n * {\n * colMembers.add(items[i].getStats(recursive));\n * }\n * }\n * }\n * \n * // return Stats - individual instance will return different XXXStats instance\n * // Note: construct dataMembers in ModuleItem and pass it to instance\n * // because getStats will be overwritten by subclasses\n * // and we don't want to duplicate the same code.\n * \n * return instance.getStats(dataMembers, colMembers);\n */",
"}"
] | is updated. | [
"is",
"updated",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L571-L661 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem.setInstanceLevel_FG | private void setInstanceLevel_FG(int[] enabled, int[] enabledSync, boolean recursive) {
if (instance != null) {
// Fine grained instrumentation overrides the old level
// First call setFineGrainedInstrumentation.
// If fine grained level is undefined called old setInstrumentationLevel
boolean action = instance.setFineGrainedInstrumentation(enabled, enabledSync);
/*
* not need since PmiConfigManager.updateWithRuntimeSpec is always called before persisting
* // Update in-memory EMF object (PMIModule)
* // call instance.getEnabled() to save the filtered set (filtering done by setFineGrainedInstrumentation, specifically bean module methods)
* if (PmiConfigManager.isInitialized())
* PmiConfigManager.updateSpec(instance.getPath(), instance.getWCCMStatsType(), instance.getEnabled(), instance.getEnabledSync(), false, false);
*/
// FIXME: updating parent. may need to call this conditionally - when there is a change in fg spec
updateParent();
}
if (recursive) {
ModuleItem[] items = children();
if (items == null)
return;
for (int i = 0; i < items.length; i++) {
items[i].setInstanceLevel_FG(enabled, enabledSync, recursive);
}
}
} | java | private void setInstanceLevel_FG(int[] enabled, int[] enabledSync, boolean recursive) {
if (instance != null) {
// Fine grained instrumentation overrides the old level
// First call setFineGrainedInstrumentation.
// If fine grained level is undefined called old setInstrumentationLevel
boolean action = instance.setFineGrainedInstrumentation(enabled, enabledSync);
/*
* not need since PmiConfigManager.updateWithRuntimeSpec is always called before persisting
* // Update in-memory EMF object (PMIModule)
* // call instance.getEnabled() to save the filtered set (filtering done by setFineGrainedInstrumentation, specifically bean module methods)
* if (PmiConfigManager.isInitialized())
* PmiConfigManager.updateSpec(instance.getPath(), instance.getWCCMStatsType(), instance.getEnabled(), instance.getEnabledSync(), false, false);
*/
// FIXME: updating parent. may need to call this conditionally - when there is a change in fg spec
updateParent();
}
if (recursive) {
ModuleItem[] items = children();
if (items == null)
return;
for (int i = 0; i < items.length; i++) {
items[i].setInstanceLevel_FG(enabled, enabledSync, recursive);
}
}
} | [
"private",
"void",
"setInstanceLevel_FG",
"(",
"int",
"[",
"]",
"enabled",
",",
"int",
"[",
"]",
"enabledSync",
",",
"boolean",
"recursive",
")",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"// Fine grained instrumentation overrides the old level",
"// First call setFineGrainedInstrumentation.",
"// If fine grained level is undefined called old setInstrumentationLevel",
"boolean",
"action",
"=",
"instance",
".",
"setFineGrainedInstrumentation",
"(",
"enabled",
",",
"enabledSync",
")",
";",
"/*\n * not need since PmiConfigManager.updateWithRuntimeSpec is always called before persisting\n * // Update in-memory EMF object (PMIModule)\n * // call instance.getEnabled() to save the filtered set (filtering done by setFineGrainedInstrumentation, specifically bean module methods)\n * if (PmiConfigManager.isInitialized())\n * PmiConfigManager.updateSpec(instance.getPath(), instance.getWCCMStatsType(), instance.getEnabled(), instance.getEnabledSync(), false, false);\n */",
"// FIXME: updating parent. may need to call this conditionally - when there is a change in fg spec ",
"updateParent",
"(",
")",
";",
"}",
"if",
"(",
"recursive",
")",
"{",
"ModuleItem",
"[",
"]",
"items",
"=",
"children",
"(",
")",
";",
"if",
"(",
"items",
"==",
"null",
")",
"return",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"items",
".",
"length",
";",
"i",
"++",
")",
"{",
"items",
"[",
"i",
"]",
".",
"setInstanceLevel_FG",
"(",
"enabled",
",",
"enabledSync",
",",
"recursive",
")",
";",
"}",
"}",
"}"
] | add data to parent if the newLevel is higher | [
"add",
"data",
"to",
"parent",
"if",
"the",
"newLevel",
"is",
"higher"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L753-L780 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java | ModuleItem._cleanChildren | private void _cleanChildren() {
//bStatsTreeNeedsUpdate = true;
if (children != null) {
Iterator values = children.values().iterator();
while (values.hasNext()) {
ModuleItem remMI = (ModuleItem) values.next();
remMI.getInstance().cleanup();
//_cleanMBean(remMI);
remMI._cleanChildren();
remMI = null;
}
children.clear();
}
} | java | private void _cleanChildren() {
//bStatsTreeNeedsUpdate = true;
if (children != null) {
Iterator values = children.values().iterator();
while (values.hasNext()) {
ModuleItem remMI = (ModuleItem) values.next();
remMI.getInstance().cleanup();
//_cleanMBean(remMI);
remMI._cleanChildren();
remMI = null;
}
children.clear();
}
} | [
"private",
"void",
"_cleanChildren",
"(",
")",
"{",
"//bStatsTreeNeedsUpdate = true;",
"if",
"(",
"children",
"!=",
"null",
")",
"{",
"Iterator",
"values",
"=",
"children",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"values",
".",
"hasNext",
"(",
")",
")",
"{",
"ModuleItem",
"remMI",
"=",
"(",
"ModuleItem",
")",
"values",
".",
"next",
"(",
")",
";",
"remMI",
".",
"getInstance",
"(",
")",
".",
"cleanup",
"(",
")",
";",
"//_cleanMBean(remMI);",
"remMI",
".",
"_cleanChildren",
"(",
")",
";",
"remMI",
"=",
"null",
";",
"}",
"children",
".",
"clear",
"(",
")",
";",
"}",
"}"
] | recursively remove reference to child ModuleItem from children ArrayList | [
"recursively",
"remove",
"reference",
"to",
"child",
"ModuleItem",
"from",
"children",
"ArrayList"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/ModuleItem.java#L898-L914 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java | LibertyServiceImpl.configureCustomizeBinding | protected void configureCustomizeBinding(Client client, QName portName) {
//put all properties defined in ibm-ws-bnd.xml into the client request context
Map<String, Object> requestContext = client.getRequestContext();
if (null != requestContext && null != wsrInfo) {
PortComponentRefInfo portRefInfo = wsrInfo.getPortComponentRefInfo(portName);
Map<String, String> wsrProps = wsrInfo.getProperties();
Map<String, String> portProps = (null != portRefInfo) ? portRefInfo.getProperties() : null;
if (null != wsrProps) {
requestContext.putAll(wsrProps);
}
if (null != portProps) {
requestContext.putAll(portProps);
}
if (null != wsrProps && Boolean.valueOf(wsrProps.get(JaxWsConstants.ENABLE_lOGGINGINOUTINTERCEPTOR))) {
List<Interceptor<? extends Message>> inInterceptors = client.getInInterceptors();
inInterceptors.add(new LoggingInInterceptor());
List<Interceptor<? extends Message>> outInterceptors = client.getOutInterceptors();
outInterceptors.add(new LoggingOutInterceptor());
}
}
Set<ConfigProperties> configPropsSet = servicePropertiesMap.get(portName);
client.getOutInterceptors().add(new LibertyCustomizeBindingOutInterceptor(wsrInfo, securityConfigService, configPropsSet));
//need to add an interceptor to clean up HTTPTransportActivator.sorted & props via calling HTTPTransportActivator. deleted(String)
//Memory Leak fix for 130985
client.getOutInterceptors().add(new LibertyCustomizeBindingOutEndingInterceptor(wsrInfo));
} | java | protected void configureCustomizeBinding(Client client, QName portName) {
//put all properties defined in ibm-ws-bnd.xml into the client request context
Map<String, Object> requestContext = client.getRequestContext();
if (null != requestContext && null != wsrInfo) {
PortComponentRefInfo portRefInfo = wsrInfo.getPortComponentRefInfo(portName);
Map<String, String> wsrProps = wsrInfo.getProperties();
Map<String, String> portProps = (null != portRefInfo) ? portRefInfo.getProperties() : null;
if (null != wsrProps) {
requestContext.putAll(wsrProps);
}
if (null != portProps) {
requestContext.putAll(portProps);
}
if (null != wsrProps && Boolean.valueOf(wsrProps.get(JaxWsConstants.ENABLE_lOGGINGINOUTINTERCEPTOR))) {
List<Interceptor<? extends Message>> inInterceptors = client.getInInterceptors();
inInterceptors.add(new LoggingInInterceptor());
List<Interceptor<? extends Message>> outInterceptors = client.getOutInterceptors();
outInterceptors.add(new LoggingOutInterceptor());
}
}
Set<ConfigProperties> configPropsSet = servicePropertiesMap.get(portName);
client.getOutInterceptors().add(new LibertyCustomizeBindingOutInterceptor(wsrInfo, securityConfigService, configPropsSet));
//need to add an interceptor to clean up HTTPTransportActivator.sorted & props via calling HTTPTransportActivator. deleted(String)
//Memory Leak fix for 130985
client.getOutInterceptors().add(new LibertyCustomizeBindingOutEndingInterceptor(wsrInfo));
} | [
"protected",
"void",
"configureCustomizeBinding",
"(",
"Client",
"client",
",",
"QName",
"portName",
")",
"{",
"//put all properties defined in ibm-ws-bnd.xml into the client request context",
"Map",
"<",
"String",
",",
"Object",
">",
"requestContext",
"=",
"client",
".",
"getRequestContext",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"requestContext",
"&&",
"null",
"!=",
"wsrInfo",
")",
"{",
"PortComponentRefInfo",
"portRefInfo",
"=",
"wsrInfo",
".",
"getPortComponentRefInfo",
"(",
"portName",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"wsrProps",
"=",
"wsrInfo",
".",
"getProperties",
"(",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"portProps",
"=",
"(",
"null",
"!=",
"portRefInfo",
")",
"?",
"portRefInfo",
".",
"getProperties",
"(",
")",
":",
"null",
";",
"if",
"(",
"null",
"!=",
"wsrProps",
")",
"{",
"requestContext",
".",
"putAll",
"(",
"wsrProps",
")",
";",
"}",
"if",
"(",
"null",
"!=",
"portProps",
")",
"{",
"requestContext",
".",
"putAll",
"(",
"portProps",
")",
";",
"}",
"if",
"(",
"null",
"!=",
"wsrProps",
"&&",
"Boolean",
".",
"valueOf",
"(",
"wsrProps",
".",
"get",
"(",
"JaxWsConstants",
".",
"ENABLE_lOGGINGINOUTINTERCEPTOR",
")",
")",
")",
"{",
"List",
"<",
"Interceptor",
"<",
"?",
"extends",
"Message",
">",
">",
"inInterceptors",
"=",
"client",
".",
"getInInterceptors",
"(",
")",
";",
"inInterceptors",
".",
"add",
"(",
"new",
"LoggingInInterceptor",
"(",
")",
")",
";",
"List",
"<",
"Interceptor",
"<",
"?",
"extends",
"Message",
">",
">",
"outInterceptors",
"=",
"client",
".",
"getOutInterceptors",
"(",
")",
";",
"outInterceptors",
".",
"add",
"(",
"new",
"LoggingOutInterceptor",
"(",
")",
")",
";",
"}",
"}",
"Set",
"<",
"ConfigProperties",
">",
"configPropsSet",
"=",
"servicePropertiesMap",
".",
"get",
"(",
"portName",
")",
";",
"client",
".",
"getOutInterceptors",
"(",
")",
".",
"add",
"(",
"new",
"LibertyCustomizeBindingOutInterceptor",
"(",
"wsrInfo",
",",
"securityConfigService",
",",
"configPropsSet",
")",
")",
";",
"//need to add an interceptor to clean up HTTPTransportActivator.sorted & props via calling HTTPTransportActivator. deleted(String)",
"//Memory Leak fix for 130985",
"client",
".",
"getOutInterceptors",
"(",
")",
".",
"add",
"(",
"new",
"LibertyCustomizeBindingOutEndingInterceptor",
"(",
"wsrInfo",
")",
")",
";",
"}"
] | Add the LibertyCustomizeBindingOutInterceptor in the out interceptor chain.
@param client
@param portName | [
"Add",
"the",
"LibertyCustomizeBindingOutInterceptor",
"in",
"the",
"out",
"interceptor",
"chain",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java#L134-L165 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java | LibertyServiceImpl.getWebServiceFeaturesOnPortComponentRef | private WebServiceFeature[] getWebServiceFeaturesOnPortComponentRef(Class serviceEndpointInterface) {
WebServiceFeature[] returnArray = {};
if (serviceEndpointInterface != null && wsrInfo != null) {
String seiName = serviceEndpointInterface.getName();
PortComponentRefInfo pcr = wsrInfo.getPortComponentRefInfo(seiName);
if (tc.isDebugEnabled()) {
Tr.debug(tc, "SEI name = " + seiName);
Tr.debug(tc, "PortComponentRefInfo found = " + pcr);
}
if (pcr != null) {
List<WebServiceFeatureInfo> featureInfoList = pcr.getWebServiceFeatureInfos();
if (tc.isDebugEnabled()) {
Tr.debug(tc, "List of WebServiceFeatureInfo from PortComponentRefInfo = " + featureInfoList);
}
if (!featureInfoList.isEmpty()) {
returnArray = new WebServiceFeature[featureInfoList.size()];
for (int i = 0; i < featureInfoList.size(); i++) {
WebServiceFeatureInfo featureInfo = featureInfoList.get(i);
WebServiceFeature wsf = featureInfo.getWebServiceFeature();
returnArray[i] = wsf;
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Added WebServiceFeature " + wsf);
}
}
}
}
}
return returnArray;
} | java | private WebServiceFeature[] getWebServiceFeaturesOnPortComponentRef(Class serviceEndpointInterface) {
WebServiceFeature[] returnArray = {};
if (serviceEndpointInterface != null && wsrInfo != null) {
String seiName = serviceEndpointInterface.getName();
PortComponentRefInfo pcr = wsrInfo.getPortComponentRefInfo(seiName);
if (tc.isDebugEnabled()) {
Tr.debug(tc, "SEI name = " + seiName);
Tr.debug(tc, "PortComponentRefInfo found = " + pcr);
}
if (pcr != null) {
List<WebServiceFeatureInfo> featureInfoList = pcr.getWebServiceFeatureInfos();
if (tc.isDebugEnabled()) {
Tr.debug(tc, "List of WebServiceFeatureInfo from PortComponentRefInfo = " + featureInfoList);
}
if (!featureInfoList.isEmpty()) {
returnArray = new WebServiceFeature[featureInfoList.size()];
for (int i = 0; i < featureInfoList.size(); i++) {
WebServiceFeatureInfo featureInfo = featureInfoList.get(i);
WebServiceFeature wsf = featureInfo.getWebServiceFeature();
returnArray[i] = wsf;
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Added WebServiceFeature " + wsf);
}
}
}
}
}
return returnArray;
} | [
"private",
"WebServiceFeature",
"[",
"]",
"getWebServiceFeaturesOnPortComponentRef",
"(",
"Class",
"serviceEndpointInterface",
")",
"{",
"WebServiceFeature",
"[",
"]",
"returnArray",
"=",
"{",
"}",
";",
"if",
"(",
"serviceEndpointInterface",
"!=",
"null",
"&&",
"wsrInfo",
"!=",
"null",
")",
"{",
"String",
"seiName",
"=",
"serviceEndpointInterface",
".",
"getName",
"(",
")",
";",
"PortComponentRefInfo",
"pcr",
"=",
"wsrInfo",
".",
"getPortComponentRefInfo",
"(",
"seiName",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"SEI name = \"",
"+",
"seiName",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"PortComponentRefInfo found = \"",
"+",
"pcr",
")",
";",
"}",
"if",
"(",
"pcr",
"!=",
"null",
")",
"{",
"List",
"<",
"WebServiceFeatureInfo",
">",
"featureInfoList",
"=",
"pcr",
".",
"getWebServiceFeatureInfos",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"List of WebServiceFeatureInfo from PortComponentRefInfo = \"",
"+",
"featureInfoList",
")",
";",
"}",
"if",
"(",
"!",
"featureInfoList",
".",
"isEmpty",
"(",
")",
")",
"{",
"returnArray",
"=",
"new",
"WebServiceFeature",
"[",
"featureInfoList",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"featureInfoList",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"WebServiceFeatureInfo",
"featureInfo",
"=",
"featureInfoList",
".",
"get",
"(",
"i",
")",
";",
"WebServiceFeature",
"wsf",
"=",
"featureInfo",
".",
"getWebServiceFeature",
"(",
")",
";",
"returnArray",
"[",
"i",
"]",
"=",
"wsf",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Added WebServiceFeature \"",
"+",
"wsf",
")",
";",
"}",
"}",
"}",
"}",
"}",
"return",
"returnArray",
";",
"}"
] | Gets an array of features possibly enabled on client's
port-component-ref in the deployment descriptor | [
"Gets",
"an",
"array",
"of",
"features",
"possibly",
"enabled",
"on",
"client",
"s",
"port",
"-",
"component",
"-",
"ref",
"in",
"the",
"deployment",
"descriptor"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java#L171-L204 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java | LibertyServiceImpl.configureClientProperties | private void configureClientProperties() throws IOException {
Map<String, String> serviceRefProps = wsrInfo.getProperties();
Iterator<QName> iterator = this.getPorts();//wsrInfo.getBindingPortComponentRefInfoList();
while (null != iterator && iterator.hasNext()) {
QName portQName = iterator.next();
PortComponentRefInfo portInfo = wsrInfo.getPortComponentRefInfo(portQName);
Map<String, String> portProps = (null != portInfo) ? portInfo.getProperties() : null;
if ((null != serviceRefProps || null != portProps)) {
prepareProperties(portQName, serviceRefProps, portProps);
}
}
} | java | private void configureClientProperties() throws IOException {
Map<String, String> serviceRefProps = wsrInfo.getProperties();
Iterator<QName> iterator = this.getPorts();//wsrInfo.getBindingPortComponentRefInfoList();
while (null != iterator && iterator.hasNext()) {
QName portQName = iterator.next();
PortComponentRefInfo portInfo = wsrInfo.getPortComponentRefInfo(portQName);
Map<String, String> portProps = (null != portInfo) ? portInfo.getProperties() : null;
if ((null != serviceRefProps || null != portProps)) {
prepareProperties(portQName, serviceRefProps, portProps);
}
}
} | [
"private",
"void",
"configureClientProperties",
"(",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"serviceRefProps",
"=",
"wsrInfo",
".",
"getProperties",
"(",
")",
";",
"Iterator",
"<",
"QName",
">",
"iterator",
"=",
"this",
".",
"getPorts",
"(",
")",
";",
"//wsrInfo.getBindingPortComponentRefInfoList();",
"while",
"(",
"null",
"!=",
"iterator",
"&&",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"QName",
"portQName",
"=",
"iterator",
".",
"next",
"(",
")",
";",
"PortComponentRefInfo",
"portInfo",
"=",
"wsrInfo",
".",
"getPortComponentRefInfo",
"(",
"portQName",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"portProps",
"=",
"(",
"null",
"!=",
"portInfo",
")",
"?",
"portInfo",
".",
"getProperties",
"(",
")",
":",
"null",
";",
"if",
"(",
"(",
"null",
"!=",
"serviceRefProps",
"||",
"null",
"!=",
"portProps",
")",
")",
"{",
"prepareProperties",
"(",
"portQName",
",",
"serviceRefProps",
",",
"portProps",
")",
";",
"}",
"}",
"}"
] | configure the http conduit properties defined in the custom binding file. | [
"configure",
"the",
"http",
"conduit",
"properties",
"defined",
"in",
"the",
"custom",
"binding",
"file",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java#L209-L222 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java | LibertyServiceImpl.prepareProperties | private void prepareProperties(QName portQName, Map<String, String> serviceRefProps, Map<String, String> portProps) throws IOException {
// Merge the properties form port and service.
Map<String, String> allProperties = new HashMap<String, String>();
if (null != serviceRefProps) {
allProperties.putAll(serviceRefProps);
}
if (null != portProps) {
allProperties.putAll(portProps);
}
for (Map.Entry<String, String> entry : servicePidToPropertyPrefixMap.entrySet()) {
String serviceFactoryPid = entry.getKey();
String prefix = entry.getValue();
// Extract the properties according to different property prefix,
// update the extracted properties by corresponding factory service.
Map<String, String> extractProps = extract(prefix, allProperties);
// Put the port QName and the properties into the servicePropertiesMap
ConfigProperties configProps = new ConfigProperties(serviceFactoryPid, extractProps);
Set<ConfigProperties> configSet = servicePropertiesMap.get(portQName);
if (null == configSet) {
configSet = new HashSet<ConfigProperties>();
servicePropertiesMap.put(portQName, configSet);
}
if (configSet.contains(configProps)) {
// re-add the config props
configSet.remove(configProps);
configSet.add(configProps);
} else {
configSet.add(configProps);
}
}
} | java | private void prepareProperties(QName portQName, Map<String, String> serviceRefProps, Map<String, String> portProps) throws IOException {
// Merge the properties form port and service.
Map<String, String> allProperties = new HashMap<String, String>();
if (null != serviceRefProps) {
allProperties.putAll(serviceRefProps);
}
if (null != portProps) {
allProperties.putAll(portProps);
}
for (Map.Entry<String, String> entry : servicePidToPropertyPrefixMap.entrySet()) {
String serviceFactoryPid = entry.getKey();
String prefix = entry.getValue();
// Extract the properties according to different property prefix,
// update the extracted properties by corresponding factory service.
Map<String, String> extractProps = extract(prefix, allProperties);
// Put the port QName and the properties into the servicePropertiesMap
ConfigProperties configProps = new ConfigProperties(serviceFactoryPid, extractProps);
Set<ConfigProperties> configSet = servicePropertiesMap.get(portQName);
if (null == configSet) {
configSet = new HashSet<ConfigProperties>();
servicePropertiesMap.put(portQName, configSet);
}
if (configSet.contains(configProps)) {
// re-add the config props
configSet.remove(configProps);
configSet.add(configProps);
} else {
configSet.add(configProps);
}
}
} | [
"private",
"void",
"prepareProperties",
"(",
"QName",
"portQName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"serviceRefProps",
",",
"Map",
"<",
"String",
",",
"String",
">",
"portProps",
")",
"throws",
"IOException",
"{",
"// Merge the properties form port and service.",
"Map",
"<",
"String",
",",
"String",
">",
"allProperties",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"serviceRefProps",
")",
"{",
"allProperties",
".",
"putAll",
"(",
"serviceRefProps",
")",
";",
"}",
"if",
"(",
"null",
"!=",
"portProps",
")",
"{",
"allProperties",
".",
"putAll",
"(",
"portProps",
")",
";",
"}",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"servicePidToPropertyPrefixMap",
".",
"entrySet",
"(",
")",
")",
"{",
"String",
"serviceFactoryPid",
"=",
"entry",
".",
"getKey",
"(",
")",
";",
"String",
"prefix",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"// Extract the properties according to different property prefix,",
"// update the extracted properties by corresponding factory service.",
"Map",
"<",
"String",
",",
"String",
">",
"extractProps",
"=",
"extract",
"(",
"prefix",
",",
"allProperties",
")",
";",
"// Put the port QName and the properties into the servicePropertiesMap",
"ConfigProperties",
"configProps",
"=",
"new",
"ConfigProperties",
"(",
"serviceFactoryPid",
",",
"extractProps",
")",
";",
"Set",
"<",
"ConfigProperties",
">",
"configSet",
"=",
"servicePropertiesMap",
".",
"get",
"(",
"portQName",
")",
";",
"if",
"(",
"null",
"==",
"configSet",
")",
"{",
"configSet",
"=",
"new",
"HashSet",
"<",
"ConfigProperties",
">",
"(",
")",
";",
"servicePropertiesMap",
".",
"put",
"(",
"portQName",
",",
"configSet",
")",
";",
"}",
"if",
"(",
"configSet",
".",
"contains",
"(",
"configProps",
")",
")",
"{",
"// re-add the config props",
"configSet",
".",
"remove",
"(",
"configProps",
")",
";",
"configSet",
".",
"add",
"(",
"configProps",
")",
";",
"}",
"else",
"{",
"configSet",
".",
"add",
"(",
"configProps",
")",
";",
"}",
"}",
"}"
] | merge the serviceRef properties and port properties, and update the merged properties in the configAdmin service.
@param configAdmin
@param serviceRefProps
@param portProps
@return
@throws IOException | [
"merge",
"the",
"serviceRef",
"properties",
"and",
"port",
"properties",
"and",
"update",
"the",
"merged",
"properties",
"in",
"the",
"configAdmin",
"service",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java#L233-L269 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java | LibertyServiceImpl.extract | protected Map<String, String> extract(String propertyPrefix, Map<String, String> properties, boolean removeProps) {
if (null == properties || properties.isEmpty()) {
return Collections.<String, String> emptyMap();
}
Map<String, String> extractProps = new HashMap<String, String>();
Iterator<Map.Entry<String, String>> propIter = properties.entrySet().iterator();
while (propIter.hasNext()) {
Map.Entry<String, String> propEntry = propIter.next();
if (null != propEntry.getKey() && propEntry.getKey().startsWith(propertyPrefix)) {
String propKey = propEntry.getKey().substring(propertyPrefix.length());
extractProps.put(propKey, propEntry.getValue());
if (removeProps) {
propIter.remove();
}
}
}
return extractProps;
} | java | protected Map<String, String> extract(String propertyPrefix, Map<String, String> properties, boolean removeProps) {
if (null == properties || properties.isEmpty()) {
return Collections.<String, String> emptyMap();
}
Map<String, String> extractProps = new HashMap<String, String>();
Iterator<Map.Entry<String, String>> propIter = properties.entrySet().iterator();
while (propIter.hasNext()) {
Map.Entry<String, String> propEntry = propIter.next();
if (null != propEntry.getKey() && propEntry.getKey().startsWith(propertyPrefix)) {
String propKey = propEntry.getKey().substring(propertyPrefix.length());
extractProps.put(propKey, propEntry.getValue());
if (removeProps) {
propIter.remove();
}
}
}
return extractProps;
} | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"extract",
"(",
"String",
"propertyPrefix",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
",",
"boolean",
"removeProps",
")",
"{",
"if",
"(",
"null",
"==",
"properties",
"||",
"properties",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"Collections",
".",
"<",
"String",
",",
"String",
">",
"emptyMap",
"(",
")",
";",
"}",
"Map",
"<",
"String",
",",
"String",
">",
"extractProps",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
">",
"propIter",
"=",
"properties",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"propIter",
".",
"hasNext",
"(",
")",
")",
"{",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"propEntry",
"=",
"propIter",
".",
"next",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"propEntry",
".",
"getKey",
"(",
")",
"&&",
"propEntry",
".",
"getKey",
"(",
")",
".",
"startsWith",
"(",
"propertyPrefix",
")",
")",
"{",
"String",
"propKey",
"=",
"propEntry",
".",
"getKey",
"(",
")",
".",
"substring",
"(",
"propertyPrefix",
".",
"length",
"(",
")",
")",
";",
"extractProps",
".",
"put",
"(",
"propKey",
",",
"propEntry",
".",
"getValue",
"(",
")",
")",
";",
"if",
"(",
"removeProps",
")",
"{",
"propIter",
".",
"remove",
"(",
")",
";",
"}",
"}",
"}",
"return",
"extractProps",
";",
"}"
] | Extract the properties according to the property prefix.
@param propertyPrefix
@param properties
@param removeProps if is true, will remove the properties that have be extracted.
@return | [
"Extract",
"the",
"properties",
"according",
"to",
"the",
"property",
"prefix",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java#L279-L299 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java | LibertyServiceImpl.extract | protected Map<String, String> extract(String propertyPrefix, Map<String, String> properties) {
return extract(propertyPrefix, properties, true);
} | java | protected Map<String, String> extract(String propertyPrefix, Map<String, String> properties) {
return extract(propertyPrefix, properties, true);
} | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"extract",
"(",
"String",
"propertyPrefix",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"return",
"extract",
"(",
"propertyPrefix",
",",
"properties",
",",
"true",
")",
";",
"}"
] | Extract the properties according to the property prefix, will remove the extracted properties from original properties.
@param propertyPrefix
@param properties
@return | [
"Extract",
"the",
"properties",
"according",
"to",
"the",
"property",
"prefix",
"will",
"remove",
"the",
"extracted",
"properties",
"from",
"original",
"properties",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.common/src/com/ibm/ws/jaxws/client/LibertyServiceImpl.java#L308-L310 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/tasks/BasePluginConfigCommandTask.java | BasePluginConfigCommandTask.isKnownArgument | private boolean isKnownArgument(String arg) {
final String argName = getArgName(arg);
for (String key : knownArgs) {
if (key.equalsIgnoreCase(argName)) {
return true;
}
}
return false;
} | java | private boolean isKnownArgument(String arg) {
final String argName = getArgName(arg);
for (String key : knownArgs) {
if (key.equalsIgnoreCase(argName)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isKnownArgument",
"(",
"String",
"arg",
")",
"{",
"final",
"String",
"argName",
"=",
"getArgName",
"(",
"arg",
")",
";",
"for",
"(",
"String",
"key",
":",
"knownArgs",
")",
"{",
"if",
"(",
"key",
".",
"equalsIgnoreCase",
"(",
"argName",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] | Checks if the argument is a known argument to the task.
@param arg
@return | [
"Checks",
"if",
"the",
"argument",
"is",
"a",
"known",
"argument",
"to",
"the",
"task",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/tasks/BasePluginConfigCommandTask.java#L153-L161 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/tasks/BasePluginConfigCommandTask.java | BasePluginConfigCommandTask.getTaskHelp | protected String getTaskHelp(String desc, String usage,
String optionKeyPrefix, String optionDescPrefix,
String addonKey, String footer,
Object... args) {
StringBuilder scriptHelp = new StringBuilder();
scriptHelp.append(NL);
scriptHelp.append(getOption("global.description"));
scriptHelp.append(NL);
scriptHelp.append(getOption(desc));
scriptHelp.append(NL);
// print a empty line
scriptHelp.append(NL);
scriptHelp.append(getOption("global.usage"));
scriptHelp.append(NL);
scriptHelp.append(getOption(usage));
scriptHelp.append(NL);
String options = buildScriptOptions(optionKeyPrefix, optionDescPrefix);
if (!options.isEmpty()) {
// print a empty line
scriptHelp.append(NL);
scriptHelp.append(getOption("global.options"));
scriptHelp.append(options);
}
if (addonKey != null && !addonKey.isEmpty()) {
// print a empty line
scriptHelp.append(NL);
scriptHelp.append(getOption(addonKey));
}
if (footer != null && !footer.isEmpty()) {
scriptHelp.append(footer);
}
scriptHelp.append(NL);
if (args.length == 0) {
return scriptHelp.toString();
} else {
return MessageFormat.format(scriptHelp.toString(), args);
}
} | java | protected String getTaskHelp(String desc, String usage,
String optionKeyPrefix, String optionDescPrefix,
String addonKey, String footer,
Object... args) {
StringBuilder scriptHelp = new StringBuilder();
scriptHelp.append(NL);
scriptHelp.append(getOption("global.description"));
scriptHelp.append(NL);
scriptHelp.append(getOption(desc));
scriptHelp.append(NL);
// print a empty line
scriptHelp.append(NL);
scriptHelp.append(getOption("global.usage"));
scriptHelp.append(NL);
scriptHelp.append(getOption(usage));
scriptHelp.append(NL);
String options = buildScriptOptions(optionKeyPrefix, optionDescPrefix);
if (!options.isEmpty()) {
// print a empty line
scriptHelp.append(NL);
scriptHelp.append(getOption("global.options"));
scriptHelp.append(options);
}
if (addonKey != null && !addonKey.isEmpty()) {
// print a empty line
scriptHelp.append(NL);
scriptHelp.append(getOption(addonKey));
}
if (footer != null && !footer.isEmpty()) {
scriptHelp.append(footer);
}
scriptHelp.append(NL);
if (args.length == 0) {
return scriptHelp.toString();
} else {
return MessageFormat.format(scriptHelp.toString(), args);
}
} | [
"protected",
"String",
"getTaskHelp",
"(",
"String",
"desc",
",",
"String",
"usage",
",",
"String",
"optionKeyPrefix",
",",
"String",
"optionDescPrefix",
",",
"String",
"addonKey",
",",
"String",
"footer",
",",
"Object",
"...",
"args",
")",
"{",
"StringBuilder",
"scriptHelp",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"scriptHelp",
".",
"append",
"(",
"getOption",
"(",
"\"global.description\"",
")",
")",
";",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"scriptHelp",
".",
"append",
"(",
"getOption",
"(",
"desc",
")",
")",
";",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"// print a empty line",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"scriptHelp",
".",
"append",
"(",
"getOption",
"(",
"\"global.usage\"",
")",
")",
";",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"scriptHelp",
".",
"append",
"(",
"getOption",
"(",
"usage",
")",
")",
";",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"String",
"options",
"=",
"buildScriptOptions",
"(",
"optionKeyPrefix",
",",
"optionDescPrefix",
")",
";",
"if",
"(",
"!",
"options",
".",
"isEmpty",
"(",
")",
")",
"{",
"// print a empty line",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"scriptHelp",
".",
"append",
"(",
"getOption",
"(",
"\"global.options\"",
")",
")",
";",
"scriptHelp",
".",
"append",
"(",
"options",
")",
";",
"}",
"if",
"(",
"addonKey",
"!=",
"null",
"&&",
"!",
"addonKey",
".",
"isEmpty",
"(",
")",
")",
"{",
"// print a empty line",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"scriptHelp",
".",
"append",
"(",
"getOption",
"(",
"addonKey",
")",
")",
";",
"}",
"if",
"(",
"footer",
"!=",
"null",
"&&",
"!",
"footer",
".",
"isEmpty",
"(",
")",
")",
"{",
"scriptHelp",
".",
"append",
"(",
"footer",
")",
";",
"}",
"scriptHelp",
".",
"append",
"(",
"NL",
")",
";",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"return",
"scriptHelp",
".",
"toString",
"(",
")",
";",
"}",
"else",
"{",
"return",
"MessageFormat",
".",
"format",
"(",
"scriptHelp",
".",
"toString",
"(",
")",
",",
"args",
")",
";",
"}",
"}"
] | Generate the formatted task help.
@param desc the description NLS key
@param usage the usage NLS key
@param optionKeyPrefix the option name NLS key prefix
@param optionDescPrefix the option description NLS key prefix
@param addonKey an addon NLS key prefix
@param footer a raw (already translated) String to append to the output
@param args any arguments to pass to the formating keys (order matters)
@return | [
"Generate",
"the",
"formatted",
"task",
"help",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/tasks/BasePluginConfigCommandTask.java#L293-L337 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/SubscriptionDefinitionImpl.java | SubscriptionDefinitionImpl.getDestination | public String getDestination()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getDestination");
SibTr.exit(tc, "getDestination", destination);
}
return destination;
} | java | public String getDestination()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getDestination");
SibTr.exit(tc, "getDestination", destination);
}
return destination;
} | [
"public",
"String",
"getDestination",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getDestination\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getDestination\"",
",",
"destination",
")",
";",
"}",
"return",
"destination",
";",
"}"
] | Returns the destination.
@return String | [
"Returns",
"the",
"destination",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/SubscriptionDefinitionImpl.java#L91-L100 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/SubscriptionDefinitionImpl.java | SubscriptionDefinitionImpl.getSelector | public String getSelector()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getSelector");
SibTr.exit(tc, "getSelector", selector);
}
return selector;
} | java | public String getSelector()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getSelector");
SibTr.exit(tc, "getSelector", selector);
}
return selector;
} | [
"public",
"String",
"getSelector",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getSelector\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getSelector\"",
",",
"selector",
")",
";",
"}",
"return",
"selector",
";",
"}"
] | Returns the selector.
@return String | [
"Returns",
"the",
"selector",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/SubscriptionDefinitionImpl.java#L106-L115 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/SubscriptionDefinitionImpl.java | SubscriptionDefinitionImpl.getSelectorDomain | public int getSelectorDomain()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getSelectorDomain");
SibTr.exit(tc, "getSelectorDomain", new Integer(selectorDomain));
}
return selectorDomain;
} | java | public int getSelectorDomain()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getSelectorDomain");
SibTr.exit(tc, "getSelectorDomain", new Integer(selectorDomain));
}
return selectorDomain;
} | [
"public",
"int",
"getSelectorDomain",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getSelectorDomain\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getSelectorDomain\"",
",",
"new",
"Integer",
"(",
"selectorDomain",
")",
")",
";",
"}",
"return",
"selectorDomain",
";",
"}"
] | Returns the messaging domain in which the selector was sspecified.
@return int | [
"Returns",
"the",
"messaging",
"domain",
"in",
"which",
"the",
"selector",
"was",
"sspecified",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/SubscriptionDefinitionImpl.java#L121-L130 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.