当前位置: 首页>>代码示例>>Java>>正文


Java CarbonConstants.DOMAIN_SEPARATOR属性代码示例

本文整理汇总了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;
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:19,代码来源:FrameworkUtils.java

示例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;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:7,代码来源:AbstractApplicationAuthenticator.java

示例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;
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:39,代码来源:UserProfileAdmin.java

示例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;
        }
    }
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:13,代码来源:SCIMCommonUtils.java


注:本文中的org.wso2.carbon.CarbonConstants.DOMAIN_SEPARATOR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。