本文整理汇总了Java中org.osiam.resources.scim.Entitlement类的典型用法代码示例。如果您正苦于以下问题:Java Entitlement类的具体用法?Java Entitlement怎么用?Java Entitlement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Entitlement类属于org.osiam.resources.scim包,在下文中一共展示了Entitlement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: update
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
/**
* updates (adds new, delete, updates) the {@link EntitlementEntity}'s of the given {@link UserEntity} based on the
* given List of Entitlement's
*
* @param entitlements list of Entitlement's to be deleted, updated or added
* @param userEntity user who needs to be updated
* @param attributes all {@link EntitlementEntity}'s will be deleted if this Set contains 'entitlements'
*/
void update(List<Entitlement> entitlements, UserEntity userEntity, Set<String> attributes) {
if (attributes.contains("entitlements")) {
userEntity.removeAllEntitlements();
}
if (entitlements != null) {
for (Entitlement scimEntitlements : entitlements) {
EntitlementEntity entitlementsEntity = entitlementConverter.fromScim(scimEntitlements);
userEntity.removeEntitlement(entitlementsEntity); // we always have to remove the entitlement's in case
// the primary attribute has changed
if (Strings.isNullOrEmpty(scimEntitlements.getOperation())
|| !scimEntitlements.getOperation().equalsIgnoreCase("delete")) {
ensureOnlyOnePrimaryEntitlementExists(entitlementsEntity, userEntity.getEntitlements());
userEntity.addEntitlement(entitlementsEntity);
}
}
}
}
开发者ID:osiam,项目名称:osiam,代码行数:29,代码来源:EntitlementsUpdater.java
示例2: updateEntitlement
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Command(description = "Update an entitlement from the user.", startsSubshell = true)
public void updateEntitlement(
@Param(value = "searchKey", description = "Which key should be used to identify the entitlement.")
String key,
@Param(value = "expr", description = "If the value matches this regular expression, the entitlement will updated.")
String valueExp) throws IOException{
Set<Entitlement> entitlements = builderCommand.showAllEntitlements();
for(Entitlement current : entitlements){
if(match(current, key, valueExp)){
final Entitlement entitlement = builderCommand.builderShellFactory.enterEntitlementShell(current);
if(entitlement != null){
builderCommand.builder.updateEntitlement(current, entitlement);
}
}
}
}
开发者ID:osiam,项目名称:shell,代码行数:18,代码来源:UpdateUserUpdateCommands.java
示例3: enterEntitlementShell
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
/**
* Enter a new subshell for creating an {@link Entitlement}.
*
* @param current The current persisted {@link Entitlement}.
* @return The {@link Entitlement}. Or null if the user interrupt the process.
* @throws IOException
*/
public Entitlement enterEntitlementShell(Entitlement current) throws IOException {
final EntitlementBuilder entitlementBuilder = new EntitlementBuilder(current);
final Shell subShell = ShellBuilder.subshell((current == null ? "create" : "replace") + "-entitlement", shell)
.behavior()
.disableExitCommand()
.addHandler(entitlementBuilder)
.build();
output.out()
.normal("In this subshell you can create an entitlement. Leave this sub shell via \"commit\" to persist the changes.")
.println();
subShell.commandLoop();
return entitlementBuilder.build();
}
开发者ID:osiam,项目名称:shell,代码行数:25,代码来源:BuilderShellFactory.java
示例4: updateEntitlement
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
private void updateEntitlement(UpdateUser.Builder updateBuilder, List<Entitlement> entitlements, String value) {
Entitlement newEntitlement = new Entitlement.Builder().setValue(value)
.setType(new Entitlement.Type(LdapAuthentication.LDAP_PROVIDER)).build();
for (Entitlement entitlement : entitlements) {
if (entitlement.getType() != null
&& entitlement.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
updateBuilder.deleteEntitlement(entitlement);
}
}
updateBuilder.addEntitlement(newEntitlement);
}
开发者ID:osiam,项目名称:auth-server,代码行数:12,代码来源:OsiamLdapUserContextMapper.java
示例5: fromScim
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Override
public EntitlementEntity fromScim(Entitlement scim) {
EntitlementEntity entitlementsEntity = new EntitlementEntity();
entitlementsEntity.setValue(String.valueOf(scim.getValue()));
entitlementsEntity.setType(scim.getType());
entitlementsEntity.setPrimary(scim.isPrimary());
entitlementsEntity.setDisplay(scim.getDisplay());
return entitlementsEntity;
}
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:EntitlementConverter.java
示例6: toScim
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Override
public Entitlement toScim(EntitlementEntity entity) {
return new Entitlement.Builder()
.setValue(entity.getValue())
.setType(entity.getType())
.setPrimary(entity.isPrimary())
.setDisplay(entity.getDisplay())
.build();
}
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:EntitlementConverter.java
示例7: convertToDatabaseColumn
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Override
public String convertToDatabaseColumn(Entitlement.Type attribute) {
if (attribute == null || Strings.isNullOrEmpty(attribute.getValue())) {
return null;
}
return attribute.getValue();
}
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:EntitlementTypeConverter.java
示例8: convertToEntityAttribute
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Override
public Entitlement.Type convertToEntityAttribute(String dbData) {
if (Strings.isNullOrEmpty(dbData)) {
return null;
}
return new Entitlement.Type(dbData);
}
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:EntitlementTypeConverter.java
示例9: fromScim
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Override
public EntitlementEntity fromScim(Entitlement scim) {
EntitlementEntity entitlementsEntity = new EntitlementEntity();
entitlementsEntity.setValue(String.valueOf(scim.getValue()));
entitlementsEntity.setType(scim.getType());
entitlementsEntity.setPrimary(scim.isPrimary());
return entitlementsEntity;
}
开发者ID:osiam,项目名称:resource-server,代码行数:10,代码来源:EntitlementConverter.java
示例10: toScim
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Override
public Entitlement toScim(EntitlementEntity entity) {
return new Entitlement.Builder()
.setValue(entity.getValue())
.setType(entity.getType())
.setPrimary(entity.isPrimary())
.build();
}
开发者ID:osiam,项目名称:resource-server,代码行数:9,代码来源:EntitlementConverter.java
示例11: EntitlementCommand
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
public EntitlementCommand(Entitlement entitlement) {
setDisplay(entitlement.getDisplay());
setPrimary(entitlement.isPrimary());
setValue(entitlement.getValue());
if (entitlement.getType() != null) {
setType(entitlement.getType().getValue());
}
}
开发者ID:osiam,项目名称:addon-administration,代码行数:10,代码来源:EntitlementCommand.java
示例12: getAsEntitlement
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
public Entitlement getAsEntitlement() {
return new Entitlement.Builder()
.setDisplay(getDisplay())
.setPrimary(getPrimary())
.setType(new Type(getType()))
.setValue(getValue())
.build();
}
开发者ID:osiam,项目名称:addon-administration,代码行数:9,代码来源:EntitlementCommand.java
示例13: deleteEntitlement
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Command(description = "Delete an entitlement from the user.")
public void deleteEntitlement(
@Param(value = "searchKey", description = "Which key should be used to identify the entitlement.")
String key,
@Param(value = "expr", description = "If the value matches this regular expression, the entitlement will deleted.")
String valueExp){
Set<Entitlement> entitlements = builderCommand.showAllEntitlements();
for(Entitlement current : entitlements){
if(match(current, key, valueExp)){
builderCommand.builder.deleteEntitlement(current);
}
}
}
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:UpdateUserDeleteCommands.java
示例14: addEntitlement
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Command(description = "Add an entitlement for this user.", startsSubshell = true)
public void addEntitlement() throws IOException {
final Entitlement entitlement = builderCommand.builderShellFactory.enterEntitlementShell();
if(entitlement != null){
builderCommand.builder.addEntitlement(entitlement);
}
}
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserAddCommands.java
示例15: entitlements
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Command(description = "Show all entitlements (persited and non persisted) for the user.")
public Set<Entitlement> showAllEntitlements(){
Set<Entitlement> all = new HashSet<>(user.getEntitlements());
all.addAll(_build().getScimConformUpdateUser().getEntitlements());
return all;
}
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserBuilder.java
示例16: deleteEntitlement
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Command(description = "Delete an entitlement from the user.")
public void deleteEntitlement(
@Param(value = "searchKey", description = "Which key should be used to identify the entitlement.")
String key,
@Param(value = "expr", description = "If the value matches this regular expression, the entitlement will deleted.")
String valueExp){
List<Entitlement> entitlements = builderCommand.showAllEntitlements();
for(Entitlement current : entitlements){
if(match(current, key, valueExp)){
builderCommand.builder.removeEntitlement(current);
}
}
}
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:CreateUserDeleteCommands.java
示例17: convertOutput
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
@Override
public Object convertOutput(Object toBeFormatted) {
if(!(toBeFormatted instanceof Entitlement)) return null;
final Entitlement entitlement = (Entitlement)toBeFormatted;
try {
return toString(entitlement);
} catch (JsonProcessingException e) {
return e;
}
}
开发者ID:osiam,项目名称:shell,代码行数:13,代码来源:EntitlementConverter.java
示例18: getEntitlements
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
private static ArrayList<Entitlement> getEntitlements(int countCurrentUser) {
Entitlement entitlement = new Entitlement.Builder()
.setPrimary(true)
.setType(new Entitlement.Type(IRRELEVANT))
.setValue("entitlement" + countCurrentUser)
.build();
ArrayList<Entitlement> entitlements = new ArrayList<Entitlement>();
entitlements.add(entitlement);
return entitlements;
}
开发者ID:osiam,项目名称:test-suites,代码行数:14,代码来源:TestDataCreation.java
示例19: assertThatEntitlementsAreEqual
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
private void assertThatEntitlementsAreEqual(List<Entitlement> expected, List<Entitlement> actual) {
assertEquals(expected.size(), actual.size());
ensureListSizeIsOne(expected);
Entitlement expectedValue = expected.get(0);
Entitlement 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
示例20: getType
import org.osiam.resources.scim.Entitlement; //导入依赖的package包/类
public Entitlement.Type getType() {
return type;
}
开发者ID:osiam,项目名称:osiam,代码行数:4,代码来源:EntitlementEntity.java
注:本文中的org.osiam.resources.scim.Entitlement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论