Package org.palo.viewapi.services

Examples of org.palo.viewapi.services.AdministrationService.save()


      if (viewApiUser == null) {
        if (user.equals("admin")) {
          viewApiUser = admin;
        } else {
          viewApiUser = admService.createUser("", "", user, pass);
          admService.save(viewApiUser);
        }         
        Role viewerRole = admService.getRoleByName("VIEWER");
        Role editorRole = admService.getRoleByName("EDITOR");
        IUserRoleManagement urAssoc = MapperRegistry.getInstance().getUserRoleAssociation();       
        urAssoc.insert(viewApiUser, viewerRole);
View Full Code Here


        IUserRoleManagement urAssoc = MapperRegistry.getInstance().getUserRoleAssociation();       
        urAssoc.insert(viewApiUser, viewerRole);
        urAssoc.insert(viewApiUser, editorRole);
        admService.add(viewerRole, viewApiUser);
        admService.add(editorRole, viewApiUser);
        admService.save(viewApiUser);
      }
      PaloConnection conToUse = null;
      for (PaloConnection conn: admService.getConnections()) {
        if (psd.host.equals(conn.getHost()) &&
          psd.port.equals(conn.getService())) {
View Full Code Here

          break;
        }
      }
      if (conToUse == null) {
        conToUse = admService.createConnection("PaloCon", psd.host, psd.port, PaloConnection.TYPE_HTTP);
        admService.save(conToUse);
      }
      Account accountToUse = null;
      AuthUser authenticatedUser = null;
      try {
        if (viewApiUser.getLoginName().equals("admin")) {
View Full Code Here

        } else {
          authenticatedUser = ServiceProvider.getAuthenticationService().authenticate(viewApiUser.getLoginName(), pass);
        }
        if (!viewApiUser.getLoginName().equals("admin")) {
          admService.setPassword(pass, viewApiUser);
          admService.save(viewApiUser);
        }
      } catch (AuthenticationFailedException e) {
        if (!viewApiUser.getLoginName().equals("admin")) {
          admService.setPassword(pass, viewApiUser);         
          admService.save(viewApiUser);
View Full Code Here

          admService.save(viewApiUser);
        }
      } catch (AuthenticationFailedException e) {
        if (!viewApiUser.getLoginName().equals("admin")) {
          admService.setPassword(pass, viewApiUser);         
          admService.save(viewApiUser);
        }
        authenticatedUser = ServiceProvider.getAuthenticationService().authenticate(viewApiUser.getLoginName(), pass);
      }
     
      if (authenticatedUser != null) {
View Full Code Here

            accountToUse = acc;
          }
        }
        if (accountToUse == null) {
          accountToUse = admService.createAccount(user, pass, viewApiUser, conToUse);
          admService.save(accountToUse);
        }
      }
      if (accountToUse != null && authenticatedUser != null) {
        AccountConverter co = new AccountConverter();
        XAccount xAccount = (XAccount) co.toXObject(accountToUse);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.