it.eng.rdlab.soa3.um.rest.utils
Class Utils

java.lang.Object
  extended by it.eng.rdlab.soa3.um.rest.utils.Utils

public class Utils
extends Object

This class provides utilities to manage LDAP's features and object mapping

Version:
1.0
Author:
Ermanno Travaglino

Constructor Summary
Utils()
           
 
Method Summary
static UserModel convertUserModel(it.eng.rdlab.um.ldap.user.bean.LdapUserModel ldapUserModel)
          Converts the LDAPUserModel to UserModel
static String generateGroupsDN(String organizationName)
          Generates the groups' distinguished name under an organization
static String generatePeopleDN(String organizationName)
          Generates the people's distinguished name under an organization
static String generateRolesDN(String organizationName)
          Generates the roles' distinguished name under an organization
static org.codehaus.jackson.map.ObjectMapper getMapper()
          Chooses JAXB as the annotation for the serialization/deserialization
static String getOrganizationNameFromDN(String organizationDn)
          Gets the organization's name from distinguished name
static String groupDNBuilder(String groupId, String organizationName)
          Builds the group's distinguished name
static void initLdap(String adminUsername, String adminPassword, String ldapUrl)
          Initializes the LDAP server with admin's credential and LDAP URL
static String organizationDNBuilder(String organizationName)
          Builds the organization's distinguished name
static String roleDNBuilder(String roleId, String organizationName)
          Builds the role's distinguished name
static String userDNBuilder(String userId, String organizationName)
          Builds the user's distinguished name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

organizationDNBuilder

public static String organizationDNBuilder(String organizationName)
Builds the organization's distinguished name

Parameters:
organizationName - String
Returns:
organizationDN String

userDNBuilder

public static String userDNBuilder(String userId,
                                   String organizationName)
Builds the user's distinguished name

Parameters:
userId - String
organizationName - String
Returns:
userDN String

roleDNBuilder

public static String roleDNBuilder(String roleId,
                                   String organizationName)
Builds the role's distinguished name

Parameters:
roleId - String
organizationName - String
Returns:
roleDN String

groupDNBuilder

public static String groupDNBuilder(String groupId,
                                    String organizationName)
Builds the group's distinguished name

Parameters:
groupId - String
organizationName - String
Returns:
groupDN String

getOrganizationNameFromDN

public static String getOrganizationNameFromDN(String organizationDn)
Gets the organization's name from distinguished name

Parameters:
organizationDn - String
Returns:
organizationName String

initLdap

public static void initLdap(String adminUsername,
                            String adminPassword,
                            String ldapUrl)
                     throws NamingException
Initializes the LDAP server with admin's credential and LDAP URL

Parameters:
adminUsername - String
adminPassword - String
ldapUrl - String
Throws:
NamingException

convertUserModel

public static UserModel convertUserModel(it.eng.rdlab.um.ldap.user.bean.LdapUserModel ldapUserModel)
Converts the LDAPUserModel to UserModel

Parameters:
ldapUserModel - LdapUserModel
Returns:
userModel UserModel

generatePeopleDN

public static String generatePeopleDN(String organizationName)
Generates the people's distinguished name under an organization

Parameters:
organizationName - String
Returns:
peopleDN String

generateGroupsDN

public static String generateGroupsDN(String organizationName)
Generates the groups' distinguished name under an organization

Parameters:
organizationName - String
Returns:
groupsDN String

generateRolesDN

public static String generateRolesDN(String organizationName)
Generates the roles' distinguished name under an organization

Parameters:
organizationName - String
Returns:
rolesDN String

getMapper

public static org.codehaus.jackson.map.ObjectMapper getMapper()
Chooses JAXB as the annotation for the serialization/deserialization

Returns:
mapper ObjectMapper


Copyright © 2013. All Rights Reserved.