本文整理汇总了Java中org.wso2.carbon.CarbonConstants.DOMAIN_SEPARATOR属性的典型用法代码示例。如果您正苦于以下问题:Java CarbonConstants.DOMAIN_SEPARATOR属性的具体用法?Java CarbonConstants.DOMAIN_SEPARATOR怎么用?Java CarbonConstants.DOMAIN_SEPARATOR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.wso2.carbon.CarbonConstants
的用法示例。
在下文中一共展示了CarbonConstants.DOMAIN_SEPARATOR属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prependUserStoreDomainToName
public static String prependUserStoreDomainToName(String authenticatedSubject) {
if (authenticatedSubject == null || authenticatedSubject.trim().isEmpty()) {
throw new IllegalArgumentException("Invalid argument. authenticatedSubject : "
+ authenticatedSubject);
}
if (!authenticatedSubject.contains(CarbonConstants.DOMAIN_SEPARATOR)) {
if (UserCoreUtil.getDomainFromThreadLocal() != null
&& !UserCoreUtil.getDomainFromThreadLocal().isEmpty()) {
authenticatedSubject = UserCoreUtil.getDomainFromThreadLocal()
+ CarbonConstants.DOMAIN_SEPARATOR + authenticatedSubject;
}
} else if (authenticatedSubject.indexOf(CarbonConstants.DOMAIN_SEPARATOR) == 0) {
throw new IllegalArgumentException("Invalid argument. authenticatedSubject : "
+ authenticatedSubject + " begins with \'" + CarbonConstants.DOMAIN_SEPARATOR
+ "\'");
}
return authenticatedSubject;
}
示例2: getUserStoreAppendedName
protected String getUserStoreAppendedName(String userName) {
if (!userName.contains(CarbonConstants.DOMAIN_SEPARATOR) && UserCoreUtil.getDomainFromThreadLocal() != null
&& !"".equals(UserCoreUtil.getDomainFromThreadLocal())) {
userName = UserCoreUtil.getDomainFromThreadLocal() + CarbonConstants.DOMAIN_SEPARATOR + userName;
}
return userName;
}
示例3: getNameAssociatedWith
public String getNameAssociatedWith(String idpID, String associatedID) throws UserProfileException {
Connection connection = IdentityDatabaseUtil.getDBConnection();
PreparedStatement prepStmt = null;
ResultSet resultSet;
String sql = null;
String username = "";
int tenantID = CarbonContext.getThreadLocalCarbonContext().getTenantId();
try {
sql = "SELECT DOMAIN_NAME, USER_NAME FROM IDN_ASSOCIATED_ID WHERE TENANT_ID = ? AND IDP_ID = (SELECT ID " +
"FROM IDP WHERE NAME = ? AND TENANT_ID = ?) AND IDP_USER_ID = ?";
prepStmt = connection.prepareStatement(sql);
prepStmt.setInt(1, tenantID);
prepStmt.setString(2, idpID);
prepStmt.setInt(3, tenantID);
prepStmt.setString(4, associatedID);
resultSet = prepStmt.executeQuery();
connection.commit();
if (resultSet.next()) {
String domainName = resultSet.getString(1);
username = resultSet.getString(2);
if(!"PRIMARY".equals(domainName)) {
username = domainName + CarbonConstants.DOMAIN_SEPARATOR + username;
}
return username;
}
} catch (SQLException e) {
log.error("Error occurred while getting associated name", e);
throw new UserProfileException("Error occurred while getting associated name", e);
} finally {
IdentityDatabaseUtil.closeAllConnections(connection, null, prepStmt);
}
return null;
}
示例4: getGroupNameWithDomain
public static String getGroupNameWithDomain(String groupName) {
if (groupName == null) {
return groupName;
}
if (groupName.indexOf(CarbonConstants.DOMAIN_SEPARATOR) > 0) {
return groupName;
} else {
return UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME
+ CarbonConstants.DOMAIN_SEPARATOR + groupName;
}
}