Example #1
0
 /** Método de ejecución del hilo. */
 public void run() {
   running = true;
   while (!stopped) { // El hilo sigue corriendo.
     if (done) { // We are waiting for a task now.
       synchronized (this) {
         try {
           if (logger.isDebugEnabled())
             logger.debug("Wait until we get a task to execute. Id: " + this.toString());
           this.wait(); // Wait until we get a task to execute.
         } catch (InterruptedException e) {
           stopped = true;
           logger.error("Run InterruptedException =" + this.getAdress(), e);
         }
       }
     } else { // There is a task....let us execute it.
       try {
         if (logger.isDebugEnabled()) logger.debug("Se ejecuta Id: " + this.toString());
         execute();
       } catch (Exception e) {
         logger.error("#### Run exception =" + this.getAdress(), e);
       } finally {
         reset();
       }
     }
   }
 }
  public void update(DbConnection db) throws ISicresRPAdminDAOException {
    DynamicTable tableInfo = new DynamicTable();
    DynamicRows rowsInfo = new DynamicRows();
    DynamicRow rowInfo = new DynamicRow();
    SicresUserPermisosTabla table = new SicresUserPermisosTabla();

    try {
      if (logger.isDebugEnabled()) {
        logger.debug("Actualizando scr_usrperms.");
      }

      tableInfo.setTableObject(table);
      tableInfo.setClassName(table.getClass().getName());
      tableInfo.setTablesMethod("getTableName");
      tableInfo.setColumnsMethod("getUpdateColumnNames");

      rowInfo.addRow(this);
      rowInfo.setClassName(this.getClass().getName());
      rowInfo.setValuesMethod("update");
      rowsInfo.add(rowInfo);

      DynamicFns.update(db, table.getById(getIdUsr()), tableInfo, rowsInfo);
      if (logger.isDebugEnabled()) {
        logger.debug("Actualizado scr_usrperms.");
      }
    } catch (Exception e) {
      logger.error("Error actualizando scr_usrperms", e);
      throw new ISicresRPAdminDAOException(ISicresRPAdminDAOException.SCR_USRPERMS_UPDATE);
    }
  }
  public void add(DbConnection db) throws ISicresRPAdminDAOException {
    DynamicTable tableInfo = new DynamicTable();
    DynamicRows rowsInfo = new DynamicRows();
    DynamicRow rowInfo = new DynamicRow();
    SicresUserPermisosTabla table = new SicresUserPermisosTabla();

    try {
      if (logger.isDebugEnabled()) {
        logger.debug("Añadiendo scr_usrperms...");
      }

      tableInfo.setTableObject(table);
      tableInfo.setClassName(table.getClass().getName());
      tableInfo.setTablesMethod("getTableName");
      tableInfo.setColumnsMethod("getAllColumnNames");

      rowInfo.addRow(this);
      rowInfo.setClassName(this.getClass().getName());
      rowInfo.setValuesMethod("insert");
      rowsInfo.add(rowInfo);

      DynamicFns.insert(db, tableInfo, rowsInfo);
      if (logger.isDebugEnabled()) {
        logger.debug("scr_usrperms añadida.");
      }
    } catch (Exception e) {
      logger.error("Error añadiendo scr_usrperms.", e);
      throw new ISicresRPAdminDAOException(ISicresRPAdminDAOException.SCR_USRPERMS_INSERT, e);
    }
  }
 /**
  * Execute an OS command and return the result of stdout.
  *
  * @param command Command to run
  * @return Returns output of the command in a string
  * @throws ReplicatorException Thrown if command execution fails
  */
 public String exec(String command) throws ReplicatorException {
   String[] osArray = {"sh", "-c", command};
   ProcessExecutor pe = new ProcessExecutor();
   pe.setCommands(osArray);
   if (logger.isDebugEnabled()) {
     logger.debug("Executing OS command: " + command);
   }
   pe.run();
   if (logger.isDebugEnabled()) {
     logger.debug("OS command stdout: " + pe.getStdout());
     logger.debug("OS command stderr: " + pe.getStderr());
     logger.debug("OS command exit value: " + pe.getExitValue());
   }
   if (!pe.isSuccessful()) {
     logger.error(
         "OS command failed: command="
             + command
             + " rc="
             + pe.getExitValue()
             + " stdout="
             + pe.getStdout()
             + " stderr="
             + pe.getStderr());
     throw new ReplicatorException("OS command failed: command=" + command);
   }
   return pe.getStdout();
 }
  /**
   * Creates a new {@link UML2VoidReturnParameter} instance.
   *
   * @param dslOperation the {@link org.eclipse.uml2.uml.Operation} that is adopted by this class.
   * @param factory The {@link UML2AdapterFactory} used to create nested elements.
   * @generated NOT
   */
  public UML2VoidReturnParameter(
      org.eclipse.uml2.uml.Operation dslOperation, UML2AdapterFactory factory) {

    /* Eventually log the entry into this method. */
    if (LOGGER.isDebugEnabled()) {
      String msg;

      msg = "UML2VoidReturnParameter("; // $NON-NLS-1$ //$NON-NLS-2$
      msg += "dslOperation = " + dslOperation; // $NON-NLS-1$ //$NON-NLS-2$
      msg += ", factory = " + factory; // $NON-NLS-1$ //$NON-NLS-2$
      msg += ") - enter"; // $NON-NLS-1$ //$NON-NLS-2$

      LOGGER.debug(msg);
    }
    // no else.

    /* Initialize adapted operation. */
    this.dslOperation = dslOperation;
    this.factory = factory;

    /* Eventually log the exit from this method. */
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("UML2Parameter() - exit"); // $NON-NLS-1$
    }
    // no else.
  }
  public ModelAndView searchProjects(
      HttpServletRequest request, HttpServletResponse response, ProjectVo command)
      throws Exception {

    if (logger.isDebugEnabled()) {
      logger.debug("searchProjects(HttpServletRequest, HttpServletResponse, ProjectVo) - start");
    }

    modelAndView = new ModelAndView("volunteer/viewProjectList"); // jsp page
    List<CodeLookupVo> projectCodeList =
        CodeLookupUtil.getCodeListByCategory(VMSConstants.PROJECT_STATUS);

    modelAndView.addObject("projectCodeList", projectCodeList);

    List<ProjectVo> projectList = projectManagementService.getProjectsbyProjectVo(command);
    logger.debug("The project size is" + projectList.size());
    modelAndView.addObject("projectList", projectList);
    modelAndView.addObject("command", command);

    PagedListHolder projectPagedListHolder = new PagedListHolder(projectList);
    if (!projectList.isEmpty()) {
      int page = ServletRequestUtils.getIntParameter(request, "p", 0);
      projectPagedListHolder.setPage(page);
      projectPagedListHolder.setPageSize(VMSConstants.MAX_PAGE_SIZE);
    }
    modelAndView.addObject("pagedListHolder", projectPagedListHolder);

    if (logger.isDebugEnabled()) {
      logger.debug("searchProjects(HttpServletRequest, HttpServletResponse, ProjectVo) - end");
    }
    return modelAndView;
  }
 /**
  * Gets the events fired from SynthesisQueue thread and it forwards them. to
  * ImplementationPlatform it also sets the appropriate flags
  *
  * @param event the event.
  */
 public void outputStatusChanged(final SynthesizedOutputEvent event) {
   if (event.isType(OutputStartedEvent.EVENT_TYPE)) {
     final OutputStartedEvent outputStartedEvent = (OutputStartedEvent) event;
     final SpeakableText startedSpeakable = outputStartedEvent.getSpeakable();
     if (LOGGER.isDebugEnabled()) {
       LOGGER.debug("output started " + startedSpeakable);
     }
     isBusy = true;
     fireOutputStarted(startedSpeakable);
   } else if (event.isType(OutputEndedEvent.EVENT_TYPE)) {
     final OutputEndedEvent outputEndedEvent = (OutputEndedEvent) event;
     final SpeakableText endedSpeakable = outputEndedEvent.getSpeakable();
     if (LOGGER.isDebugEnabled()) {
       LOGGER.debug("audio playing ended");
     }
     isBusy = false;
     fireOutputEnded(endedSpeakable);
   } else if (event.isType(QueueEmptyEvent.EVENT_TYPE)) {
     if (LOGGER.isDebugEnabled()) {
       LOGGER.debug("output queue is empty");
     }
     speakableQueueEmpty = true;
     fireQueueEmpty();
     synchronized (emptyLock) {
       emptyLock.notifyAll();
     }
   }
 }
  /**
   * @param sort, the column number to sort
   * @return the new xml string of the array sorted
   * @throws NumberFormatException
   *     <p>The sort of this array is cyclic : it begins by UNSORTED, then if the user click again
   *     the array will be <br>
   *     sorted ASCENDING, then DESCENDING, and finally UNSORTED.
   */
  private String sortColomn(String sort) throws NumberFormatException {
    if (tableModel != null && sorter != null) {
      int sortingColumn = new Integer(sort).intValue();
      int sortingStatus = -2;

      if (logger.isDebugEnabled()) {
        logger.debug("GetTableServlet: Sort column :" + sortingColumn);
      }
      if (sorter.getSortingStatus(sortingColumn) == TableSorter.ASCENDING) {
        for (int i = 0; i < sorter.getColumnCount(); i++) {
          sorter.setSortingStatus(i, TableSorter.NOT_SORTED);
        }
        sorter.setSortingStatus(sortingColumn, TableSorter.DESCENDING);
        sortingStatus = TableSorter.DESCENDING;
      } else if (sorter.getSortingStatus(sortingColumn) == TableSorter.DESCENDING) {
        for (int i = 0; i < sorter.getColumnCount(); i++) {
          sorter.setSortingStatus(i, TableSorter.NOT_SORTED);
        }
        sorter.setSortingStatus(sortingColumn, TableSorter.NOT_SORTED);
        sortingStatus = TableSorter.NOT_SORTED;
      } else if (sorter.getSortingStatus(sortingColumn) == TableSorter.NOT_SORTED) {
        for (int i = 0; i < sorter.getColumnCount(); i++) {
          sorter.setSortingStatus(i, TableSorter.NOT_SORTED);
        }
        sorter.setSortingStatus(sortingColumn, TableSorter.ASCENDING);
        sortingStatus = TableSorter.ASCENDING;
      }
      if (logger.isDebugEnabled()) {
        logger.debug("GetTableServlet: sorting status " + sortingStatus);
      }

      return toJSon(sortingColumn, sortingStatus);
    }
    return null;
  }
Example #9
0
 @Override
 public boolean equals(final Object obj) {
   try {
     if ((obj != null) && (obj instanceof FlurKey)) {
       final FlurKey other = (FlurKey) obj;
       if (((gemarkungsId != null)
               && (other.getGemarkungsId() != null)
               && gemarkungsId.equals(other.getGemarkungsId()))
           || ((gemarkungsId == null) && (other.getGemarkungsId() == null))) {
         if (LOG.isDebugEnabled()) {
           LOG.debug("Gemarkung stimmt überein");
         }
         if (((flurId != null) && (other.getFlurId() != null) && flurId.equals(other.getFlurId()))
             || ((flurId == null) && (other.getFlurId() == null))) {
           if (LOG.isDebugEnabled()) {
             LOG.debug("Alle Felder stimmen überein --> equals");
           }
           return true;
         }
       }
     }
     return false;
   } catch (Exception ex) {
     LOG.error("Fehler in equals Flurkey", ex);
   }
   return false;
 }
Example #10
0
 protected synchronized void doCancel() {
   if (isTerminated()) {
     if (LOG.isDebugEnabled()) {
       LOG.debug(
           "Receiving Cancel, but is already terminated. callID:"
               + (getSipSession() != null ? getSipSession().getCallId() : ""));
     }
   } else if (isNoAnswered()) {
     if (LOG.isDebugEnabled()) {
       LOG.debug(
           "Receiving Cancel, not answered. terminating, callID"
               + (getSipSession() != null ? getSipSession().getCallId() : ""));
     }
     if (_joinDelegate != null) {
       _joinDelegate.done(JoinCompleteEvent.Cause.CANCELED, new CanceledException());
     }
     this.setSIPCallState(SIPCall.State.DISCONNECTED);
     terminate(CallCompleteEvent.Cause.CANCEL, null, null);
   } else {
     if (LOG.isDebugEnabled()) {
       LOG.debug(
           "Receiving Cancel, but is already answered. terminating, callID"
               + (getSipSession() != null ? getSipSession().getCallId() : ""));
     }
     this.setSIPCallState(SIPCall.State.DISCONNECTED);
     terminate(CallCompleteEvent.Cause.CANCEL, null, null);
   }
 }
 /* (non-Javadoc)
  * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
  */
 @Override
 public boolean performDrop(Object data) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("performDrop...");
   }
   boolean success = false;
   try {
     for (DropPerformer adapter : performerSet) {
       if (adapter.isActive()) {
         if (adapter.performDrop(data, getCurrentTarget(), getViewer())) {
           success = true;
           if (LOG.isDebugEnabled()) {
             LOG.debug("performDrop, success: " + adapter);
           }
         }
       } else if (LOG.isDebugEnabled()) {
         LOG.debug("performDrop, adapter is not active: " + adapter);
       }
     }
   } catch (RuntimeException e) {
     LOG.error("Error while performing drop.", e);
     throw e;
   }
   return success;
 }
  @Override
  public Status investigate(final long hostId) {
    final HostVO host = _hostDao.findById(hostId);
    if (host == null) {
      return null;
    }

    final Enumeration<Investigator> en = _investigators.enumeration();
    Status hostState = null;
    Investigator investigator = null;
    while (en.hasMoreElements()) {
      investigator = en.nextElement();
      hostState = investigator.isAgentAlive(host);
      if (hostState != null) {
        if (s_logger.isDebugEnabled()) {
          s_logger.debug(
              investigator.getName()
                  + " was able to determine host "
                  + hostId
                  + " is in "
                  + hostState.toString());
        }
        return hostState;
      }
      if (s_logger.isDebugEnabled()) {
        s_logger.debug(
            investigator.getName() + " unable to determine the state of the host.  Moving on.");
      }
    }

    return null;
  }
  protected Status testIpAddress(Long hostId, String testHostIp) {
    try {
      Answer pingTestAnswer = _agentMgr.send(hostId, new PingTestCommand(testHostIp));
      if (pingTestAnswer == null) {
        if (s_logger.isDebugEnabled()) {
          s_logger.debug("host (" + testHostIp + ") returns null answer");
        }
        return null;
      }

      if (pingTestAnswer.getResult()) {
        if (s_logger.isDebugEnabled()) {
          s_logger.debug(
              "host (" + testHostIp + ") has been successfully pinged, returning that host is up");
        }
        // computing host is available, but could not reach agent, return false
        return Status.Up;
      } else {
        if (s_logger.isDebugEnabled()) {
          s_logger.debug(
              "host (" + testHostIp + ") cannot be pinged, returning null ('I don't know')");
        }
        return null;
      }
    } catch (AgentUnavailableException e) {
      return null;
    } catch (OperationTimedoutException e) {
      return null;
    }
  }
Example #14
0
 @Override
 public boolean waitMsecs(int msecs) {
   if (msecs < 0) {
     throw new RuntimeException("waitMsecs: msecs cannot be negative!");
   }
   long maxMsecs = time.getMilliseconds() + msecs;
   int curMsecTimeout = 0;
   lock.lock();
   try {
     while (!eventOccurred) {
       curMsecTimeout = Math.min(msecs, msecPeriod);
       if (LOG.isDebugEnabled()) {
         LOG.debug("waitMsecs: Wait for " + curMsecTimeout);
       }
       try {
         boolean signaled = cond.await(curMsecTimeout, TimeUnit.MILLISECONDS);
         if (LOG.isDebugEnabled()) {
           LOG.debug("waitMsecs: Got timed signaled of " + signaled);
         }
       } catch (InterruptedException e) {
         throw new IllegalStateException(
             "waitMsecs: Caught interrupted " + "exception on cond.await() " + curMsecTimeout, e);
       }
       if (time.getMilliseconds() > maxMsecs) {
         return false;
       }
       msecs = Math.max(0, msecs - curMsecTimeout);
       progressable.progress(); // go around again
     }
   } finally {
     lock.unlock();
   }
   return true;
 }
Example #15
0
  /**
   * Function to try and obtain a handler using the name of the current SOAP service and operation.
   *
   * @param opName the name of the operation
   * @return OperationHandler to handle the operation
   * @throws AxisFault
   */
  private OperationHandler getHandler(String serviceName, String operationName) {
    if (serviceName == null) {
      if (log.isDebugEnabled()) {
        log.debug("Service Name was null!");
      }

      return null;
    }

    if (operationName == null) {
      if (log.isDebugEnabled()) {
        log.debug("Operation Name was null!");
      }

      return null;
    }

    Map<String, OperationHandler> handlers = serviceHandlers.get(serviceName);
    if (handlers == null) {
      if (log.isDebugEnabled()) {
        log.debug("No Service Handlers found for: " + serviceName);
      }

      return null;
    }

    OperationHandler handler = handlers.get(operationName);
    if (handler == null) {
      if (log.isDebugEnabled()) {
        log.debug("Handler not found for: " + serviceName + "/" + operationName);
      }
    }

    return handler;
  }
Example #16
0
  protected DomainRouterVO waitRouter(final DomainRouterVO router) {
    DomainRouterVO vm = _routerDao.findById(router.getId());

    if (s_logger.isDebugEnabled()) {
      s_logger.debug("Router " + router.getInstanceName() + " is not fully up yet, we will wait");
    }
    while (vm.getState() == State.Starting) {
      try {
        Thread.sleep(1000);
      } catch (final InterruptedException e) {
      }

      // reload to get the latest state info
      vm = _routerDao.findById(router.getId());
    }

    if (vm.getState() == State.Running) {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("Router " + router.getInstanceName() + " is now fully up");
      }

      return router;
    }

    s_logger.warn(
        "Router " + router.getInstanceName() + " failed to start. current state: " + vm.getState());
    return null;
  }
 private static PirsfDatRecord parseSubFamilyLine(String line) {
   PirsfDatRecord instance = null;
   String[] chunks = line.split(" ");
   for (int i = 0; i < chunks.length; i++) {
     if (i == 0) {
       if (chunks[i].length() > 1) {
         final String modelAccession = chunks[i].substring(1);
         instance = new PirsfDatRecord(modelAccession);
         if (LOGGER.isDebugEnabled()) {
           LOGGER.debug("Found a new model accession with sub families: " + modelAccession);
         }
       }
     } else if (i > 1) {
       final String subfamily = chunks[i];
       if (LOGGER.isDebugEnabled()) {
         LOGGER.debug(
             "Found a new subfamily named "
                 + subfamily
                 + " for model accession: "
                 + instance.getModelAccession());
       }
       instance.addSubFamily(subfamily);
     }
   }
   return instance;
 }
Example #18
0
 public static synchronized Properties getConfig() {
   if (config == null) {
     config = new Properties();
     InputStream is = null;
     try {
       is = DAOConfig.class.getClassLoader().getResourceAsStream("dao_config.properties");
       config.load(is);
     } catch (IOException e) {
       if (log.isDebugEnabled()) {
         log.debug(e.getMessage());
       }
       throw new RuntimeException("failed to read dao configuration file");
     } finally {
       if (is != null) {
         try {
           is.close();
         } catch (IOException e) {
           if (log.isDebugEnabled()) {
             log.debug(e.getMessage());
           }
         }
       }
     }
   }
   return config;
 }
  public ModelAndView postFeedback(
      HttpServletRequest request, HttpServletResponse response, ProjectFeedbackVo feedbackVo)
      throws Exception {
    if (logger.isDebugEnabled()) {
      logger.debug(
          "postExperienceAndFb(HttpServletRequest, HttpServletResponse, ProjectInfoVo) - start");
    }

    ProjectVo projectVo = (ProjectVo) modelAndView.getModel().get("projectVo");

    modelAndView = new ModelAndView("volunteer/viewProject");

    if (!StringUtil.isNullOrEmpty(feedbackVo.getTitle())) {

      feedbackVo.setPrjId(projectVo.getPrjId());
      projectFeedbackService.createProjectFeedback(feedbackVo);
      modelAndView.addObject(
          "riMsg",
          Messages.getString("message.common.submitreview.msg", new String[] {"Project Feedback"}));
    }
    List<ProjectMemberVo> memberList =
        memberManagementService.getMemberListbyProject(projectVo.getPrjId());

    List<ProjectExperienceVo> experienceList =
        projectExperienceService.getProjectExperienceListbyProjectId(projectVo.getPrjId());
    List<ProjectFeedbackVo> feedbackList =
        projectFeedbackService.getProjectFeedbackListbyProjectId(projectVo.getPrjId());

    PagedListHolder feedbackPagedListHolder = new PagedListHolder(feedbackList);

    if (!feedbackList.isEmpty()) {
      int page = ServletRequestUtils.getIntParameter(request, "p1", 0);
      feedbackPagedListHolder.setPage(page);
      feedbackPagedListHolder.setPageSize(100);
    }

    PagedListHolder exPagedListHolder = new PagedListHolder(experienceList);
    if (!experienceList.isEmpty()) {
      int page = ServletRequestUtils.getIntParameter(request, "p2", 0);
      exPagedListHolder.setPage(page);
      exPagedListHolder.setPageSize(100);
    }

    modelAndView.addObject("fbPagedListHolder", feedbackPagedListHolder);

    modelAndView.addObject("exPagedListHolder", exPagedListHolder);

    modelAndView.addObject("memberList", memberList);
    modelAndView.addObject("experienceList", experienceList);
    modelAndView.addObject("feedbackList", feedbackList);
    modelAndView.addObject("projectVo", projectVo);
    modelAndView.addObject("feedbackVo", new ProjectFeedbackVo());
    modelAndView.addObject("experienceVo", new ProjectExperienceVo());

    if (logger.isDebugEnabled()) {
      logger.debug(
          "postExperienceAndFb(HttpServletRequest, HttpServletResponse, ProjectInfoVo) - end");
    }
    return modelAndView;
  }
  public Integer getRegisterDeptOfic(String guid, String entidad) throws SecurityException {
    Transaction tran = null;
    Integer deptId = null;
    try {
      Session session = HibernateUtil.currentSession(entidad);
      // tran = session.beginTransaction();

      // Obtener el grupo ldap de la tabla de grupos
      List list = ISicresQueries.getUserLdapPgrp(session, guid);
      if (list != null && !list.isEmpty()) {
        Iuserldapgrphdr udeptGrpHdr = (Iuserldapgrphdr) list.get(0);
        if (log.isDebugEnabled()) {
          log.debug(" Iuserldapgrphdr [" + udeptGrpHdr + "] con el log [" + log + "]");
        }

        // Obtener el departamento invesdoc asociado al grupo ldap
        list = ISicresQueries.getUserDeptHdr(session, udeptGrpHdr.getId());
        if (list != null && !list.isEmpty()) {
          Iuserdepthdr udeptHdr = (Iuserdepthdr) list.get(0);
          if (log.isDebugEnabled()) {
            log.debug(" Iuserdepthdr [" + udeptHdr + "] con el log [" + log + "]");
          }
          deptId = udeptHdr.getId();
        }
      }
      // HibernateUtil.commitTransaction(tran);
    } catch (Exception e) {
      // HibernateUtil.rollbackTransaction(tran);
      log.error("Impossible to verify user with guid[" + guid + "]", e);
      throw new SecurityException(SecurityException.ERROR_USER_NOTFOUND);
    } /*
       * finally { HibernateUtil.closeSession(); }
       */
    return deptId;
  }
  private void validateConfig() throws ConfigXMLParsingException {
    if (logger.isDebugEnabled()) {
      logger.debug("validateConfig() - start"); // $NON-NLS-1$
    }

    assertConfigForTag(localEntityId == null, "LOCAL_ENTITY_ID");
    assertConfigForTag(postAttrSAML == null, "SAML_POST_ATTRIBUTE_NAME");
    if (SAMLTokenEncrypted) validateSAMLDecryptorKey("SAML_TOKEN_ENCRYPTION");
    validateDecryptKey("SAML_ENCRYPTED_ASSERTION_DECRYPTOR");
    // validateSignerKeyKey("SAML_SIGNATURE_VERIFIER");
    assertConfigForTag(metadataProvider == null, "SAML_METADATA_PROVIDER");
    assertConfigForTag(idpURL == null, "IDP_URL");
    assertConfigForTag(verifySignature == null, "ASSERTION_SIGNATURE_VERIFICATION");

    if (contextDataExtractor != null) {
      assertConfigForAttribute(contextDataStore == null, "ATTRIBUTE_NAME", "STOREAS");
      assertConfigForAttribute(
          contextDataStore != ContextDataStoreType.none && contextDataStoreParam == null,
          "ATTRIBUTE_NAME",
          "STOREIN");
    }

    createDefaultInvalidSessionHandler(invalidSessionHandler == null);
    createDefaultErrorHandler(errorHandler == null);

    if (logger.isDebugEnabled()) {
      logger.debug("validateConfig() - end"); // $NON-NLS-1$
    }
  }
  /**
   * return the first playable for this session
   *
   * @return the first Playable
   */
  protected Playable getFirstPlayable() {
    if (logger.isDebugEnabled()) {
      logger.debug("calling getFirstPlayable()");
    }
    Playable playable = null;

    PlayList playlist = this.getPlayList();

    if (playlist != null) {
      if (playlist.size() > 0) {
        Object o = playlist.get(0);

        if (o instanceof Playable) {
          playable = (Playable) o;
        }
      } else {
        if (logger.isDebugEnabled()) {
          logger.debug(
              "the size of the playlist is " + playlist.size() + " --> could not provide first");
        }
      }
    }
    if (logger.isDebugEnabled()) {
      logger.debug("end of calling getFirstPlayable() returns " + playable);
    }

    return playable;
  }
 public Application get(final URI uri) throws InvalidApplicationException, RedirectException {
   Application app = getCached(uri);
   if (LOG.isDebugEnabled()) {
     LOG.debug(
         toString() + " found app=" + app + " for url=" + uri + ",_cache.size=" + _cache.size());
   }
   if (app == null) {
     app = findApplication(uri);
     putCached(uri, app);
     if (LOG.isDebugEnabled()) {
       LOG.debug(
           toString()
               + " cached app="
               + app
               + " for url="
               + uri
               + ",_cache.size="
               + _cache.size());
     }
   } else {
     Utils.setLogContext(app, null);
     LOG.info(app + " has been found.");
   }
   return app;
 }
 @Override
 public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) {
   if (log.isDebugEnabled()) log.debug("begin setup");
   try {
     super.setup(resolver, objectModel, src, par);
     ContextManager cm = (ContextManager) this.manager.lookup(ContextManager.ROLE);
     try {
       if (cm.hasSessionContext()) {
         cm.deleteContext("authentication");
       }
     } catch (Exception exe) {
     }
     userid = par.getParameter("username", null);
     password = par.getParameter("password", null);
     try {
       String jaasRealmTmp = par.getParameter("jaasRealm", null);
       if (jaasRealmTmp != null && !jaasRealmTmp.equalsIgnoreCase("")) {
         jaasRealm = jaasRealmTmp;
       }
     } catch (Exception se) {
     }
     try {
       String toUpper = par.getParameter("toUpperCase", null);
       if (toUpper != null && !toUpper.equalsIgnoreCase("true")) {
         userid = userid.toUpperCase();
       }
     } catch (Exception se) {
     }
     if (log.isDebugEnabled()) log.debug("trying to login as " + userid + " on the webpage");
   } catch (Exception ex) {
     new ProcessingException(ex.getMessage());
   }
   if (log.isDebugEnabled()) log.debug("end setup");
 }
  public List<TemplateNode> getChildren(NodeRef node, String types) {
    List<TemplateNode> results = new ArrayList<TemplateNode>();
    PagedResults pagedDocs = queryChildren(node, types);

    CMISResultSet resultSet = (CMISResultSet) pagedDocs.getResult();

    for (NodeRef nodeRef : resultSet.getNodeRefs()) {
      TemplateNode tnode =
          new TemplateNode(nodeRef, serviceRegistry, imageResolver.getImageResolver());
      if (tnode.getIsDocument()) {
        if (logger.isDebugEnabled()) {
          logger.debug("add result :" + tnode.getNodeRef());
        }
        results.add(tnode);
      }
    }

    PagedResults pagedFolders = queryChildren(node, FOLDER);
    CMISResultSet resultSetFolders = (CMISResultSet) pagedFolders.getResult();
    for (NodeRef nodeRef : resultSetFolders.getNodeRefs()) {
      // folder
      if (logger.isDebugEnabled()) {
        logger.debug("search in folder ..." + nodeRef);
      }
      List<TemplateNode> tmp = getChildren(nodeRef, types);
      results.addAll(tmp);
    }
    return results;
  }
Example #26
0
  public Object getDAO(String key, Connection conn) throws FactoryException {
    if (logger.isDebugEnabled()) {
      logger.debug("getDAO(String, Connection) - start");
    }

    IDAO dao = null;

    try {
      if (null != key) {
        Class cls = (Class) this.daoInstances.get(key);
        if (null != cls) {
          dao = (IDAO) ClassHelper.newInstance(cls.getName());
          if (null != conn && !conn.isClosed()) dao.setConnection(conn);
        }
      }
    } catch (Exception e) {
      logger.error("getDAO(String, Connection)", e);

      FactoryException fe = new FactoryException(e);
      throw fe;
    }
    if (null == dao) {
      FactoryException fe = new FactoryException("申请的dao没有注册到系统中�?");
      throw fe;
    }

    if (logger.isDebugEnabled()) {
      logger.debug("getDAO(String, Connection) - end");
    }
    return dao;
  }
  public void load(int identificador, DbConnection db) throws ISicresRPAdminDAOException {
    DynamicTable tableInfo = new DynamicTable();
    DynamicRows rowsInfo = new DynamicRows();
    DynamicRow rowInfo = new DynamicRow();
    SicresUserPermisosTabla table = new SicresUserPermisosTabla();

    if (logger.isDebugEnabled()) {
      logger.debug("Obteniendo datos de scr_usrperms...");
    }

    try {
      tableInfo.setTableObject(table);
      tableInfo.setClassName(table.getClass().getName());
      tableInfo.setTablesMethod("getTableName");
      tableInfo.setColumnsMethod("getAllColumnNames");

      rowInfo.addRow(this);
      rowInfo.setClassName(this.getClass().getName());
      rowInfo.setValuesMethod("loadAllValues");
      rowsInfo.add(rowInfo);

      if (!DynamicFns.select(db, table.getById(identificador), tableInfo, rowsInfo)) {
        throw new ISicresRPAdminDAOException(ISicresRPAdminDAOException.SCR_USRPERMS_NOT_FOUND);
      }
      if (logger.isDebugEnabled()) {
        logger.debug("Datos de scr_usrperms obtenidos.");
      }
    } catch (Exception e) {
      if (e instanceof ISicresRPAdminDAOException)
        logger.warn("No se ha encontrado fila en scr_usrperms");
      else logger.error("Error obteniendo datos de scr_usrperms");
      throw new ISicresRPAdminDAOException(ISicresRPAdminDAOException.EXC_GENERIC_EXCEPCION, e);
    }
  }
Example #28
0
  public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
      throws CoreException {
    beanRef = (String) data;

    if (logger.isDebugEnabled()) {
      logger.debug(
          "Initializing bean '" + beanRef + "' for extension " + config.getAttribute("id"));
    }

    try {
      bean = getContainerInstance().getBean(beanRef);
      if (logger.isDebugEnabled()) {
        logger.debug("Got bean of class '" + bean.getClass().getName() + "'");
      }
    } catch (Exception e) {
      logger.error(
          "Unable to get bean instance for bean id '"
              + beanRef
              + "' of class '"
              + (bean != null ? bean.getClass().getName() : "n/a")
              + "'",
          e);
      ForceExceptionUtils.throwNewCoreException(e);
    }
  }
 /**
  * This method is called to execute the action that the StepInstance must perform.
  *
  * @param stepInstance containing the parameters for executing.
  * @param temporaryFileDirectory
  * @throws Exception could be anything thrown by the execute method.
  */
 @Override
 public void execute(StepInstance stepInstance, String temporaryFileDirectory) {
   // Retrieve raw results for protein range.
   Map<String, RawProtein<PfamHmmer3RawMatch>> rawMatches =
       rawMatchDAO.getRawMatchesForProteinIdsInRange(
           stepInstance.getBottomProtein(),
           stepInstance.getTopProtein(),
           getSignatureLibraryRelease());
   if (LOGGER.isDebugEnabled()) {
     LOGGER.debug("PfamA: Retrieved " + rawMatches.size() + " proteins to post-process.");
     int matchCount = 0;
     for (final RawProtein rawProtein : rawMatches.values()) {
       matchCount += rawProtein.getMatches().size();
     }
     LOGGER.debug("PfamA: A total of " + matchCount + " raw matches.");
   }
   // Post process
   try {
     Map<String, RawProtein<PfamHmmer3RawMatch>> filteredMatches =
         getPostProcessor().process(rawMatches);
     if (LOGGER.isDebugEnabled()) {
       LOGGER.debug(
           "PfamA: " + filteredMatches.size() + " proteins passed through post processing.");
       int matchCount = 0;
       for (final RawProtein rawProtein : filteredMatches.values()) {
         matchCount += rawProtein.getMatches().size();
       }
       LOGGER.debug("PfamA: A total of " + matchCount + " matches PASSED.");
     }
     filteredMatchDAO.persist(filteredMatches.values());
   } catch (IOException e) {
     throw new IllegalStateException(
         "IOException thrown when attempting to post process filtered matches.", e);
   }
 }
Example #30
0
  /**
   * Resolve a constraint against an RDF/XML document.
   *
   * <p>Resolution is by filtration of a URL stream, and thus very slow.
   */
  public Resolution resolve(Constraint constraint) throws QueryException {
    if (logger.isDebugEnabled()) {
      logger.debug("Resolve " + constraint);
    }

    // check the model
    ConstraintElement modelElement = constraint.getModel();
    if (modelElement instanceof Variable) {
      if (logger.isDebugEnabled()) logger.debug("Ignoring solutions for " + constraint);
      return new EmptyResolution(constraint, false);
    } else if (!(modelElement instanceof LocalNode)) {
      throw new QueryException("Failed to localize Lucene Graph before resolution " + constraint);
    }

    /* temporary hack because $_from is not resolved before transformation occurs, and hence
     * no LuceneConstraint's are created when doing ... from <lucene-model> where ... .
     */
    if (!(constraint instanceof LuceneConstraint)) {
      constraint = new LuceneConstraint(constraint);
    }

    // generate the tuples
    try {
      FullTextStringIndex stringIndex =
          getFullTextStringIndex(((LocalNode) modelElement).getValue());
      return new FullTextStringIndexTuples(
          stringIndex, (LuceneConstraint) constraint, resolverSession);
    } catch (IOException ioe) {
      throw new QueryException("Failed to open string index", ioe);
    } catch (FullTextStringIndexException ef) {
      throw new QueryException("Query failed against string index\n" + new StackTrace(ef));
    } catch (TuplesException te) {
      throw new QueryException("Failed to query string index", te);
    }
  }