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


Java Im类代码示例

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


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


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