org.wso2.carbon.identity.user.profile.stub.types.UserProfileDTO Java Examples

The following examples show how to use org.wso2.carbon.identity.user.profile.stub.types.UserProfileDTO. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UserProfileCient.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
public void setUserProfile(String username, UserProfileDTO profile)
        throws Exception {
    try {
        stub.setUserProfile(username, profile);
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #2
Source File: UserProfileCient.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
public UserProfileDTO[] getUserProfiles(String userName)
        throws Exception {
    try {
        return stub.getUserProfiles(userName);
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #3
Source File: UserProfileCient.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
public UserProfileDTO getProfileFieldsForInternalStore() throws Exception {
    try {
        return stub.getProfileFieldsForInternalStore();
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #4
Source File: UserProfileCient.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
public UserProfileDTO getUserProfile(String username,
                                     String profile) throws Exception {
    try {
        return stub.getUserProfile(username, profile);
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #5
Source File: UserProfileCient.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
public void setUserProfile(String username, UserProfileDTO profile)
        throws Exception {
    try {
        stub.setUserProfile(username, profile);
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #6
Source File: UserProfileCient.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
public UserProfileDTO[] getUserProfiles(String userName)
        throws Exception {
    try {
        return stub.getUserProfiles(userName);
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #7
Source File: UserProfileCient.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
public UserProfileDTO getProfileFieldsForInternalStore() throws Exception {
    try {
        return stub.getProfileFieldsForInternalStore();
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #8
Source File: UserProfileCient.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
public UserProfileDTO getUserProfile(String username,
                                     String profile) throws Exception {
    try {
        return stub.getUserProfile(username, profile);
    } catch (Exception e) {
        log.error(e);
        throw e;
    }
}
 
Example #9
Source File: EmailUtil.java    From product-es with Apache License 2.0 5 votes vote down vote up
/**
 * Update user profile for particular user in order to enable e-mail subscription.
 *
 * @param automationContext
 * @param backendURL        URL of the server.
 * @param session           session cookie obtained after logging in.
 * @throws UserProfileMgtServiceClient
 * @throws IOException
 * @throws XPathExpressionException
 * @throws AutomationUtilException
 */
public static void updateProfileAndEnableEmailConfiguration(AutomationContext automationContext, String backendURL,
        String session)
        throws UserProfileMgtServiceUserProfileExceptionException, IOException, XPathExpressionException,
        AutomationUtilException {
    UserProfileMgtServiceClient userProfileMgtClient = new UserProfileMgtServiceClient(backendURL, session);
    File axis2File = new File(
            TestConfigurationProvider.getResourceLocation("GREG") + File.separator + "axis2" + File.separator
                    + "axis2.xml");
    UserProfileDTO profile = new UserProfileDTO();
    profile.setProfileName("default");

    UserFieldDTO lastName = new UserFieldDTO();
    lastName.setClaimUri("http://wso2.org/claims/lastname");
    lastName.setFieldValue("GregUserFirstName");

    UserFieldDTO givenName = new UserFieldDTO();
    givenName.setClaimUri("http://wso2.org/claims/givenname");
    givenName.setFieldValue("GregUserLastName");

    UserFieldDTO email = new UserFieldDTO();
    email.setClaimUri("http://wso2.org/claims/emailaddress");
    email.setFieldValue(emailAddress);

    UserFieldDTO[] fields = new UserFieldDTO[3];
    fields[0] = lastName;
    fields[1] = givenName;
    fields[2] = email;

    profile.setFieldValues(fields);

    userProfileMgtClient
            .setUserProfile(automationContext.getContextTenant().getContextUser().getUserName(), profile);

    // apply new axis2.xml configuration
    ServerConfigurationManager serverConfigurationManager = new ServerConfigurationManager(automationContext);
    serverConfigurationManager.applyConfiguration(axis2File);
}
 
Example #10
Source File: EmailUtil.java    From product-es with Apache License 2.0 5 votes vote down vote up
/**
 * Update user profile for particular user in order to enable e-mail subscription.
 *
 * @param automationContext
 * @param backendURL        URL of the server.
 * @param session           session cookie obtained after logging in.
 * @throws UserProfileMgtServiceClient
 * @throws IOException
 * @throws XPathExpressionException
 * @throws AutomationUtilException
 */
public static void updateProfileAndEnableEmailConfiguration(AutomationContext automationContext, String backendURL,
        String session)
        throws UserProfileMgtServiceUserProfileExceptionException, IOException, XPathExpressionException,
        AutomationUtilException {
    UserProfileMgtServiceClient userProfileMgtClient = new UserProfileMgtServiceClient(backendURL, session);
    File axis2File = new File(
            TestConfigurationProvider.getResourceLocation("GREG") + File.separator + "axis2" + File.separator
                    + "axis2.xml");
    UserProfileDTO profile = new UserProfileDTO();
    profile.setProfileName("default");

    UserFieldDTO lastName = new UserFieldDTO();
    lastName.setClaimUri("http://wso2.org/claims/lastname");
    lastName.setFieldValue("GregUserFirstName");

    UserFieldDTO givenName = new UserFieldDTO();
    givenName.setClaimUri("http://wso2.org/claims/givenname");
    givenName.setFieldValue("GregUserLastName");

    UserFieldDTO email = new UserFieldDTO();
    email.setClaimUri("http://wso2.org/claims/emailaddress");
    email.setFieldValue(emailAddress);

    UserFieldDTO[] fields = new UserFieldDTO[3];
    fields[0] = lastName;
    fields[1] = givenName;
    fields[2] = email;

    profile.setFieldValues(fields);

    userProfileMgtClient
            .setUserProfile(automationContext.getContextTenant().getContextUser().getUserName(), profile);

    // apply new axis2.xml configuration
    ServerConfigurationManager serverConfigurationManager = new ServerConfigurationManager(automationContext);
    serverConfigurationManager.applyConfiguration(axis2File);
}
 
Example #11
Source File: UserProfileMgtServiceClient.java    From product-es with Apache License 2.0 4 votes vote down vote up
public UserProfileDTO getProfileFieldsForInternalStore () throws RemoteException,
        UserProfileMgtServiceUserProfileExceptionException {

    return userProfileMgtServiceStub.getProfileFieldsForInternalStore();
}