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

Java Im类代码示例

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

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



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

示例1: update

import org.osiam.resources.scim.Im; //导入依赖的package包/类
/**
 * updates (adds new, delete, updates) the {@link ImEntity}'s of the given {@link UserEntity} based on the given
 * List of Im's
 *
 * @param ims        list of Im's to be deleted, updated or added
 * @param userEntity user who needs to be updated
 * @param attributes all {@link ImEntity}'s will be deleted if this Set contains 'ims'
 */
void update(List<Im> ims, UserEntity userEntity, Set<String> attributes) {

    if (attributes.contains("ims")) {
        userEntity.removeAllIms();
    }

    if (ims != null) {
        for (Im scimIm : ims) {
            ImEntity imEntity = imConverter.fromScim(scimIm);
            userEntity.removeIm(imEntity); // we always have to remove the im in case
            // the primary attribute has changed
            if (Strings.isNullOrEmpty(scimIm.getOperation())
                    || !scimIm.getOperation().equalsIgnoreCase("delete")) {

                ensureOnlyOnePrimaryImExists(imEntity, userEntity.getIms());
                userEntity.addIm(imEntity);
            }
        }
    }
}
 
开发者ID:osiam,项目名称:osiam,代码行数:29,代码来源:ImUpdater.java


示例2: updateIm

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Command(description = "Update an im from the user.", startsSubshell = true)
public void updateIm(
		@Param(value = "searchKey", description = "Which key should be used to identify the im.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the im will updated.")
		String valueExp) throws IOException{

	Set<Im> im = builderCommand.showAllIms();
	for(Im current : im){
		if(match(current, key, valueExp)){
			final Im newIm = builderCommand.builderShellFactory.enterImShell(current);
			if(im != null){
				builderCommand.builder.updateIm(current, newIm);
			}
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:18,代码来源:UpdateUserUpdateCommands.java


示例3: enterImShell

import org.osiam.resources.scim.Im; //导入依赖的package包/类
/**
 * Enter a new subshell for creating an {@link Im}.
 *
 * @param current The current persisted {@link Im}.
 * @return The {@link Im}. Or null if the user interrupt the process.
 * @throws IOException
 */
public Im enterImShell(Im current) throws IOException {
	final ImBuilder imBuilder = new ImBuilder(current);

	final Shell subShell = ShellBuilder.subshell((current == null ? "create" : "replace") + "-im", shell)
		.behavior()
			.disableExitCommand()
			.addHandler(imBuilder)
		.build();

	output.out()
		.normal("In this subshell you can create an im. Leave this sub shell via \"commit\" to persist the changes.")
	.println();

	subShell.commandLoop();

	return imBuilder.build();
}
 
开发者ID:osiam,项目名称:shell,代码行数:25,代码来源:BuilderShellFactory.java


示例4: updateIm

import org.osiam.resources.scim.Im; //导入依赖的package包/类
private void updateIm(UpdateUser.Builder updateBuilder, List<Im> ims, String value) {
    Im newIm = new Im.Builder().setValue(value).setType(new Im.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (Im im : ims) {
        if (im.getType() != null && im.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteIm(im);
        }
    }
    updateBuilder.addIm(newIm);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:10,代码来源:OsiamLdapUserContextMapper.java


示例5: fromScim

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Override
public ImEntity fromScim(Im scim) {
    ImEntity imEntity = new ImEntity();
    imEntity.setValue(String.valueOf(scim.getValue()));
    imEntity.setType(scim.getType());
    imEntity.setPrimary(scim.isPrimary());
    imEntity.setDisplay(scim.getDisplay());
    return imEntity;
}
 
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:ImConverter.java


示例6: toScim

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Override
public Im toScim(ImEntity entity) {
    return new Im.Builder()
            .setType(entity.getType())
            .setValue(entity.getValue())
            .setPrimary(entity.isPrimary())
            .setDisplay(entity.getDisplay())
            .build();
}
 
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:ImConverter.java


示例7: convertToDatabaseColumn

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Override
public String convertToDatabaseColumn(Im.Type attribute) {
    if (attribute == null || Strings.isNullOrEmpty(attribute.getValue())) {
        return null;
    }

    return attribute.getValue();
}
 
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:ImTypeConverter.java


示例8: convertToEntityAttribute

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Override
public Im.Type convertToEntityAttribute(String dbData) {
    if (Strings.isNullOrEmpty(dbData)) {
        return null;
    }

    return new Im.Type(dbData);
}
 
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:ImTypeConverter.java


示例9: fromScim

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Override
public ImEntity fromScim(Im scim) {
    ImEntity imEntity = new ImEntity();
    imEntity.setValue(String.valueOf(scim.getValue()));
    imEntity.setType(scim.getType());
    imEntity.setPrimary(scim.isPrimary());

    return imEntity;
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:10,代码来源:ImConverter.java


示例10: toScim

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Override
public Im toScim(ImEntity entity) {
    return new Im.Builder()
            .setType(entity.getType())
            .setValue(entity.getValue())
            .setPrimary(entity.isPrimary())
            .build();
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:9,代码来源:ImConverter.java


示例11: ImCommand

import org.osiam.resources.scim.Im; //导入依赖的package包/类
public ImCommand(Im im) {
    setDisplay(im.getDisplay());
    setPrimary(im.isPrimary());
    setValue(im.getValue());

    if (im.getType() != null) {
        setType(im.getType().getValue());
    }
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:10,代码来源:ImCommand.java


示例12: getAsIm

import org.osiam.resources.scim.Im; //导入依赖的package包/类
public Im getAsIm() {
    return new Im.Builder()
            .setDisplay(getDisplay())
            .setPrimary(getPrimary())
            .setType(new Type(getType()))
            .setValue(getValue())
            .build();
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:9,代码来源:ImCommand.java


示例13: deleteIm

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Command(description = "Delete an im from the user.")
public void deleteIm(
		@Param(value = "searchKey", description = "Which key should be used to identify the im.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the im will deleted.")
		String valueExp){
	
	Set<Im> im = builderCommand.showAllIms();
	for(Im current : im){
		if(match(current, key, valueExp)){
			builderCommand.builder.deleteIm(current);
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:UpdateUserDeleteCommands.java


示例14: addIm

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Command(description = "Add an im for this user.", startsSubshell = true)
public void addIm() throws IOException {
	final Im im = builderCommand.builderShellFactory.enterImShell();
	if(im != null){
		builderCommand.builder.addIm(im);
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserAddCommands.java


示例15: ims

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Command(description = "Show all ims (persited and non persisted) for the user.")
public Set<Im> showAllIms(){
	Set<Im> all = new HashSet<>(user.getIms());
	all.addAll(_build().getScimConformUpdateUser().getIms());
	
	return all;
}
 
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserBuilder.java


示例16: deleteIm

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Command(description = "Delete an im from the user.")
public void deleteIm(
		@Param(value = "searchKey", description = "Which key should be used to identify the im.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the im will deleted.")
		String valueExp){
	
	List<Im> im = builderCommand.showAllIms();
	for(Im current : im){
		if(match(current, key, valueExp)){
			builderCommand.builder.removeIm(current);
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:CreateUserDeleteCommands.java


示例17: convertOutput

import org.osiam.resources.scim.Im; //导入依赖的package包/类
@Override
public Object convertOutput(Object toBeFormatted) {
	if(!(toBeFormatted instanceof Im)) return null;
	
	final Im im = (Im)toBeFormatted;
	
	try {
		return toString(im);
	} catch (JsonProcessingException e) {
		return e;
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:13,代码来源:ImConverter.java


示例18: getIms

import org.osiam.resources.scim.Im; //导入依赖的package包/类
private static ArrayList<Im> getIms(int countCurrentUser) {

        ArrayList<Im> ims = new ArrayList<Im>();
        ims.add(getNewIm(countCurrentUser, true, Im.Type.AIM));
        ims.add(getNewIm(countCurrentUser, false, Im.Type.GTALK));
        ims.add(getNewIm(countCurrentUser, false, Im.Type.ICQ));
        ims.add(getNewIm(countCurrentUser, false, Im.Type.MSN));
        ims.add(getNewIm(countCurrentUser, false, Im.Type.QQ));
        ims.add(getNewIm(countCurrentUser, false, Im.Type.XMPP));

        return ims;
    }
 
开发者ID:osiam,项目名称:test-suites,代码行数:13,代码来源:TestDataCreation.java


示例19: getNewIm

import org.osiam.resources.scim.Im; //导入依赖的package包/类
private static Im getNewIm(int countCurrentUser, boolean primary, Im.Type type) {
    return new Im.Builder()
            .setPrimary(primary)
            .setType(type)
            .setValue("im-" + countCurrentUser)
            .build();
}
 
开发者ID:osiam,项目名称:test-suites,代码行数:8,代码来源:TestDataCreation.java


示例20: assertThatImsAreEqual

import org.osiam.resources.scim.Im; //导入依赖的package包/类
private void assertThatImsAreEqual(List<Im> expected, List<Im> actual) {
    assertEquals(expected.size(), actual.size());
    ensureListSizeIsOne(expected);
    Im expectedValue = expected.get(0);
    Im actualValue = actual.get(0);

    assertEquals(expectedValue.getType(), actualValue.getType());
    assertEquals(expectedValue.getValue(), actualValue.getValue());
    assertEquals(expectedValue.isPrimary(), actualValue.isPrimary());
    assertEquals(expectedValue.getDisplay(), actualValue.getDisplay());
}
 
开发者ID:osiam,项目名称:connector4java-integration-tests,代码行数:12,代码来源:CompleteUserIT.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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