本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例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());
}
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
示例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;
}