• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java User类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addUserToGroup

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public void addUserToGroup(int userId, int groupId) throws RedmineException {
	logger.debug("adding user " + userId + " to group " + groupId + "...");
	URI uri = getURIConfigurator().getChildObjectsURI(Group.class, Integer.toString(groupId), User.class);
	HttpPost httpPost = new HttpPost(uri);
	final StringWriter writer = new StringWriter();
	final JSONWriter jsonWriter = new JSONWriter(writer);
	try {
		jsonWriter.object().key("user_id").value(userId).endObject();
	} catch (JSONException e) {
		throw new RedmineInternalError("Unexpected exception", e);
	}
	String body = writer.toString();
	setEntity(httpPost, body);
	String response = send(httpPost);
	logger.debug(response);
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:17,代码来源:Transport.java


示例2: writeUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public static void writeUser(User user, final JSONWriter writer)
		throws JSONException {
	JsonOutput.addIfNotNull(writer, "id", user.getId());
	JsonOutput.addIfNotNull(writer, "login", user.getLogin());
	JsonOutput.addIfNotNull(writer, "password", user.getPassword());
	JsonOutput.addIfNotNull(writer, "firstname", user.getFirstName());
	JsonOutput.addIfNotNull(writer, "lastname", user.getLastName());
	JsonOutput.addIfNotNull(writer, "name", user.getFullName());
	JsonOutput.addIfNotNull(writer, "mail", user.getMail());
	JsonOutput.addIfNotNull(writer, "auth_source_id", user.getAuthSourceId());
	JsonOutput.addIfNotNull(writer, "status", user.getStatus());
	addIfNotNullFull(writer, "created_on", user.getCreatedOn());
	addIfNotNullFull(writer, "last_login_on", user.getLastLoginOn());
	writeCustomFields(writer, user.getCustomFields());

}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:17,代码来源:RedmineJSONBuilder.java


示例3: loadConfiguration

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public void loadConfiguration() throws RedmineException
{
	User u = manager.getUserManager().getCurrentUser();
	
	configuration.setCurrentUser(u);
	
	if(configuration.isEmpty())
	{
		for(Membership m : u.getMemberships())
		{
			Project p = manager.getProjectManager().getProjectById(m.getProject().getId());
			
			configuration.addProject(p);
			
			List<Version> versions = manager.getProjectManager().getVersions(m.getProject().getId());
			
			configuration.addVersionsToProject(p, versions);
		}
		
		configuration.addStatuses(manager.getIssueManager().getStatuses());
		configuration.addTrackers(manager.getIssueManager().getTrackers());
		configuration.addUsers(manager.getUserManager().getUsers());		
	}
	
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:26,代码来源:RedmineClient.java


示例4: createPersonFromUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
private IRepositoryPerson createPersonFromUser(TaskRepository repository, User user)
{
	IRepositoryPerson person =null;
			
	if(user == null)
	{
		person = repository.createPerson("unassigned");
		person.setName("Unassigned");
	}
	else
	{
		person = repository.createPerson(user.getMail().toString());
		person.setName(user.getFullName());
	}
	 
	return person;
	
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:19,代码来源:RedmineTaskDataHandler.java


示例5: getClosingMessage

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
private String getClosingMessage() {
    Validate.notNull(redmineGovernorConfiguration, "Redmine Governor configuration must be set.");

    String username = null;
    try {
        final User apiKeyUser = redmineManager.getUserManager().getCurrentUser();
        username = apiKeyUser.getLogin();
    } catch (RedmineException e) {
        logger.log(Level.WARNING, "Could not get redmine user.", e);
    }

    if (username == null || username.isEmpty()) {
        username = "unknown";
    }

    return String.format(redmineGovernorConfiguration.getClosingMessage(), username);
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:18,代码来源:RedmineGovernorClient.java


示例6: getOpeningMessage

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
private String getOpeningMessage() {
    Validate.notNull(redmineGovernorConfiguration, "Redmine Governor configuration must be set.");

    String username = null;
    try {
        final User apiKeyUser = redmineManager.getUserManager().getCurrentUser();
        username = apiKeyUser.getLogin();
    } catch (RedmineException e) {
        logger.log(Level.WARNING, "Could not get redmine user.", e);
    }

    if (username == null || username.isEmpty()) {
        username = "unknown";
    }

    return String.format(redmineGovernorConfiguration.getOpeningMessage(), username);
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:18,代码来源:RedmineGovernorClient.java


示例7: addUserToGroup

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public void addUserToGroup(int userId, int groupId) throws RedMineException {
	Log.d(DEBUG_TAG, "adding user " + userId + " to group " + groupId + "...");
	URI uri = getURIConfigurator().getChildObjectsURI(Group.class, Integer.toString(groupId), User.class);
	HttpPost httpPost = new HttpPost(uri);
	final JSONStringer jsonWriter = new JSONStringer();
	try {
		jsonWriter.object().key("user_id").value(userId).endObject();
	} catch (JSONException e) {
		throw new RedmineInternalError("Unexpected exception", e);
	}
	String body = jsonWriter.toString();
	setEntity(httpPost, body);
	String response = getCommunicator().sendRequest(httpPost);
	Log.d(DEBUG_TAG, response);
	return;
}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:17,代码来源:Transport.java


示例8: parseUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public static User parseUser(JSONObject content) throws JSONException {
	final User result = new User();
	result.setId(JsonInput.getIntOrNull(content, "id"));
	result.setLogin(JsonInput.getStringOrNull(content, "login"));
	result.setPassword(JsonInput.getStringOrNull(content, "password"));
	result.setFirstName(JsonInput.getStringOrNull(content, "firstname"));
	result.setLastName(JsonInput.getStringOrNull(content, "lastname"));
	result.setMail(JsonInput.getStringOrNull(content, "mail"));
	result.setCreatedOn(getDateOrNull(content, "created_on"));
	result.setLastLoginOn(getDateOrNull(content, "last_login_on"));
	result.setCustomFields(JsonInput.getListOrEmpty(content,
			"custom_fields", CUSTOM_FIELD_PARSER));
	final String name = JsonInput.getStringOrNull(content, "name");
	if (name != null)
		result.setFullName(name);
	result.setMemberships(JsonInput.getListOrEmpty(content, "memberships",
			MEMBERSHIP_PARSER));

	/* Fix user for membership */
	for (Membership m : result.getMemberships())
		m.setUser(result);

	return result;
}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:25,代码来源:RedmineJSONParser.java


示例9: postNewIssue

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public Observable<Issue> postNewIssue(final Project project, final User assignee, final String statusName,
                                      final String title, final String message,
                                      final String pictureFilename, final String logsFilename) {
    final Issue issue = new Issue();
    issue.setProject(project);
    issue.setSubject(title);
    issue.setDescription(message);

    if (assignee != null) {
        issue.setAssignee(assignee);
    }

    if (statusName != null) {
        issue.setStatusName(statusName);
    }

    return createIssue(project, issue, pictureFilename, logsFilename);
}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:19,代码来源:RedMineControllerWrapper.java


示例10: getUserByName

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
protected User getUserByName(String name) {
    try {
        if (cachedUsers==null) {
            Map<String,User> usersCache = new HashMap<String, User>();
            List<User> users = redmineManager.getUsers();
            for (User user : users) {
                usersCache.put(user.getLogin().toLowerCase(),user);
            }
            cachedUsers = usersCache;
        }
        return cachedUsers.get(name.toLowerCase());

    } catch (RedmineException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:francm,项目名称:maven-issuetracking-plugin,代码行数:17,代码来源:RedmineProject.java


示例11: parseUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public static User parseUser(JSONObject content) throws JSONException {
	final User result = UserFactory.create(JsonInput.getIntOrNull(content, "id"));
	result.setLogin(JsonInput.getStringOrNull(content, "login"));
	result.setPassword(JsonInput.getStringOrNull(content, "password"));
	result.setFirstName(JsonInput.getStringOrNull(content, "firstname"));
	result.setLastName(JsonInput.getStringOrNull(content, "lastname"));
	result.setMail(JsonInput.getStringOrNull(content, "mail"));
	result.setAuthSourceId(JsonInput.getIntOrNull(content, "auth_source_id"));
	result.setCreatedOn(getDateOrNull(content, "created_on"));
	result.setLastLoginOn(getDateOrNull(content, "last_login_on"));
               result.setApiKey(JsonInput.getStringOrNull(content, "api_key"));
	result.addCustomFields(JsonInput.getListOrEmpty(content,
			"custom_fields", CUSTOM_FIELD_PARSER));
	result.setStatus(JsonInput.getIntOrNull(content, "status"));
	final String name = JsonInput.getStringOrNull(content, "name");
	if (name != null)
		result.setFullName(name);
	result.addMemberships(JsonInput.getListOrEmpty(content, "memberships",
			MEMBERSHIP_PARSER));
	result.addGroups(JsonInput.getListOrEmpty(content, "groups",
			GROUP_PARSER));
	/* Fix user for membership */
	for (Membership m : result.getMemberships())
		m.setUser(result);

	return result;
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:28,代码来源:RedmineJSONParser.java


示例12: getOptionsForUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
private Map<String, String> getOptionsForUser()
{
	Map<String,String> options = new HashMap<String, String>();
	
	for(User u : configuration.getUsers())
	{
		options.put(u.getLogin(), u.getLogin());
	}
	
	return options;
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:12,代码来源:RedmineTaskAttributeMapper.java


示例13: writeUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public static void writeUser(User user, final JSONStringer writer)
		throws JSONException {
	JsonOutput.addIfNotNull(writer, "id", user.getId());
	JsonOutput.addIfNotNull(writer, "login", user.getLogin());
	JsonOutput.addIfNotNull(writer, "password", user.getPassword());
	JsonOutput.addIfNotNull(writer, "firstname", user.getFirstName());
	JsonOutput.addIfNotNull(writer, "lastname", user.getLastName());
	JsonOutput.addIfNotNull(writer, "name", user.getFullName());
	JsonOutput.addIfNotNull(writer, "mail", user.getMail());
	addIfNotNullFull(writer, "created_on", user.getCreatedOn());
	addIfNotNullFull(writer, "last_login_on", user.getLastLoginOn());
	writeCustomFields(writer, user.getCustomFields());

}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:15,代码来源:RedmineJSONBuilder.java


示例14: postCommentToTicket

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public Observable<Void> postCommentToTicket(final Issue issue, final User assignee, final String statusName,
                                             final String title, final String message,
                                             final String pictureFilename, final String logsFilename) {
    issue.setNotes(title + "\n" + message);

    if (assignee != null) {
        issue.setAssignee(assignee);
    }

    if (statusName != null) {
        issue.setStatusName(statusName);
    }

    return updateIssue(issue, pictureFilename, logsFilename);
}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:16,代码来源:RedMineControllerWrapper.java


示例15: getGroups

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
private GrantedAuthority[] getGroups(User user) {
    Set<GrantedAuthority> groups = new HashSet<GrantedAuthority>();
    for (Group group : user.getGroups()) {
        groups.add(new RedmineGroupDetails(group.getName()));
    }
    groups.add(SecurityRealm.AUTHENTICATED_AUTHORITY);
    return groups.toArray(new GrantedAuthority[groups.size()]);
}
 
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:9,代码来源:RedmineSecurityRealm.java


示例16: convert

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
private Issue convert(com.taskadapter.redmineapi.bean.Issue issue) {
    com.taskadapter.redmineapi.bean.Version targetVersion = issue.getTargetVersion();
    String version = targetVersion==null?null:targetVersion.getName();
    User user = issue.getAssignee();
    String developer = user==null?null:convert(user);
    Issue result = new IssueImpl(issue.getId().toString(),issue.getSubject(),issue.getDescription(),null,developer,version,false);
    log.debug("Issue converted from Redmine object: {}", issue);
    return result;
}
 
开发者ID:francm,项目名称:maven-issuetracking-plugin,代码行数:10,代码来源:RedmineIssueManager.java


示例17: getCurrentUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
/**
 * @return the current user logged into Redmine
 */
public User getCurrentUser() throws RedmineException {
    return transport.getCurrentUser(new BasicNameValuePair("include", "memberships"));
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:7,代码来源:UserManager.java


示例18: createUser

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public User createUser(User user) throws RedmineException {
    return transport.addObject(user);
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:4,代码来源:UserManager.java


示例19: getUserById

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
/**
 * This does NOT require Admin privileges by default Redmine installation (tested with Redmine 2.0.3).
 */
public User getUserById(Integer userId) throws RedmineException {
    return transport.getObject(User.class, userId, new BasicNameValuePair(
            "include", "memberships"));
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:8,代码来源:UserManager.java


示例20: update

import com.taskadapter.redmineapi.bean.User; //导入依赖的package包/类
public void update(User obj) throws RedmineException {
    transport.updateObject(obj);
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:4,代码来源:UserManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ThreadLocalRequestContext类代码示例发布时间:2022-05-22
下一篇:
Java ObfHelper类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap