Search in sources :

Example 1 with RoleManagementEventPublisherProxy

use of org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy in project carbon-identity-framework by wso2.

the class RoleManagementServiceImpl method deleteRole.

@Override
public void deleteRole(String roleID, String tenantDomain) throws IdentityRoleManagementException {
    RoleManagementEventPublisherProxy roleManagementEventPublisherProxy = RoleManagementEventPublisherProxy.getInstance();
    roleManagementEventPublisherProxy.publishPreDeleteRole(roleID, tenantDomain);
    roleDAO.deleteRole(roleID, tenantDomain);
    roleManagementEventPublisherProxy.publishPostDeleteRole(roleID, tenantDomain);
    if (log.isDebugEnabled()) {
        log.debug(String.format("%s deleted role of id : %s successfully.", getUser(tenantDomain), roleID));
    }
    audit.info(String.format(auditMessage, getUser(tenantDomain), "Delete role by id", roleID, getAuditData(tenantDomain), success));
}
Also used : RoleManagementEventPublisherProxy(org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy)

Example 2 with RoleManagementEventPublisherProxy

use of org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy in project carbon-identity-framework by wso2.

the class RoleManagementServiceImpl method updateRoleName.

@Override
public RoleBasicInfo updateRoleName(String roleID, String newRoleName, String tenantDomain) throws IdentityRoleManagementException {
    RoleManagementEventPublisherProxy roleManagementEventPublisherProxy = RoleManagementEventPublisherProxy.getInstance();
    roleManagementEventPublisherProxy.publishPreUpdateRoleName(roleID, newRoleName, tenantDomain);
    RoleBasicInfo roleBasicInfo = roleDAO.updateRoleName(roleID, newRoleName, tenantDomain);
    roleManagementEventPublisherProxy.publishPostUpdateRoleName(roleID, newRoleName, tenantDomain);
    if (log.isDebugEnabled()) {
        log.debug(String.format("%s updated role name of role id : %s successfully.", getUser(tenantDomain), roleID));
    }
    audit.info(String.format(auditMessage, getUser(tenantDomain), "Update role name by ID", roleID, getAuditData(tenantDomain, newRoleName), success));
    return roleBasicInfo;
}
Also used : RoleManagementEventPublisherProxy(org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy) RoleBasicInfo(org.wso2.carbon.identity.role.mgt.core.RoleBasicInfo)

Example 3 with RoleManagementEventPublisherProxy

use of org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy in project carbon-identity-framework by wso2.

the class RoleManagementServiceImpl method getRole.

@Override
public Role getRole(String roleID, String tenantDomain) throws IdentityRoleManagementException {
    RoleManagementEventPublisherProxy roleManagementEventPublisherProxy = RoleManagementEventPublisherProxy.getInstance();
    roleManagementEventPublisherProxy.publishPreGetRole(roleID, tenantDomain);
    Role role = roleDAO.getRole(roleID, tenantDomain);
    roleManagementEventPublisherProxy.publishPostGetRole(roleID, tenantDomain);
    if (log.isDebugEnabled()) {
        log.debug(String.format("%s get role of id : %s successfully.", getUser(tenantDomain), roleID));
    }
    return role;
}
Also used : Role(org.wso2.carbon.identity.role.mgt.core.Role) RoleManagementEventPublisherProxy(org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy)

Example 4 with RoleManagementEventPublisherProxy

use of org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy in project carbon-identity-framework by wso2.

the class RoleManagementServiceImpl method updateGroupListOfRole.

@Override
public RoleBasicInfo updateGroupListOfRole(String roleID, List<String> newGroupIDList, List<String> deletedGroupIDList, String tenantDomain) throws IdentityRoleManagementException {
    RoleManagementEventPublisherProxy roleManagementEventPublisherProxy = RoleManagementEventPublisherProxy.getInstance();
    roleManagementEventPublisherProxy.publishPreUpdateGroupListOfRole(roleID, newGroupIDList, deletedGroupIDList, tenantDomain);
    RoleBasicInfo roleBasicInfo = roleDAO.updateGroupListOfRole(roleID, newGroupIDList, deletedGroupIDList, tenantDomain);
    roleManagementEventPublisherProxy.publishPostUpdateGroupListOfRole(roleID, newGroupIDList, deletedGroupIDList, tenantDomain);
    if (log.isDebugEnabled()) {
        log.debug(String.format("%s updated list of groups of role of id : %s successfully.", getUser(tenantDomain), roleID));
    }
    audit.info(String.format(auditMessage, getUser(tenantDomain), "Update group list of role by id", roleID, getAuditData(tenantDomain), success));
    return roleBasicInfo;
}
Also used : RoleManagementEventPublisherProxy(org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy) RoleBasicInfo(org.wso2.carbon.identity.role.mgt.core.RoleBasicInfo)

Example 5 with RoleManagementEventPublisherProxy

use of org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy in project carbon-identity-framework by wso2.

the class RoleManagementServiceImpl method getGroupListOfRole.

@Override
public List<GroupBasicInfo> getGroupListOfRole(String roleID, String tenantDomain) throws IdentityRoleManagementException {
    RoleManagementEventPublisherProxy roleManagementEventPublisherProxy = RoleManagementEventPublisherProxy.getInstance();
    roleManagementEventPublisherProxy.publishPreGetUserListOfRole(roleID, tenantDomain);
    List<GroupBasicInfo> groupBasicInfoList = roleDAO.getGroupListOfRole(roleID, tenantDomain);
    roleManagementEventPublisherProxy.publishPostGetUserListOfRole(roleID, tenantDomain);
    if (log.isDebugEnabled()) {
        log.debug(String.format("%s get list of groups of role of id : %s successfully.", getUser(tenantDomain), roleID));
    }
    return groupBasicInfoList;
}
Also used : GroupBasicInfo(org.wso2.carbon.identity.role.mgt.core.GroupBasicInfo) RoleManagementEventPublisherProxy(org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy)

Aggregations

RoleManagementEventPublisherProxy (org.wso2.carbon.identity.role.mgt.core.RoleManagementEventPublisherProxy)11 RoleBasicInfo (org.wso2.carbon.identity.role.mgt.core.RoleBasicInfo)6 GroupBasicInfo (org.wso2.carbon.identity.role.mgt.core.GroupBasicInfo)1 IdentityRoleManagementClientException (org.wso2.carbon.identity.role.mgt.core.IdentityRoleManagementClientException)1 Role (org.wso2.carbon.identity.role.mgt.core.Role)1 UserBasicInfo (org.wso2.carbon.identity.role.mgt.core.UserBasicInfo)1