Examples of SentinelaAdmInterface


Examples of gov.pr.celepar.sentinela.comunicacao.SentinelaAdmInterface

   * @throws SentinelaException
   */
  public void associarAhGruposSentinela(HttpServletRequest request,  UsuarioUsu usuario)throws ECARException , SentinelaException{
    long codUsuarioSentinela=0l;
    int i=0;
    SentinelaAdmInterface sentinelaAdmin  = SentinelaUtil.getSentinelaAdmInterface(request);
    SentinelaInterface sentinela = SentinelaUtil.getSentinelaInterface();
   
    try{
      if (usuario.getIdDominioUsu()!=null && usuario.getIdDominioUsu().length()!=)
        codUsuarioSentinela = Long.parseLong(usuario.getIdDominioUsu() );
    } catch(NumberFormatException numExcep)  {
      throw new  ECARException( )
    }
    Set gruposVinculadosDepois = new HashSet<Long>(1);
    String[] strGruposVinculadosDepois = request.getParameterValues("vinculandos");
   
    SentinelaParam[] gruposVinculadosSent = null;
   
    if (codUsuarioSentinela!=0l)
      gruposVinculadosSent = sentinela.getGruposByUsuario(codUsuarioSentinela);
   
    if (strGruposVinculadosDepois !=null && strGruposVinculadosDepois.length !=0) {
      gruposVinculadosDepois = new HashSet <Long>(strGruposVinculadosDepois.length);

      for (i = 0; i < strGruposVinculadosDepois.length; i++) {
        gruposVinculadosDepois.add new Long(strGruposVinculadosDepois[i]) );
      }
    }
   
//    try {
   
      for (int j = 0; j < gruposVinculadosSent.length; j++) {
        Long codigo = new Long (gruposVinculadosSent[j].getCodigo());
       
        if (gruposVinculadosDepois.contains( codigo)  ){
          gruposVinculadosDepois.remove(codigo);
        } else{
            sentinelaAdmin.desvincularUsuarioGrupo(codUsuarioSentinela, codigo);
        }
      }
     
      for (Iterator iterator = gruposVinculadosDepois.iterator(); iterator.hasNext();) {
        Long codigo= (Long) iterator.next();
        sentinelaAdmin.vincularUsuarioGrupo(codUsuarioSentinela, codigo);
      }
   
//    } catch (SentinelaException e) {
//       throw new ECARException("Usu�rio sem permiss�o aos m�todos de vincula��o de usu�rios aos grupos do Sentinela."); 
//    }
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.