Revision: 3312
Author: seba.wagner
Date: Wed Aug 11 06:27:54 2010
Log: Rename some Service and Add Dao Skeleton for LdapConfig
http://code.google.com/p/openmeetings/source/detail?r=3312

Added:
/trunk/singlewebapp/src/app/org/openmeetings/app/data/basic/dao/LdapConfigDaoImpl.java /trunk/singlewebapp/src/app/org/openmeetings/app/data/basic/dao/SOAPLoginDaoImpl.java
Deleted:
/trunk/singlewebapp/src/app/org/openmeetings/app/data/basic/dao/SOAPLoginDAO.java
Modified:
 /trunk/singlewebapp/src/app/org/openmeetings/app/remote/MainService.java
/trunk/singlewebapp/src/userservice/org/openmeetings/axis/services/UserService.java

=======================================
--- /dev/null
+++ /trunk/singlewebapp/src/app/org/openmeetings/app/data/basic/dao/LdapConfigDaoImpl.java Wed Aug 11 06:27:54 2010
@@ -0,0 +1,23 @@
+package org.openmeetings.app.data.basic.dao;
+
+import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+
+public class LdapConfigDaoImpl {
+
+ private static final Logger log = Red5LoggerFactory.getLogger(LdapConfigDaoImpl.class, ScopeApplicationAdapter.webAppRootKey);
+
+       private LdapConfigDaoImpl() {
+       }
+
+       private static LdapConfigDaoImpl instance = null;
+
+       public static synchronized LdapConfigDaoImpl getInstance() {
+               if (instance == null) {
+                       instance = new LdapConfigDaoImpl();
+               }
+               return instance;
+       }
+
+}
=======================================
--- /dev/null
+++ /trunk/singlewebapp/src/app/org/openmeetings/app/data/basic/dao/SOAPLoginDaoImpl.java Wed Aug 11 06:27:54 2010
@@ -0,0 +1,129 @@
+package org.openmeetings.app.data.basic.dao;
+
+import java.util.Date;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.openmeetings.app.data.basic.FieldLanguageDaoImpl;
+import org.openmeetings.app.hibernate.beans.basic.SOAPLogin;
+import org.openmeetings.app.hibernate.beans.lang.FieldLanguage;
+import org.openmeetings.app.hibernate.utils.HibernateUtil;
+import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
+import org.openmeetings.utils.crypt.ManageCryptStyle;
+import org.red5.logging.Red5LoggerFactory;
+
+public class SOAPLoginDaoImpl {
+
+ private static final Logger log = Red5LoggerFactory.getLogger(SOAPLoginDaoImpl.class, ScopeApplicationAdapter.webAppRootKey);
+
+       private SOAPLoginDaoImpl() {
+       }
+
+       private static SOAPLoginDaoImpl instance = null;
+
+       public static synchronized SOAPLoginDaoImpl getInstance() {
+               if (instance == null) {
+                       instance = new SOAPLoginDaoImpl();
+               }
+               return instance;
+       }
+
+       public String addSOAPLogin(String sessionHash, Long room_id,
+                               boolean becomemoderator, boolean 
showAudioVideoTest,
+                               boolean allowSameURLMultipleTimes, Long 
recording_id) {
+               try {
+
+                       String thistime = "TIME_"+(new Date().getTime());
+
+ String hash = ManageCryptStyle.getInstance().getInstanceOfCrypt().createPassPhrase(thistime);
+
+                       Object idf = HibernateUtil.createSession();
+                       Session session = HibernateUtil.getSession();
+                       Transaction tx = session.beginTransaction();
+
+                       SOAPLogin soapLogin = new SOAPLogin();
+                       soapLogin.setCreated(new Date());
+                       soapLogin.setUsed(false);
+                       soapLogin.setRoom_id(room_id);
+                       
soapLogin.setAllowSameURLMultipleTimes(allowSameURLMultipleTimes);
+                       soapLogin.setHash(hash);
+                       soapLogin.setRoomRecordingId(recording_id);
+                       soapLogin.setSessionHash(sessionHash);
+                       soapLogin.setBecomemoderator(becomemoderator);
+                       soapLogin.setShowAudioVideoTest(showAudioVideoTest);
+
+                       Long soapLoginId = (Long) session.save(soapLogin);
+
+                       tx.commit();
+                       HibernateUtil.closeSession(idf);
+
+                       if (soapLoginId > 0) {
+                               return hash;
+                       } else {
+                               throw new Exception("Could not store 
SOAPLogin");
+                       }
+
+               } catch (HibernateException ex) {
+                       log.error("[addSOAPLogin]: ",ex);
+               } catch (Exception ex2) {
+                       log.error("[addSOAPLogin]: ",ex2);
+               }
+               return null;
+       }
+
+
+       public SOAPLogin getSOAPLoginByHash(String hash) {
+               try {
+                       String hql = "select sl from SOAPLogin as sl " +
+                                                       "WHERE sl.hash LIKE 
:hash";
+                       Object idf = HibernateUtil.createSession();
+                       Session session = HibernateUtil.getSession();
+                       Transaction tx = session.beginTransaction();
+                       Query query = session.createQuery(hql);
+                       query.setString("hash", hash);
+                       List<SOAPLogin> sList = query.list();
+                       tx.commit();
+                       HibernateUtil.closeSession(idf);
+
+                       if (sList.size() > 1) {
+ throw new Exception ("there are more then one SOAPLogin with identical hash! "+hash);
+                       }
+
+                       if (sList.size() == 1) {
+                               return sList.get(0);
+                       }
+
+
+               } catch (HibernateException ex) {
+                       log.error("[getSOAPLoginByHash]: ",ex);
+               } catch (Exception ex2) {
+                       log.error("[getSOAPLoginByHash]: ",ex2);
+               }
+               return null;
+       }
+
+       public void updateSOAPLogin(SOAPLogin soapLogin) {
+               try {
+
+                       Object idf = HibernateUtil.createSession();
+                       Session session = HibernateUtil.getSession();
+                       Transaction tx = session.beginTransaction();
+
+                       session.update(soapLogin);
+
+                       tx.commit();
+                       HibernateUtil.closeSession(idf);
+
+               } catch (HibernateException ex) {
+                       log.error("[updateSOAPLogin]: ",ex);
+               } catch (Exception ex2) {
+                       log.error("[updateSOAPLogin]: ",ex2);
+               }
+       }
+
+
+}
=======================================
--- /trunk/singlewebapp/src/app/org/openmeetings/app/data/basic/dao/SOAPLoginDAO.java Tue May 11 13:54:08 2010
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.openmeetings.app.data.basic.dao;
-
-import java.util.Date;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.hibernate.HibernateException;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.openmeetings.app.data.basic.FieldLanguageDaoImpl;
-import org.openmeetings.app.hibernate.beans.basic.SOAPLogin;
-import org.openmeetings.app.hibernate.beans.lang.FieldLanguage;
-import org.openmeetings.app.hibernate.utils.HibernateUtil;
-import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
-import org.openmeetings.utils.crypt.ManageCryptStyle;
-import org.red5.logging.Red5LoggerFactory;
-
-public class SOAPLoginDAO {
-
- private static final Logger log = Red5LoggerFactory.getLogger(SOAPLoginDAO.class, ScopeApplicationAdapter.webAppRootKey);
-
-       private SOAPLoginDAO() {
-       }
-
-       private static SOAPLoginDAO instance = null;
-
-       public static synchronized SOAPLoginDAO getInstance() {
-               if (instance == null) {
-                       instance = new SOAPLoginDAO();
-               }
-               return instance;
-       }
-
-       public String addSOAPLogin(String sessionHash, Long room_id,
-                               boolean becomemoderator, boolean 
showAudioVideoTest,
-                               boolean allowSameURLMultipleTimes, Long 
recording_id) {
-               try {
-
-                       String thistime = "TIME_"+(new Date().getTime());
-
- String hash = ManageCryptStyle.getInstance().getInstanceOfCrypt().createPassPhrase(thistime);
-
-                       Object idf = HibernateUtil.createSession();
-                       Session session = HibernateUtil.getSession();
-                       Transaction tx = session.beginTransaction();
-
-                       SOAPLogin soapLogin = new SOAPLogin();
-                       soapLogin.setCreated(new Date());
-                       soapLogin.setUsed(false);
-                       soapLogin.setRoom_id(room_id);
-                       
soapLogin.setAllowSameURLMultipleTimes(allowSameURLMultipleTimes);
-                       soapLogin.setHash(hash);
-                       soapLogin.setRoomRecordingId(recording_id);
-                       soapLogin.setSessionHash(sessionHash);
-                       soapLogin.setBecomemoderator(becomemoderator);
-                       soapLogin.setShowAudioVideoTest(showAudioVideoTest);
-
-                       Long soapLoginId = (Long) session.save(soapLogin);
-
-                       tx.commit();
-                       HibernateUtil.closeSession(idf);
-
-                       if (soapLoginId > 0) {
-                               return hash;
-                       } else {
-                               throw new Exception("Could not store 
SOAPLogin");
-                       }
-
-               } catch (HibernateException ex) {
-                       log.error("[addSOAPLogin]: ",ex);
-               } catch (Exception ex2) {
-                       log.error("[addSOAPLogin]: ",ex2);
-               }
-               return null;
-       }
-
-
-       public SOAPLogin getSOAPLoginByHash(String hash) {
-               try {
-                       String hql = "select sl from SOAPLogin as sl " +
-                                                       "WHERE sl.hash LIKE 
:hash";
-                       Object idf = HibernateUtil.createSession();
-                       Session session = HibernateUtil.getSession();
-                       Transaction tx = session.beginTransaction();
-                       Query query = session.createQuery(hql);
-                       query.setString("hash", hash);
-                       List<SOAPLogin> sList = query.list();
-                       tx.commit();
-                       HibernateUtil.closeSession(idf);
-
-                       if (sList.size() > 1) {
- throw new Exception ("there are more then one SOAPLogin with identical hash! "+hash);
-                       }
-
-                       if (sList.size() == 1) {
-                               return sList.get(0);
-                       }
-
-
-               } catch (HibernateException ex) {
-                       log.error("[getSOAPLoginByHash]: ",ex);
-               } catch (Exception ex2) {
-                       log.error("[getSOAPLoginByHash]: ",ex2);
-               }
-               return null;
-       }
-
-       public void updateSOAPLogin(SOAPLogin soapLogin) {
-               try {
-
-                       Object idf = HibernateUtil.createSession();
-                       Session session = HibernateUtil.getSession();
-                       Transaction tx = session.beginTransaction();
-
-                       session.update(soapLogin);
-
-                       tx.commit();
-                       HibernateUtil.closeSession(idf);
-
-               } catch (HibernateException ex) {
-                       log.error("[updateSOAPLogin]: ",ex);
-               } catch (Exception ex2) {
-                       log.error("[updateSOAPLogin]: ",ex2);
-               }
-       }
-
-
-}
=======================================
--- /trunk/singlewebapp/src/app/org/openmeetings/app/remote/MainService.java Thu Jul 29 10:04:42 2010 +++ /trunk/singlewebapp/src/app/org/openmeetings/app/remote/MainService.java Wed Aug 11 06:27:54 2010
@@ -38,7 +38,7 @@
 import org.openmeetings.app.data.conference.Feedbackmanagement;
 import org.openmeetings.app.data.conference.Roommanagement;
 import org.openmeetings.app.data.basic.AuthLevelmanagement;
-import org.openmeetings.app.data.basic.dao.SOAPLoginDAO;
+import org.openmeetings.app.data.basic.dao.SOAPLoginDaoImpl;
 import org.openmeetings.app.remote.red5.ClientListManager;
 import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
 import org.openmeetings.app.rss.LoadAtomRssFeed;
@@ -407,7 +407,7 @@

                log.debug("swfURL "+clientURL);

- SOAPLogin soapLogin = SOAPLoginDAO.getInstance().getSOAPLoginByHash(secureHash); + SOAPLogin soapLogin = SOAPLoginDaoImpl.getInstance().getSOAPLoginByHash(secureHash);

                if (soapLogin.getUsed()) {

@@ -437,7 +437,7 @@

                                soapLogin.setClientURL(clientURL);

-                               
SOAPLoginDAO.getInstance().updateSOAPLogin(soapLogin);
+                               
SOAPLoginDaoImpl.getInstance().updateSOAPLogin(soapLogin);

                                //Create Return Object and hide the validated
                                //sessionHash that is stored server side
=======================================
--- /trunk/singlewebapp/src/userservice/org/openmeetings/axis/services/UserService.java Tue May 11 13:54:08 2010 +++ /trunk/singlewebapp/src/userservice/org/openmeetings/axis/services/UserService.java Wed Aug 11 06:27:54 2010
@@ -11,7 +11,7 @@
 import org.openmeetings.app.data.basic.ErrorManagement;
 import org.openmeetings.app.data.basic.Fieldmanagment;
 import org.openmeetings.app.data.basic.Sessionmanagement;
-import org.openmeetings.app.data.basic.dao.SOAPLoginDAO;
+import org.openmeetings.app.data.basic.dao.SOAPLoginDaoImpl;
 import org.openmeetings.app.data.beans.basic.ErrorResult;
 import org.openmeetings.app.data.beans.basic.SearchResult;
 import org.openmeetings.app.data.user.Organisationmanagement;
@@ -285,7 +285,7 @@
                                        showAudioVideoTest = true;
                                }

-                               String hash = 
SOAPLoginDAO.getInstance().addSOAPLogin(SID, room_id,
+                               String hash = 
SOAPLoginDaoImpl.getInstance().addSOAPLogin(SID, room_id,
                                                                                
                                        
becomeModerator,showAudioVideoTest,false, null);

                                if (hash != null) {
@@ -343,7 +343,7 @@
                                        showAudioVideoTest = true;
                                }

-                               String hash = 
SOAPLoginDAO.getInstance().addSOAPLogin(SID, room_id,
+                               String hash = 
SOAPLoginDaoImpl.getInstance().addSOAPLogin(SID, room_id,
                                                                                
                                        
becomeModerator,showAudioVideoTest,true, null);

                                if (hash != null) {
@@ -389,7 +389,7 @@
Sessionmanagement.getInstance().updateUserRemoteSession(SID, xmlString);


-                               String hash = 
SOAPLoginDAO.getInstance().addSOAPLogin(SID, null,
+                               String hash = 
SOAPLoginDaoImpl.getInstance().addSOAPLogin(SID, null,
                                                                                
                                        false,false,true, recording_id);

                                if (hash != null) {

--
You received this message because you are subscribed to the Google Groups 
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/openmeetings-dev?hl=en.

Reply via email to