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


Java User.setUserId方法代码示例

本文整理汇总了Java中org.oscm.provisioning.data.User.setUserId方法的典型用法代码示例。如果您正苦于以下问题:Java User.setUserId方法的具体用法?Java User.setUserId怎么用?Java User.setUserId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscm.provisioning.data.User的用法示例。


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

示例1: toUserList

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
/**
 * Maps the given list of UsageLicenses to a list of User instances. Sets
 * user (name, id, ...) and subscription (admin, applicationUserId) specific
 * data.
 * 
 * @param usageLicenses
 *            the UsageLicenes to map
 * @return a list of User instances
 */
private List<User> toUserList(List<UsageLicense> usageLicenses) {
    List<User> users = new ArrayList<>();
    if (usageLicenses != null) {
        for (UsageLicense usageLicense : usageLicenses) {
            User userWithRole = new User();
            userWithRole.setApplicationUserId(
                    usageLicense.getApplicationUserId());
            PlatformUser platformUser = usageLicense.getUser();
            userWithRole.setUserId(platformUser.getUserId());
            userWithRole.setUserFirstName(platformUser.getFirstName());
            userWithRole.setUserLastName(platformUser.getLastName());
            userWithRole.setEmail(platformUser.getEmail());
            userWithRole.setLocale(platformUser.getLocale());
            RoleDefinition userRoleDefinition = usageLicense
                    .getRoleDefinition();
            if (userRoleDefinition != null) {
                userWithRole
                        .setRoleIdentifier(userRoleDefinition.getRoleId());
            }
            users.add(userWithRole);
        }
    }
    return users;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:34,代码来源:ApplicationServiceBean.java

示例2: createApplicationServiceMock

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private ApplicationServiceLocal createApplicationServiceMock()
        throws Exception {
    ApplicationServiceLocal applicationService = mock(ApplicationServiceLocal.class);

    doNothing().when(applicationService).deactivateInstance(
            any(Subscription.class));

    User user = new User();
    user.setApplicationUserId("applicationUserId");
    user.setUserId("user1");
    User[] users = new User[] { user };

    doReturn(users).when(applicationService).createUsers(eq(subscription),
            anyList());

    return applicationService;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:NotifyProvisioningServiceHandlerTest.java

示例3: toProvisioningUser

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
/**
 * Transforms a OSCM provisioning user entity into an APP service user
 * entity.
 */
public static User toProvisioningUser(ServiceUser fromUser) {
    if (fromUser == null) {
        return null;
    }
    User toUser = new User();
    toUser.setApplicationUserId(fromUser.getApplicationUserId());
    toUser.setEmail(fromUser.getEmail());
    toUser.setLocale(fromUser.getLocale());
    toUser.setRoleIdentifier(fromUser.getRoleIdentifier());
    toUser.setUserId(fromUser.getUserId());
    toUser.setUserLastName(fromUser.getLastName());
    toUser.setUserFirstName(fromUser.getFirstName());
    return toUser;
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:19,代码来源:UserMapper.java

示例4: testCreateUsers_NoProvOnInstanceWithUsers

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testCreateUsers_NoProvOnInstanceWithUsers() throws Exception {
    final String instanceId = createService(ProvisioningStatus.COMPLETED);
    final List<User> users = new ArrayList<>();
    User user1 = new User();
    user1.setUserId("user1");
    User user2 = new User();
    user2.setUserId("user2");
    users.add(user1);
    users.add(user2);

    final UserResult result = new UserResult();
    result.setRc(1);

    doReturn(result).when(provServiceMock).createUsers(instanceId, users,
            null);
    when(
            controllerMock.createUsers(anyString(),
                    any(ProvisioningSettings.class), any(List.class)))
            .thenReturn(new InstanceStatusUsers());

    UserResult ur = runTX(new Callable<UserResult>() {
        @Override
        public UserResult call() {
            return proxy.createUsers(instanceId, users, null);
        }
    });

    verifyZeroInteractions(provServiceMock);

    // OK result because provisioning on instance has never been called
    Assert.assertEquals(0, ur.getRc());
    Assert.assertEquals(2, ur.getUsers().size());

}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:37,代码来源:AsynchronousProvisioningProxyIT.java

示例5: getCurrentUser

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
private User getCurrentUser() {
    PlatformUser pUser = ds.getCurrentUserIfPresent();
    if (pUser == null) {
        return null;
    }
    User user = new User();
    user.setEmail(pUser.getEmail());
    user.setLocale(pUser.getLocale());
    user.setUserFirstName(pUser.getFirstName());
    user.setUserLastName(pUser.getLastName());
    user.setUserId(pUser.getUserId());
    return user;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:14,代码来源:ApplicationServiceBean.java

示例6: createUsers

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
@Override
public User[] createUsers(Subscription subscription,
        List<UsageLicense> usageLicenses)
        throws TechnicalServiceNotAliveException,
        TechnicalServiceOperationException {
    User[] users = new User[usageLicenses.size()];
    List<User> userList = new ArrayList<>();
    for (UsageLicense usageLicense : usageLicenses) {
        PlatformUser platformUser = usageLicense.getUser();
        addedUsers.put(platformUser.getUserId(), platformUser);
        User user = new User();
        user.setApplicationUserId(platformUser.getUserId());
        user.setEmail(platformUser.getEmail());
        user.setLocale(platformUser.getLocale());
        user.setUserId(platformUser.getUserId());
        user.setUserFirstName(platformUser.getFirstName());
        user.setUserLastName(platformUser.getLastName());
        RoleDefinition roleDefinition = usageLicense.getRoleDefinition();
        if (roleDefinition != null) {
            user.setRoleIdentifier(roleDefinition.getRoleId());
        }
        userList.add(user);
    }
    users = userList.toArray(new User[userList.size()]);
    userModificationCallReceived = true;
    return users;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:28,代码来源:ApplicationServiceStub.java

示例7: createUsers

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public User[] createUsers(Subscription subscription,
        List<UsageLicense> usageLicenses)
        throws TechnicalServiceNotAliveException,
        TechnicalServiceOperationException {
    User[] users = new User[usageLicenses.size()];
    List<User> userList = new ArrayList<>();
    for (UsageLicense usageLicense : usageLicenses) {
        PlatformUser platformUser = usageLicense.getUser();
        addedUsers.put(platformUser.getUserId(), platformUser);
        User user = new User();
        user.setApplicationUserId(platformUser.getUserId());
        user.setEmail(platformUser.getEmail());
        user.setLocale(platformUser.getLocale());
        user.setUserId(platformUser.getUserId());
        user.setUserFirstName(platformUser.getFirstName());
        user.setUserLastName(platformUser.getLastName());
        RoleDefinition roleDefinition = usageLicense.getRoleDefinition();
        if (roleDefinition != null) {
            user.setRoleIdentifier(roleDefinition.getRoleId());
        }
        userList.add(user);
    }
    users = userList.toArray(new User[userList.size()]);
    userModificationCallReceived = true;
    return users;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:29,代码来源:ApplicationServiceStub.java

示例8: testCreateUsersWithUsers1

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testCreateUsersWithUsers1() throws Exception {
    final String instanceId = createService(ProvisioningStatus.COMPLETED);
    final List<User> users = new ArrayList<>();
    User user1 = new User();
    user1.setUserId("user1");
    User user2 = new User();
    user2.setUserId("user2");
    users.add(user1);
    users.add(user2);
    final UserResult result = new UserResult();
    result.setDesc("Ok");

    doReturn(result).when(provServiceMock).createUsers(instanceId, users,
            null);

    final List<ServiceUser> svcUsers = new ArrayList<>();
    ServiceUser svcUser1 = new ServiceUser();
    svcUser1.setUserId("user1");
    svcUser1.setApplicationUserId("user1app");
    ServiceUser svcUser2 = new ServiceUser();
    svcUser2.setUserId("user2");
    svcUser2.setApplicationUserId("user2app");
    svcUsers.add(svcUser1);
    svcUsers.add(svcUser2);

    InstanceStatusUsers mockStatus = new InstanceStatusUsers();
    mockStatus.setInstanceProvisioningRequired(true);
    mockStatus.setChangedUsers(svcUsers);
    when(
            controllerMock.createUsers(anyString(),
                    any(ProvisioningSettings.class), any(List.class)))
            .thenReturn(mockStatus);

    UserResult ur = runTX(new Callable<UserResult>() {
        @Override
        public UserResult call() {
            return proxy.createUsers(instanceId, users, null);
        }
    });
    Assert.assertEquals(result.getDesc(), ur.getDesc());
    Assert.assertEquals(result.getRc(), ur.getRc());

    verify(provServiceMock).createUsers(instanceId, users, null);
    Assert.assertEquals(2, ur.getUsers().size());
    Assert.assertEquals("user1app", ur.getUsers().get(0)
            .getApplicationUserId());
    Assert.assertEquals("user2app", ur.getUsers().get(1)
            .getApplicationUserId());

}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:53,代码来源:AsynchronousProvisioningProxyIT.java

示例9: testCreateUsersWithUsers1Invalid

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testCreateUsersWithUsers1Invalid() throws Exception {
    final String instanceId = createService(ProvisioningStatus.COMPLETED);
    final List<User> users = new ArrayList<>();
    User user1 = new User();
    user1.setUserId("user1");
    User user2 = new User();
    user2.setUserId("user2");
    users.add(user1);
    users.add(user2);
    final UserResult result = new UserResult();
    result.setDesc("Ok");

    doReturn(result).when(provServiceMock).createUsers(instanceId, users,
            null);

    final List<ServiceUser> svcUsers = new ArrayList<>();
    ServiceUser svcUser1 = new ServiceUser();
    svcUser1.setUserId("user1");
    svcUser1.setApplicationUserId("user1app");
    ServiceUser svcUser2 = new ServiceUser();
    svcUser2.setUserId("user3"); // wrong user
    svcUser2.setApplicationUserId("user3app");
    svcUsers.add(svcUser1);
    svcUsers.add(svcUser2);

    InstanceStatusUsers mockStatus = new InstanceStatusUsers();
    mockStatus.setInstanceProvisioningRequired(true);
    mockStatus.setChangedUsers(svcUsers);
    when(
            controllerMock.createUsers(anyString(),
                    any(ProvisioningSettings.class), any(List.class)))
            .thenReturn(mockStatus);

    UserResult ur = runTX(new Callable<UserResult>() {
        @Override
        public UserResult call() {
            return proxy.createUsers(instanceId, users, null);
        }
    });
    Assert.assertEquals(result.getDesc(), ur.getDesc());
    Assert.assertEquals(result.getRc(), ur.getRc());

    verify(provServiceMock).createUsers(instanceId, users, null);
    Assert.assertEquals(2, ur.getUsers().size());
    Assert.assertEquals("user1app", ur.getUsers().get(0)
            .getApplicationUserId());
    Assert.assertNull(ur.getUsers().get(1).getApplicationUserId());

}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:52,代码来源:AsynchronousProvisioningProxyIT.java

示例10: testCreateUsersWithUsers2

import org.oscm.provisioning.data.User; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testCreateUsersWithUsers2() throws Exception {
    final String instanceId = createService(ProvisioningStatus.COMPLETED);
    final List<User> users = new ArrayList<>();
    User user1 = new User();
    user1.setUserId("user1");
    User user2 = new User();
    user2.setUserId("user2");
    users.add(user1);
    users.add(user2);
    final UserResult result = new UserResult();
    result.setDesc("Ok");

    final List<User> svcUsers = new ArrayList<>();
    User svcUser1 = new User();
    svcUser1.setUserId("user1");
    svcUser1.setApplicationUserId("user1app");
    User svcUser2 = new User();
    svcUser2.setUserId("user2");
    svcUser2.setApplicationUserId("user2app");
    svcUsers.add(svcUser1);
    svcUsers.add(svcUser2);
    result.setUsers(svcUsers);

    doReturn(result).when(provServiceMock).createUsers(instanceId, users,
            null);

    InstanceStatusUsers mockStatus = new InstanceStatusUsers();
    mockStatus.setInstanceProvisioningRequired(true);
    when(
            controllerMock.createUsers(anyString(),
                    any(ProvisioningSettings.class), any(List.class)))
            .thenReturn(mockStatus);

    UserResult ur = runTX(new Callable<UserResult>() {
        @Override
        public UserResult call() {
            return proxy.createUsers(instanceId, users, null);
        }
    });
    Assert.assertEquals(result.getDesc(), ur.getDesc());
    Assert.assertEquals(result.getRc(), ur.getRc());
    verify(provServiceMock).createUsers(instanceId, users, null);
    Assert.assertEquals(2, ur.getUsers().size());
    Assert.assertEquals("user1app", ur.getUsers().get(0)
            .getApplicationUserId());
    Assert.assertEquals("user2app", ur.getUsers().get(1)
            .getApplicationUserId());

}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:52,代码来源:AsynchronousProvisioningProxyIT.java


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