cz.muni.fi.rtc.teacherWorkbench.importer
Class Utils

java.lang.Object
  extended by cz.muni.fi.rtc.teacherWorkbench.importer.Utils

public class Utils
extends java.lang.Object

Utility static methods used for methods used by different classes

Author:
honza

Constructor Summary
Utils()
           
 
Method Summary
static ImporterConfiguration configurationFromProperties(java.lang.String confPath)
          Reads configuration from .properties file and returns them as the ImporterConfiguration.
static com.novell.ldap.LDAPConnection establishLdapConnection(ImporterConfiguration configuration)
          Returns LDAP connection.
static com.ibm.team.repository.client.ITeamRepository establishRepositoryConnection(ImporterConfiguration configuration)
          Connects to RTC repository (if not already connected)
 
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

establishLdapConnection

public static com.novell.ldap.LDAPConnection establishLdapConnection(ImporterConfiguration configuration)
                                                              throws ImporterException
Returns LDAP connection. Connection is established if there is no connection yet

Returns:
LDAP connection
Throws:
ImporterException

establishRepositoryConnection

public static com.ibm.team.repository.client.ITeamRepository establishRepositoryConnection(ImporterConfiguration configuration)
                                                                                    throws ImporterException
Connects to RTC repository (if not already connected)

Returns:
RTC repository connection
Throws:
ImporterException - Wraps connection exceptions

configurationFromProperties

public static ImporterConfiguration configurationFromProperties(java.lang.String confPath)
                                                         throws org.apache.commons.configuration.ConfigurationException
Reads configuration from .properties file and returns them as the ImporterConfiguration. Default values are available for some properties.
Example configuration file:
 #### LDAP ####
 ldapServer = localhost
 ldapPort = 10389
 ldapAdminDN = uid=admin\,ou=system
 ldapAdminPassword = secret
 ldapBaseDN = o=localhost
 ldapGroupJazzUsers = cn=JazzUsers\,ou=JazzGroups\,o=localhost
 ldapGroupPeople = ou=people\,o=localhost
 
 #### SMTP ####
 smtpHost = localhost
 emailFromAddress = root@localhost
 # optional -- dafault "RTC Administrator"
 emailFromName = RTC Administrator
 # optional -- default 25
 smtpPort = 25 
 # optional -- default false
 smtpTls = false 
 # optional -- default empty
 smtpUser = 
 # optional -- default empty
 smtpPassword = 
 
 ## Example SMTP for GMAIL                      
 #smtpHost = smtp.gmail.com
 #smtpTls = true # optional -- default false
 #smtpPort = 587
 #smtpUser = honza.stastny@gmail.com
 #smtpPassword = password
 #emailFromAddress = honza.stastny@gmail.com
 
 
 
 #### RTC Repository ####
 rtcAddress = https://localhost:9443/jazz
 rtcAdminUser = jstastny
 rtcAdminPassword = jstastny
 

Parameters:
confPath - Path to the configuration file
Returns:
Importer configuration based on the properties file
Throws:
org.apache.commons.configuration.ConfigurationException - If the configuration is invalid