/* */ package com.gehc.sf.service; /* */ /* */ import com.gehc.sf.dto.SawfishException; /* */ import com.gehc.sf.dto.SfUser; /* */ import com.gehc.sf.dto.SfUserAppColumn; /* */ import com.gehc.sf.user.ejb.UserManager; /* */ import com.gehc.sf.user.ejb.UserManagerHome; /* */ import com.gehc.sf.user.ejb.UserManagerUtil; /* */ import java.rmi.RemoteException; /* */ import java.util.Hashtable; /* */ import javax.ejb.CreateException; /* */ import javax.naming.NamingException; /* */ import org.apache.commons.logging.Log; /* */ import org.apache.commons.logging.LogFactory; /* */ /* */ public class UserRemoteService /* */ implements UserService /* */ { /* 21 */ private static UserRemoteService instance = null; /* */ /* 214 */ private static Log log = LogFactory.getLog(UserRemoteService.class); /* */ /* */ public static synchronized UserRemoteService getInstance() /* */ { /* 26 */ if (instance == null) /* 27 */ instance = new UserRemoteService(); /* 28 */ return instance; /* */ } /* */ /* */ public SfUser createUser(SfUser sfuser) /* */ throws ServiceException /* */ { /* 34 */ UserManager usermanager = lookUpSessionBean(); /* */ try { /* 36 */ return usermanager.createUser(sfuser); /* */ } /* */ catch (RemoteException e) { /* 39 */ e.printStackTrace(); /* */ } /* */ catch (SawfishException e) { /* 42 */ e.printStackTrace(); /* */ } /* */ /* 49 */ return sfuser; /* */ } /* */ /* */ public void modifyUser(SfUser sfuser) /* */ throws ServiceException /* */ { /* 55 */ UserManager usermanager = lookUpSessionBean(); /* */ try /* */ { /* 58 */ usermanager.modifyUser(sfuser); /* */ } /* */ catch (SawfishException sawfishexception) /* */ { /* 62 */ throw new ServiceException(sawfishexception); /* */ } /* */ catch (RemoteException remoteexception) /* */ { /* 66 */ throw new ServiceException(remoteexception); /* */ } /* */ } /* */ /* */ public void modifyUserAppColumn(SfUserAppColumn sfuserappcolumn) /* */ throws ServiceException /* */ { /* 73 */ UserManager usermanager = lookUpSessionBean(); /* */ try /* */ { /* 76 */ usermanager.modifyUserAppColumn(sfuserappcolumn); /* */ } /* */ catch (SawfishException sawfishexception) /* */ { /* 80 */ throw new ServiceException(sawfishexception); /* */ } /* */ catch (RemoteException remoteexception) /* */ { /* 84 */ throw new ServiceException(remoteexception); /* */ } /* */ } /* */ /* */ public void removeUser(SfUser sfuser) /* */ throws ServiceException /* */ { /* 91 */ UserManager usermanager = lookUpSessionBean(); /* */ try /* */ { /* 94 */ usermanager.removeUser(sfuser); /* */ } /* */ catch (SawfishException sawfishexception) /* */ { /* 98 */ throw new ServiceException(sawfishexception); /* */ } /* */ catch (RemoteException remoteexception) /* */ { /* 102 */ throw new ServiceException(remoteexception); /* */ } /* */ } /* */ /* */ public SfUser getUserBySsoId(String s) /* */ throws ServiceException /* */ { /* 109 */ UserManager usermanager = lookUpSessionBean(); /* */ try { /* 111 */ return usermanager.getUserBySsoId(s); /* */ } /* */ catch (RemoteException e) { /* 114 */ e.printStackTrace(); /* */ } /* */ catch (SawfishException localSawfishException) /* */ { /* */ } /* */ /* 123 */ return null; /* */ } /* */ /* */ public SfUser getUserById(Long long1) /* */ throws ServiceException /* */ { /* 129 */ UserManager usermanager = lookUpSessionBean(); /* */ try { /* 131 */ return usermanager.getUserById(long1); /* */ } /* */ catch (RemoteException e) { /* 134 */ e.printStackTrace(); /* */ } /* */ catch (SawfishException e) { /* 137 */ e.printStackTrace(); /* */ } /* */ /* 144 */ return null; /* */ } /* */ /* */ private UserManager lookUpSessionBean() /* */ throws ServiceException /* */ { /* 150 */ Hashtable hashtable = new Hashtable(); /* 151 */ hashtable.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); /* */ /* 153 */ hashtable.put("java.naming.provider.url", "jnp://localhost:8080"); /* 154 */ hashtable.put("java.naming.factory.url.pkgs", "org.jnp.interfaces"); /* */ try /* */ { /* 158 */ usermanagerhome = UserManagerUtil.getHome(hashtable); /* */ } /* */ catch (NamingException namingexception) /* */ { /* */ UserManagerHome usermanagerhome; /* 162 */ debug(namingexception); /* 163 */ throw new ServiceException(namingexception); /* */ } /* */ try /* */ { /* */ UserManagerHome usermanagerhome; /* 168 */ usermanager = usermanagerhome.create(); /* */ } /* */ catch (CreateException createexception) /* */ { /* */ UserManager usermanager; /* 172 */ debug(createexception); /* 173 */ throw new ServiceException(createexception); /* */ } /* */ catch (RemoteException remoteexception) /* */ { /* 177 */ debug(remoteexception); /* 178 */ throw new ServiceException(remoteexception); /* */ } /* */ UserManager usermanager; /* 180 */ return usermanager; /* */ } /* */ /* */ private void debug(Exception exception) /* */ { /* 185 */ if (log.isErrorEnabled()) /* 186 */ log.error(" : " + exception); /* */ } /* */ /* */ static Class _mthclass$(String s) /* */ { /* */ try /* */ { /* 196 */ return Class.forName(s); /* */ } /* */ catch (ClassNotFoundException classnotfoundexception) { /* 199 */ e.printStackTrace(); /* */ /* 201 */ ClassNotFoundException classnotfoundexception = null; /* */ try /* */ { /* 204 */ throw new NoClassDefFoundError().initCause(classnotfoundexception); /* */ } /* */ catch (Throwable e) { /* 207 */ e.printStackTrace(); /* */ } /* */ } /* 209 */ return null; /* */ } /* */ } /* Location: C:\Documents and Settings\501373992\Desktop\Mummasani\sawfish\New Folder\New Folder (2)\WEB-INF\classes\ * Qualified Name: com.gehc.sf.service.UserRemoteService * JD-Core Version: 0.6.0 */