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


Java Group类代码示例

本文整理汇总了Java中com.atlassian.crowd.embedded.api.Group的典型用法代码示例。如果您正苦于以下问题:Java Group类的具体用法?Java Group怎么用?Java Group使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Group类属于com.atlassian.crowd.embedded.api包,在下文中一共展示了Group类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAddNewUser

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Test
public void testAddNewUser() {
    request.addHeader(PVPConstants.HTTP_HEADER_USERID, "[email protected]");
    request.addHeader(PVPConstants.HTTP_HEADER_MAIL, "[email protected]");
    request.addHeader(PVPConstants.HTTP_HEADER_CN, "Test User1");
    request.addHeader(PVPConstants.HTTP_HEADER_ROLES, "project1-users();project1-developers");

    Principal p = auth.getUser(request, resp);
    assertNotNull(p);
    assertEquals("[email protected]", p.getName());

    assertEquals(1, crowdService.getUserList().size());
    User user = crowdService.getUserList().get(0);
    assertEquals("[email protected]", user.getName());
    assertEquals("[email protected]", user.getEmailAddress());
    assertEquals("Test User1", user.getDisplayName());
    List<Group> groups = crowdService.getUser2Group().get(user);
    assertEquals(2, groups.size());
    assertEquals("project1-users", groups.get(0).getName());
    assertEquals("project1-developers", groups.get(1).getName());

}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:23,代码来源:PVPAuthenticatorTest.java

示例2: addUserToGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
private void addUserToGroup(final User crowdUser, final Group group) {
    if (crowdUser == null) {
        log.warn("Cannot add null user to group!");
    } else if (group == null) {
        log.warn("Cannot add user to null group!");
    } else {
        new TransactionTemplate(getTransactionManager(), new DefaultTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED)).execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus status) {
                try {
                    getCrowdService().addUserToGroup(crowdUser, group);
                } catch (Throwable t) {
                    log.error("Failed to add user " + crowdUser.getName() + " to group '" + group.getName() + "'!", t);
                }
                return null;
            }
        });
    }
}
 
开发者ID:chauth,项目名称:confluence_http_authenticator,代码行数:19,代码来源:RemoteUserAuthenticator.java

示例3: removeUserFromGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
private void removeUserFromGroup(final CrowdService crowdService, final User crowdUser, final Group group) {
    if (crowdUser == null) {
        log.warn("Cannot remove null user from group!");
    } else if (group == null) {
        log.warn("Cannot remove user from null group!");
    } else {
        new TransactionTemplate(getTransactionManager(), new DefaultTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED)).execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus status) {
                try {
                    crowdService.removeUserFromGroup(crowdUser, group);
                } catch (Throwable t) {
                    log.error("Failed to remove user " + crowdUser.getName() + " from group '" + group.getName() + "'!", t);
                }
                return null;
            }
        });
    }
}
 
开发者ID:chauth,项目名称:confluence_http_authenticator,代码行数:19,代码来源:RemoteUserAuthenticator.java

示例4: addGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
private void addGroup(final CrowdService crowdService, final Group group) {
    if (group != null) {
        try {
            crowdService.addGroup(group);
        } catch (Throwable t) {
            log.error("Failed to add group '" + group.getName() + "'!", t);
        }
    } else {
        log.warn("Cannot add null group!");
    }
}
 
开发者ID:chauth,项目名称:jira_http_authenticator,代码行数:12,代码来源:RemoteUserAuthenticator.java

示例5: addUserToGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
private void addUserToGroup(final CrowdService crowdService, final User crowdUser, final Group group) {
    if (crowdUser == null) {
        log.warn("Cannot add null user to group!");
    } else if (group == null) {
        log.warn("Cannot add user to null group!");
    } else {
        try {
            crowdService.addUserToGroup(crowdUser, group);
        } catch (Throwable t) {
            log.error("Failed to add user " + crowdUser.getName() + " to group '" + group.getName() + "'!", t);
        }
    }
}
 
开发者ID:chauth,项目名称:jira_http_authenticator,代码行数:14,代码来源:RemoteUserAuthenticator.java

示例6: removeUserFromGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
private void removeUserFromGroup(final CrowdService crowdService, final User crowdUser, final Group group) {
    if (crowdUser == null) {
        log.warn("Cannot remove null user from group!");
    } else if (group == null) {
        log.warn("Cannot remove user from null group!");
    } else {
        try {
            crowdService.removeUserFromGroup(crowdUser, group);
        } catch (Throwable t) {
            log.error("Failed to remove user " + crowdUser.getName() + " from group '" + group.getName() + "'!", t);
        }
    }
}
 
开发者ID:chauth,项目名称:jira_http_authenticator,代码行数:14,代码来源:RemoteUserAuthenticator.java

示例7: addUserToGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
private void addUserToGroup(ApplicationUser newUser) throws GroupNotFoundException, UserNotFoundException, OperationNotPermittedException, OperationFailedException {
	GroupManager groupManager = ComponentAccessor.getGroupManager();
	String defaultGroup = saml2Config.getAutoCreateUserDefaultGroup();
	if (defaultGroup.isEmpty()) {
           defaultGroup = SAMLJiraConfig.DEFAULT_AUTOCREATE_USER_GROUP;
       }
	Group defaultJiraGroup = groupManager.getGroup(defaultGroup);
	if (defaultJiraGroup != null) {
           groupManager.addUserToGroup(newUser, defaultJiraGroup);
       }
}
 
开发者ID:bitium,项目名称:jira-saml-plugin,代码行数:12,代码来源:SsoJiraLoginServlet.java

示例8: getExistingGroups

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
public ArrayList<String> getExistingGroups() {
       GroupManager groupManager = ComponentAccessor.getGroupManager();
       Collection<Group> groupObjects = groupManager.getAllGroups();
       existingGroups = new ArrayList<String>();
       for (Group groupObject : groupObjects) {
           existingGroups.add(groupObject.getName());
       }
       setExistingGroups(existingGroups);
	return existingGroups;
}
 
开发者ID:bitium,项目名称:jira-saml-plugin,代码行数:11,代码来源:ConfigureAction.java

示例9: getGroupsForUser

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Override
public SortedSet<Group> getGroupsForUser(String user) {
	List<Group> groups = user2Group.get(user);
	SortedSet<Group> ret = new TreeSet<>();
	if (groups != null) {
		ret.addAll(groups);
	}
	return ret;

}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:11,代码来源:FakeCrowdService.java

示例10: addGroupToGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Override
public boolean addGroupToGroup(Group arg0, Group arg1)
		throws GroupNotFoundException, OperationNotPermittedException,
		InvalidMembershipException, OperationFailedException {

	return false;
}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:8,代码来源:FakeCrowdService.java

示例11: addUser

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Override
public User addUser(User user, String arg1) throws InvalidUserException,
		InvalidCredentialException, OperationNotPermittedException,
		OperationFailedException {

	userList.add(user);
	user2Group.put(user, new ArrayList<Group>());
	return user;
}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:10,代码来源:FakeCrowdService.java

示例12: addUserToGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Override
public boolean addUserToGroup(User user, Group group)
		throws GroupNotFoundException, UserNotFoundException,
		OperationNotPermittedException, OperationFailedException {

	return user2Group.get(user).add(group);

}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:9,代码来源:FakeCrowdService.java

示例13: getGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Override
public Group getGroup(final String name) {
	return new Group() {

		@Override
		public String getName() {
			return name;
		}

		@Override
		public int compareTo(Group group) {
			return name.compareTo(group.getName());
		}
	};
}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:16,代码来源:FakeCrowdService.java

示例14: removeGroupFromGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Override
public boolean removeGroupFromGroup(Group arg0, Group arg1)
		throws GroupNotFoundException, OperationNotPermittedException,
		OperationFailedException {

	return false;
}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:8,代码来源:FakeCrowdService.java

示例15: removeUserFromGroup

import com.atlassian.crowd.embedded.api.Group; //导入依赖的package包/类
@Override
public boolean removeUserFromGroup(User arg0, Group arg1)
		throws GroupNotFoundException, UserNotFoundException,
		OperationNotPermittedException, OperationFailedException {

	return false;
}
 
开发者ID:mschieder,项目名称:jira-pvp-sso,代码行数:8,代码来源:FakeCrowdService.java


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