Package org.jayasoft.woj.common.services

Examples of org.jayasoft.woj.common.services.ServerServicesProvider


                        LOGGER.info("we have been replaced by another master during our notification of being master: new master "+getCurrentMaster());
                        return;
                    }
                }
                LOGGER.debug("notifying "+server+" the new master is "+_master);
                ServerServicesProvider ssp = ServerServicesProvider.get(server);
                if (ssp.getServerManagementService().ping()) {
                    ssp.getServerManagementService().notifyNewMaster(_localServer, getCurrentPrivateKey());
                } else {
                    markServerDown(server);
                }
            } catch (Exception ex) {
                LOGGER.warn("impossible to notify "+server+" of the new master", ex);
View Full Code Here


                                choosenVisibility = Visibility.fromString(choosenVisibilityString);
                            }
                            f.set(Params.REPOSITORY.SHOW.FORM.CHOOSEN_VISIBILITY, choosenVisibility.getName());
                            request.setAttribute(Params.REPOSITORY.SHOW.FORM.CHOOSEN_VISIBILITY, choosenVisibility.getName());
                           
                            ServerServicesProvider userSSP = (ServerServicesProvider)request.getSession().getAttribute(Params.GENERAL.REQUEST.USER_SSP);
                           
                            AreaInfo info = new AreaInfoImpl();
                            AreaInfo[] orgInfos = null;
                            List orgs = Collections.EMPTY_LIST;
                            if (userLogged.getGroup() != null) {
                                try {
                                    info = userSSP.getModuleManagementService().getAreaInfo(new Long(userLogged.getGroup().getId()), choosenVisibility);
                                    orgInfos = userSSP.getModuleManagementService().getAllAreaInfo(new Long(userLogged.getGroup().getId()), choosenVisibility, null, null);
                                   
                                    orgs = Arrays.asList(orgInfos);
                                    Collections.sort(orgs, getComparator(compare, desc));
                                } catch (org.jayasoft.woj.common.services.ServiceException e) {
                                    LOGGER.warn("cannot retrieve organisations", e);
View Full Code Here

                            compare = NO_COMPARATOR_NAME;
                        }
                       
                        Visibility v = Visibility.fromString(visibility);
                       
                        ServerServicesProvider userSSP = (ServerServicesProvider)request.getSession().getAttribute(Params.GENERAL.REQUEST.USER_SSP);
                       
                        AreaInfo[] modInfos = null;
                        List mods = Collections.EMPTY_LIST;
                        try {
                            modInfos = userSSP.getModuleManagementService().getAllAreaInfo(new Long(userLogged.getGroup().getId()), v, organisation, null);

//                            orgs = Arrays.asList(userSSP.getContentService().getOrganisations(choosenVisibility, null));
                            mods = Arrays.asList(modInfos);
                            Collections.sort(mods, getComparator(compare, desc));
                        } catch (org.jayasoft.woj.common.services.ServiceException e) {
View Full Code Here

                            compare = NO_COMPARATOR_NAME;
                        }
                       
                        Visibility v = Visibility.fromString(visibility);
                       
                        ServerServicesProvider userSSP = (ServerServicesProvider)request.getSession().getAttribute(Params.GENERAL.REQUEST.USER_SSP);
                       
                        String action = request.getParameter(Params.REPOSITORY.SHOW_BY_MOD.PARAMS.ACTION);
                        if (!StringUtils.isBlank(action)) {
                            String revision = f.getString(Params.REPOSITORY.SHOW_BY_MOD.FORM.REVISION);
                            f.set(Params.REPOSITORY.SHOW_BY_MOD.FORM.REVISION, "");
                            try {
                                ModuleDescriptor md = userSSP.getModuleManagementService().getModule(v.getId(), organisation, module, revision);
                                userSSP.getModuleManagementService().removeModule(new Long(md.getId()));
                                LOGGER.info(MessageFormat.format("deleted {0}|{1}|{2}", new Object[] {organisation, module, revision}));
                            } catch (org.jayasoft.woj.common.services.ServiceException e) {
                                LOGGER.warn(MessageFormat.format("cannot delete {0}|{1}|{2}", new Object[] {organisation, module, revision}), e);
                            }
                        }
                       
                        AreaInfo[] revInfos = null;
                        List revs = Collections.EMPTY_LIST;
                        try {
                            revInfos = userSSP.getModuleManagementService().getAllAreaInfo(new Long(userLogged.getGroup().getId()), v, organisation, module);

                            revs = Arrays.asList(revInfos);
                            Collections.sort(revs, getComparator(compare, desc));
                        } catch (org.jayasoft.woj.common.services.ServiceException e) {
                            LOGGER.warn("cannot retrieve organisations", e);
View Full Code Here

         */
       
        UAKProvider uakProvider = (UAKProvider)request.getAttribute(Params.GENERAL.REQUEST.USER_UAK_PROVIDER);
       
        if (uakProvider==null) {
            ServerServicesProvider userSSP = ServerServicesProvider.get(Portal.getInstance().getMasterServer());
           
            UnifiedAuthentificationService uas = new UnifiedAuthentificationService();
            uas.setAuthentificationServer(Portal.getInstance().getMasterServer());
            uas.setLoginInfo(userLogged.getLogin(), userLogged.getPassword(), CommonSecurityHelper.BROWSER, true, Portal.getVersion());
           
            HttpAuthentificationService af = new HttpAuthentificationService();
            af.setServer(new SimpleTargetServerProvider(Portal.getInstance().getMasterServer()));
            af.setUnifiedAuthService(uas);
            af.setSsp(userSSP);
           
            UAK u = null;
            try {
                Authentification a = af.authenticate(userLogged.getLogin(), userLogged.getPassword(), CommonSecurityHelper.BROWSER, true, Portal.getInstance().getVersion());
                if (a instanceof AuthSuccessfull) {
                    AuthSuccessfull au = (AuthSuccessfull)a;
                    u = au.getKey();
                    uas.setLoginInfo(userLogged.getLogin(), userLogged.getPassword(), CommonSecurityHelper.BROWSER, true, Portal.getVersion(), u.getUserId(), u.getGroups(), u.getPublishVisibilityRight());
                    uas.setUAK(u);
                }
            } catch (org.jayasoft.woj.common.services.ServiceException e) {
                e.printStackTrace();
            }
           
            final UAK uak = u;
            uakProvider = new UAKProvider() {
                public UAK getUAK() {
                    return uak;
                }
            };
           
            userSSP.setAutoLoginUAKProvider(uakProvider);
            request.getSession().setAttribute(Params.GENERAL.REQUEST.USER_UAK_PROVIDER, uakProvider);
            request.getSession().setAttribute(Params.GENERAL.REQUEST.USER_SSP, userSSP);
        }

        return uakProvider.getUAK();
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.services.ServerServicesProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.