public CommandResult exec(String[] pCmd, String[] pEnv, File dir, Writer pOut, Writer pErr) throws IOException, InterruptedException { int out = 0; String pCmdString = ArrayUtils.toString(pCmd); if (_log.isInfoEnabled()) _log.info( "Executing '" + pCmdString + "' with Environment '" + ArrayUtils.toString(pEnv) + "'"); StopWatch clock = new StopWatch(); clock.start(); try { process = Runtime.getRuntime().exec(pCmd, pEnv, dir); out = handleProcess(process, pCmdString, pOut, pErr, _outputList, sig_interrupt); } finally { this.cleanUpProcess(); clock.stop(); if (_log.isInfoEnabled()) _log.info("'" + pCmdString + "' completed in " + clock.getTime() + " ms"); } if (sig_interrupt.getValue() == true) { out = -9999; } CommandResult result = new CommandResult(pCmdString, out, pOut.toString(), pErr.toString()); return result; }
/** * Load an out-of-core partition in memory. * * @param partitionId Partition id */ private void loadPartition(Integer partitionId) { if (loadedPartition != null) { if (loadedPartition.getId() == partitionId) { return; } if (LOG.isInfoEnabled()) { LOG.info("loadPartition: moving partition " + loadedPartition.getId() + " out of core"); } try { writePartition(loadedPartition); onDiskPartitions.put(loadedPartition.getId(), loadedPartition.getVertices().size()); loadedPartition = null; } catch (IOException e) { throw new IllegalStateException( "loadPartition: failed writing " + "partition " + loadedPartition.getId() + " to disk", e); } } if (LOG.isInfoEnabled()) { LOG.info("loadPartition: loading partition " + partitionId + " in memory"); } try { loadedPartition = readPartition(partitionId); } catch (IOException e) { throw new IllegalStateException( "loadPartition: failed reading " + "partition " + partitionId + " from disk"); } }
@Override protected String execute(HttpRequest request, ResponseHandler<String> responseHandler) throws IOException { if (logger.isInfoEnabled()) { logger.info("Going to send a http message:" + request.getRequestLine()); } String response = null; try { response = httpClient.execute((HttpUriRequest) request, responseHandler); } catch (Exception e) { if (e instanceof HttpHostConnectException) { throw new IOException("ERQ9900001"); } else if (e instanceof NoHttpResponseException || e instanceof SocketTimeoutException) { throw new IOException("ERS9900001"); } logger.error("The communication to the http endpoint faild...", e); throw new IOException("The communication to the http endpoint faild..."); } if (logger.isInfoEnabled()) { logger.info("Recieved a http message:" + response); } return response; }
/** * Ingest. * * @param foxml the foxml * @param label the label * @param uuid the uuid * @param model the model * @param topLevelUuid the top level uuid * @param inputDirPath the input dir path * @return true, if successful */ public static boolean ingest( String foxml, String label, String uuid, String model, String topLevelUuid, String inputDirPath) { if (uuid != null && !uuid.startsWith(Constants.FEDORA_UUID_PREFIX)) { uuid = Constants.FEDORA_UUID_PREFIX + uuid; } if (LOGGER.isInfoEnabled()) { LOGGER.info( "Ingesting the digital object with PID" + (!uuid.contains("uuid:") ? " uuid:" : " ") + uuid + " label:" + label + ", model: " + model); } String login = config.getFedoraLogin(); String password = config.getFedoraPassword(); String url = config.getFedoraHost() + "/objects/new"; boolean success = RESTHelper.post(url, foxml, login, password, false); if (LOGGER.isInfoEnabled() && success) { LOGGER.info("Object ingested -- uuid:" + uuid + " label: " + label + ", model: " + model); } if (topLevelUuid != null && inputDirPath != null && INGEST_LOGGER.isInfoEnabled()) { INGEST_LOGGER.info(String.format("%s %16s %s", uuid, model, label)); } if (success) { if (topLevelUuid != null && inputDirPath != null) { try { if (!uuid.equals(topLevelUuid)) { // TODO-MR // digitalObjectDAO.insertNewDigitalObject(uuid, // model, // label, // inputDirPath, // topLevelUuid, // false); } else { digitalObjectDAO.updateTopObjectTime(uuid); } } catch (DatabaseException e) { LOGGER.error("DB ERROR!!!: " + e.getMessage() + ": " + e); e.printStackTrace(); } } } else { LOGGER.error( "Unable to ingest object uuid:" + uuid + " label: " + label + ", model: " + model); } return success; }
/** * Method execute * * @param mapping * @param form * @param request * @param response * @return ActionForward */ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ActionMessages errors = new ActionMessages(); if (log.isInfoEnabled()) { log.info("FiltrarCliente1: Antes de entrar en la base de datos"); } HttpSession session = request.getSession(true); Consultar consultar = CreadorConsultar.CreaConsultar("cliente"); Vector listaClientes = consultar.filtrarClientes(form); if (listaClientes.size() == 0) { if (log.isInfoEnabled()) { log.info("FiltrarCliente 2: Ha habido un error en la búsqueda en la bbdd"); } errors.add("filtrarCliente", new ActionMessage("errors.listacliente.bbdd")); saveErrors(request, errors); return (mapping.findForward("error")); } else { if (log.isInfoEnabled()) { log.info("FiltrarCliente 3: Se ha realizado la busqueda con éxito"); } session.setAttribute("listaClientes", listaClientes); return mapping.findForward("exito"); } }
public void insert() throws RowExistsException { if (milog.isInfoEnabled()) { milog.info("Telefono de: " + telefono.idGeneral); } try { Connection conn = ConnectionManager.getConection(); Statement stmt = conn.createStatement(); ResultSet rs = null; StringBuffer sqlString = new StringBuffer("INSERT INTO " + nombreTabla); sqlString.append(" VALUES (" + MysqlUtils.toMysqlString(telefono.getIdGeneral()) + ", "); sqlString.append(MysqlUtils.toMysqlString(telefono.getDescTelefono()) + ", "); sqlString.append(MysqlUtils.toMysqlString(telefono.getTelefono()) + ", "); sqlString.append(MysqlUtils.toMysqlString(telefono.getTelefono2()) + ")"); if (milog.isInfoEnabled()) { milog.info("comando sql: " + sqlString); } stmt.execute(sqlString.toString()); } catch (Exception ex) { if (milog.isInfoEnabled()) { milog.info("error: " + ex.toString()); } throw new RowExistsException(); } }
public void initParam() { if (logger.isInfoEnabled()) { logger.info("**************卡库不平分析线程初始化**************"); // $NON-NLS-1$ } try { Session session = HibernateSessionFactory.currentSession(); Query queryTime = session.createQuery( "from MapAnalysisPoint as point where point.analysisname=:analysisName"); queryTime.setString("analysisName", "UNBALANCE_ERROR"); Iterator iterTime = queryTime.iterate(); if (iterTime.hasNext()) { MapAnalysisPoint mapAnalysisPoint = (MapAnalysisPoint) iterTime.next(); this.startTime = mapAnalysisPoint.getAnalysispoint(); } if (!"20050101000000".equals(this.startTime)) { this.endTime = DateUtil.getNewTime(startTime, doubleCycle); } else { this.endTime = DateUtil.getNow(); this.startTime = DateUtil.getNewTime(this.endTime, -doubleCycle); } } catch (HibernateException e) { logger.error("卡库不平分析线程初始化失败!", e); // $NON-NLS-1$ } finally { HibernateSessionFactory.closeSession(); } if (logger.isInfoEnabled()) { logger.info("**************卡库不平分析线程初始化成功**************"); // $NON-NLS-1$ } }
@Override public FormatInfo process(String templatePath, ImageFormat format, String templateName) throws InternalErrorException { if (format != null) { if (s_logger.isInfoEnabled()) { s_logger.info("We currently don't handle conversion from " + format + " to OVA."); } return null; } s_logger.info( "Template processing. templatePath: " + templatePath + ", templateName: " + templateName); String templateFilePath = templatePath + File.separator + templateName + "." + ImageFormat.OVA.getFileExtension(); if (!_storage.exists(templateFilePath)) { if (s_logger.isInfoEnabled()) { s_logger.info("Unable to find the vmware template file: " + templateFilePath); } return null; } s_logger.info( "Template processing - untar OVA package. templatePath: " + templatePath + ", templateName: " + templateName); String templateFileFullPath = templatePath + File.separator + templateName + "." + ImageFormat.OVA.getFileExtension(); File templateFile = new File(templateFileFullPath); Script command = new Script("tar", 0, s_logger); command.add("--no-same-owner"); command.add("-xf", templateFileFullPath); command.setWorkDir(templateFile.getParent()); String result = command.execute(); if (result != null) { s_logger.info( "failed to untar OVA package due to " + result + ". templatePath: " + templatePath + ", templateName: " + templateName); throw new InternalErrorException("failed to untar OVA package"); } FormatInfo info = new FormatInfo(); info.format = ImageFormat.OVA; info.filename = templateName + "." + ImageFormat.OVA.getFileExtension(); info.size = _storage.getSize(templateFilePath); info.virtualSize = getTemplateVirtualSize(templatePath, info.filename); // delete original OVA file // templateFile.delete(); return info; }
public static ContainerConfig loadContainerConfiguration() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, KeyStoreException, CertificateException, SecurityException, SignatureException, IOException { ValidityTools.checkAccessibilityOfFiles( Main.DEFAULT_GSN_LOG4J_PROPERTIES, WrappersUtil.DEFAULT_WRAPPER_PROPERTIES_FILE, Main.DEFAULT_GSN_CONF_FILE); ValidityTools.checkAccessibilityOfDirs(Main.DEFAULT_VIRTUAL_SENSOR_DIRECTORY); PropertyConfigurator.configure(Main.DEFAULT_GSN_LOG4J_PROPERTIES); ContainerConfig toReturn = null; try { toReturn = loadContainerConfig(DEFAULT_GSN_CONF_FILE); wrappers = WrappersUtil.loadWrappers(new HashMap<String, Class<?>>()); if (logger.isInfoEnabled()) logger.info( new StringBuilder() .append("Loading wrappers.properties at : ") .append(WrappersUtil.DEFAULT_WRAPPER_PROPERTIES_FILE) .toString()); if (logger.isInfoEnabled()) logger.info("Wrappers initialization ..."); } catch (JiBXException e) { logger.error(e.getMessage()); logger.error( new StringBuilder() .append("Can't parse the GSN configuration file : conf/gsn.xml") .toString()); logger.error( "Please check the syntax of the file to be sure it is compatible with the requirements."); logger.error("You can find a sample configuration file from the GSN release."); if (logger.isDebugEnabled()) logger.debug(e.getMessage(), e); System.exit(1); } catch (FileNotFoundException e) { logger.error( new StringBuilder() .append("The the configuration file : conf/gsn.xml") .append(" doesn't exist.") .toString()); logger.error(e.getMessage()); logger.error("Check the path of the configuration file and try again."); if (logger.isDebugEnabled()) logger.debug(e.getMessage(), e); System.exit(1); } catch (ClassNotFoundException e) { logger.error( "The file wrapper.properties refers to one or more classes which don't exist in the classpath"); logger.error(e.getMessage(), e); System.exit(1); } catch (Exception ex) { logger.error(ex.getMessage(), ex); } finally { return toReturn; } }
/** * @see * org.kuali.kfs.coa.service.PriorYearOrganizationService#populatePriorYearOrganizationFromCurrent() */ public void populatePriorYearOrganizationsFromCurrent() { int purgedCount = priorYearOrganizationDao.purgePriorYearOrganizations(); if (LOG.isInfoEnabled()) { LOG.info("number of prior year organizations purged : " + purgedCount); } int copiedCount = priorYearOrganizationDao.copyCurrentOrganizationsToPriorYearTable(); if (LOG.isInfoEnabled()) { LOG.info("number of current year organizations copied to prior year : " + copiedCount); } }
// @Override public FactorsList<C> baseFactorsAbsoluteSquarefree(GenPolynomial<C> P) { if (P == null) { throw new RuntimeException(this.getClass().getName() + " P == null"); } List<GenPolynomial<C>> factors = new ArrayList<GenPolynomial<C>>(); if (P.isZERO()) { return new FactorsList<C>(P, factors); } // System.out.println("\nP_base_sqf = " + P); GenPolynomialRing<C> pfac = P.ring; // K[x] if (pfac.nvar > 1) { // System.out.println("facs_base_sqf: univ"); throw new RuntimeException("only for univariate polynomials"); } if (!pfac.coFac.isField()) { // System.out.println("facs_base_sqf: field"); throw new RuntimeException("only for field coefficients"); } if (P.degree(0) <= 1) { factors.add(P); return new FactorsList<C>(P, factors); } // factor over K (=C) List<GenPolynomial<C>> facs = baseFactorsSquarefree(P); // System.out.println("facs_base_irred = " + facs); if (debug && !isFactorization(P, facs)) { throw new RuntimeException("isFactorization = false"); } if (logger.isInfoEnabled()) { logger.info("all K factors = " + facs); // Q[X] // System.out.println("\nall K factors = " + facs); // Q[X] } // factor over K(alpha) List<Factors<C>> afactors = new ArrayList<Factors<C>>(); for (GenPolynomial<C> p : facs) { // System.out.println("facs_base_sqf_p = " + p); if (p.degree(0) <= 1) { factors.add(p); } else { Factors<C> afacs = baseFactorsAbsoluteIrreducible(p); // System.out.println("afacs_base_sqf = " + afacs); if (logger.isInfoEnabled()) { logger.info("K(alpha) factors = " + afacs); // K(alpha)[X] } afactors.add(afacs); } } // System.out.println("K(alpha) factors = " + factors); return new FactorsList<C>(P, factors, afactors); }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { if (s_logger.isInfoEnabled()) s_logger.info("Configure VmwareServerDiscoverer, discover name: " + name); super.configure(name, params); createVmwareToolsIso(); if (s_logger.isInfoEnabled()) { s_logger.info("VmwareServerDiscoverer has been successfully configured"); } _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this); return true; }
@Override public void run() { if (logger.isInfoEnabled()) logger.info("��ʼִ�и���������ȡ���������"); try { boolean flag = itemContainer.executeTask(); if (flag) { logger.error("�������гɹ�"); } else { logger.error("�������з������, �����б�Ϊ�ա�"); } } catch (Exception e) { logger.error("ִ�и���������ȳ����쳣���쳣��Ϣ��" + e.getMessage(), e); } if (logger.isInfoEnabled()) logger.info("�������������ϡ���������"); }
private List copyTariffPK( java.util.List tariffPKs, java.util.Date durationFrom, java.util.Date durationTo) throws LocalException { if (log.isInfoEnabled()) log.info(">copy " + " List" + tariffPKs + " Date " + durationFrom + " Date " + durationTo); // // iterate over all TariffPK's // List newTariffs = new ArrayList(); for (int i = 0; i < tariffPKs.size(); i++) { SpecialRateValue ttv = (SpecialRateValue) findByPrimaryKey((PrimaryKey) tariffPKs.get(i)); // copy tariff List value = copy( (SpecialRatePK) tariffPKs.get(i), !ttv.getIsImport(), ttv.getIsImport(), new Long[] {new Long(ttv.getFacilityId())}, new Long[] {new Long(ttv.getVendorId())}, durationFrom, durationTo); // add tariff to return list newTariffs.addAll(value); } return newTariffs; }
/** * DOCUMENT ME! * * @param req DOCUMENT ME! * @param res DOCUMENT ME! * @throws IOException DOCUMENT ME! * @throws ServletException DOCUMENT ME! */ public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { String pageName = DefaultURLConstructor.parsePageFromURL(req, m_engine.getContentEncoding()); if (log.isInfoEnabled()) { log.info("Request for page: " + pageName); } if (pageName == null) { pageName = m_engine.getFrontPage(); // FIXME: Add special pages as well } String jspPage = m_engine.getURLConstructor().getForwardPage(req); StringBuffer sb = new StringBuffer("/") .append(jspPage) .append("?page=") .append(m_engine.encodeName(pageName)) .append("&") .append(req.getQueryString()); RequestDispatcher dispatcher = req.getRequestDispatcher(sb.toString()); dispatcher.forward(req, res); }
public void execute() { long startTime = System.currentTimeMillis(); execute(configuration.getOperations()); if (this.status == STATUS_RUNNING) { this.setStatus(STATUS_FINISHED); } // inform al listeners that execution is finished Iterator listenersIterator = this.scraperRuntimeListeners.iterator(); while (listenersIterator.hasNext()) { ScraperRuntimeListener listener = (ScraperRuntimeListener) listenersIterator.next(); listener.onExecutionEnd(this); } if (logger.isInfoEnabled()) { if (this.status == STATUS_FINISHED) { logger.info( "Configuration executed in " + (System.currentTimeMillis() - startTime) + "ms."); } else if (this.status == STATUS_STOPPED) { logger.info("Configuration stopped!"); } } }
/** * @param server * @param map * @return * @throws SQLException */ public static DruidDataSource newDataSoruce(MergeServerConfig server, Map<String, String> map) throws SQLException { DruidDataSource druid = new DruidDataSource(); if (logger.isInfoEnabled()) { logger.info("create druid datasource, param: " + map); } for (DruidConfig config : DruidConfig.values()) { String value = null; if (config.name().equals("url")) { value = Helper.getMySqlConURL(server.getIp(), server.getPort()); } else if (config.name().equals("name")) { SimpleDateFormat sdf = new SimpleDateFormat("MM_dd HH_mm_ss"); value = String.format("%s_%s[%s]", server.getIp(), server.getPort(), sdf.format(new Date())); } else { value = map.get(config.name()); } config.setValue(druid, value); } druid.init(); return druid; }
/** * Save the page view counters to file. * * @concurrency $none */ protected void storeCounters() { if (null != counters && null != storage && dirty) { if (log.isInfoEnabled()) { log.info("storeCounters: counters.size=" + counters.size()); } synchronized (this) { OutputStream fos = null; // Write out the collection of counters try { fos = new FileOutputStream(new File(workDir, COUNTER_PAGE)); storage.store( fos, "\n# The number of times each page has been viewed.\n# Do not modify.\n"); fos.flush(); dirty = false; } catch (IOException ioe) { log.error("storeCounters: Can't store counters: " + ioe.getMessage()); } finally { try { if (null != fos) { fos.close(); } } catch (Exception ignore) { /** ignore */ } } } } }
/** * This method will bind the type of the <code>typedElement</code> if the {@link * #getTypeParameter() type parameter} of this <code>ParameterGenericType</code> is in the given * list of type parameters that shall be bound. */ @Override protected boolean doBindGenericType( List<TypeParameter> parameters, List<? extends Type> types, TypedElement typedElement) { int index; // search the type parameter of this generic type in the list of parameters index = ListUtil.indexOf(parameters, getTypeParameter()); // bind the generic type if type parameter was found if (index != -1) { Type type = types.get(index); if (logger.isInfoEnabled()) { logger.info( "Binding type of '" + typedElement.getQualifiedName() // $NON-NLS-1$ + "' with '" + type.getName() + "'."); //$NON-NLS-1$ //$NON-NLS-2$ } // reset the generic type, then set the type (the order is important) typedElement.setGenericType(null); typedElement.setType(type); // break ans signal success return true; } return false; }
@Test public void testGetRoot() { List<T> result = this.manager.getRoot(); if (logger.isInfoEnabled()) { logger.info("testGetRoot() - List<T> result=" + result); // $NON-NLS-1$ } }
/** * Ejecuta la acción. * * @param rctx Contexto de ejecución de la regla * @param attContext Atributos con información extra, utilizados dentro de la ejecución de la * regla. * @return true si la ejecución termina correctamente, false en caso contrario. * @throws ActionException si ocurre algún error. */ public boolean execute(RuleContext rctx, AttributeContext attContext) throws ActionException { if (logger.isInfoEnabled()) { logger.info("Acción [" + this.getClass().getName() + "] en ejecución"); } // Número de expediente String numExp = rctx.getIdObjeto(); try { // Cierre del expediente en la Consulta Telemática // ServicioConsultaExpedientes consulta = // LocalizadorServicios.getServicioConsultaExpedientes(); // consulta.cerrarExpediente(numExp, getEntidad()); cerrarExpediente(numExp, getEntidad()); // Log del expediente logOk(numExp); // } catch (ActionException e) { // setInfo("Error en el alta de expediente: " + e.toString()); // logError(numExp, e); // throw e; } catch (Throwable e) { setInfo("Error en el alta de expediente: " + e.toString()); logError(numExp, e); throw new ActionException(e); } return true; }
@Override public void executeAction(final OrderProcessModel process) { getEventService().publishEvent(new OrderCancelledEvent(process)); if (LOG.isInfoEnabled()) { LOG.info("Process: " + process.getCode() + " in step " + getClass()); } }
@HLEFunction(nid = 0x57C8945B, version = 150) public int sceGeGetMtx(int mtxType, TPointer mtxAddr) { if (mtxType < 0 || mtxType > PSP_GE_MATRIX_TEXGEN) { log.warn(String.format("sceGeGetMtx invalid type mtxType=%d", mtxType)); return SceKernelErrors.ERROR_INVALID_INDEX; } float[] mtx; if (ExternalGE.isActive()) { mtx = ExternalGE.getMatrix(mtxType); } else { mtx = VideoEngine.getInstance().getMatrix(mtxType); } for (int i = 0; i < mtx.length; i++) { // Float value is returned in lower 24 bits. mtxAddr.setValue32(i << 2, Float.floatToRawIntBits(mtx[i]) >>> 8); } if (log.isInfoEnabled()) { log.info(String.format("sceGeGetMtx mtxType=%d, mtxAddr=%s, mtx=%s", mtxType, mtxAddr, mtx)); } return 0; }
/** * Log available script engines at INFO level. * * @param logger the logger instance used to log available script engines. */ public static void logAvailableScriptEngines(Logger logger) { if (!logger.isInfoEnabled()) { return; } ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); List<ScriptEngineFactory> engineFactories = scriptEngineManager.getEngineFactories(); StringBuilder buffer = new StringBuilder(); buffer.append("Available script engines: "); int engineFactoriesCount = engineFactories.size(); for (int i = 0; i < engineFactoriesCount; i++) { ScriptEngineFactory scriptEngineFactory = engineFactories.get(i); buffer.append(scriptEngineFactory.getEngineName()); buffer.append(" ("); buffer.append(scriptEngineFactory.getEngineVersion()); buffer.append(")"); if (i < engineFactoriesCount - 1) { buffer.append(", "); } } logger.info(buffer.toString()); }
private void logRequest(HttpServletRequest request) { if (logger.isInfoEnabled()) { logger.info("Request method: " + request.getMethod()); logger.info("Request contextPath: " + request.getContextPath()); logger.info("Request pathInfo: " + request.getPathInfo()); logger.info("Request pathTranslated: " + request.getPathTranslated()); logger.info("Request queryString: " + request.getQueryString()); logger.info("Request requestURI: " + request.getRequestURI()); logger.info("Request requestURL: " + request.getRequestURL()); logger.info("Request servletPath: " + request.getServletPath()); Enumeration headers = request.getHeaderNames(); if (headers != null) { while (headers.hasMoreElements()) { Object headerName = headers.nextElement(); logger.info( "Request header " + headerName + ":" + request.getHeader((String) headerName)); } } Enumeration params = request.getParameterNames(); if (params != null) { while (params.hasMoreElements()) { Object paramName = params.nextElement(); logger.info( "Request parameter " + paramName + ":" + request.getParameter((String) paramName)); } } logger.info("- End of request -"); } }
public static boolean addVSensorInstance(VirtualSensor sensorPool) { try { if (logger.isInfoEnabled()) logger.info( (new StringBuilder("Testing the pool for :")) .append(sensorPool.getConfig().getName()) .toString()); sensorPool.returnVS(sensorPool.borrowVS()); } catch (Exception e) { logger.error(e.getMessage(), e); sensorPool.closePool(); logger.error( "GSN can't load the virtual sensor specified at " + sensorPool.getConfig().getFileName() + " because the initialization of the virtual sensor failed (see above exception)."); logger.error("Please fix the following error"); return false; } TreeMap<String, Boolean> vsNameToOutputStructureFields = new TreeMap<String, Boolean>(); vsNamesToOutputStructureFields.put( sensorPool.getConfig().getName(), vsNameToOutputStructureFields); for (DataField fields : sensorPool.getConfig().getOutputStructure()) vsNameToOutputStructureFields.put(fields.getName(), Boolean.TRUE); vsNameToOutputStructureFields.put("timed", Boolean.TRUE); vsNameTOVSConfig.put(sensorPool.getConfig().getName(), sensorPool.getConfig()); fileNameToVSInstance.put(sensorPool.getConfig().getFileName(), sensorPool); return true; }
/** * Method "replace". * * @return true if ok */ public boolean replace(String migrationTaskName) { IFolder librariesFolder = ResourceManager.getLibrariesFolder(); IFile definitionFile = librariesFolder.getFile(TALENDDEFINITIONFILENAME); if (definitionFile.exists()) { File file = new File(definitionFile.getLocationURI()); try { String content = FileUtils.readFileToString(file, EMFUtil.ENCODING); for (String oldString : old2new.keySet()) { String newString = old2new.get(oldString); if (log.isInfoEnabled()) { log.info( DefaultMessagesImpl.getString( "TalendDefinitionFileUpdate_MigLog", migrationTaskName, oldString, newString)); //$NON-NLS-1$ } content = StringUtils.replace(content, oldString, newString); } FileUtils.writeStringToFile(file, content, EMFUtil.ENCODING); } catch (IOException e) { log.error(e.getMessage(), e); return false; } } return true; }
/** * {@inheritDoc} * * @see org.picocontainer.Startable#start() */ public void start() { if (logger.isInfoEnabled()) { logger.info("Starting Container " + delegate); } delegate.start(); }
public boolean authenticate(String username, String password) { if (logger.isInfoEnabled()) { logger.info(username + " is signing in..."); } LoginResponse login = WSCaller.getAuthService().login(username, Encrypter.generateMD5(password)); if (logger.isDebugEnabled()) { logger.debug( "login response received from the WS for username:"******". ResultCode=" + login.getResultCode() + " ErrorCode=" + login.getErrorCode() + " Token=" + login.getToken()); } if (login.getResultCode().intValue() == ResultCode.FAILURE.getCode()) { return false; } WebUser user = new WebUser(); user.setEmail(username); user.setFirstName(login.getName()); user.setLastName(login.getSurname()); user.setToken(login.getToken()); this.user = user; return true; }
public boolean authorise(Request request, Method method, Auth auth) { if (this.principal == null || auth == null) { logger.info("Invalid authorize in webdav:" + this.principal + ":" + auth); return false; } if (logger.isInfoEnabled()) logger.info( "authorise user in represource:" + this.principal + ":" + auth.getTag() + ":" + auth.getUser()); try { boolean hasAccess = AccessRightController.getController() .getIsPrincipalAuthorized(this.principal, "WebDAV.Read", true); logger.info("hasAccess:" + hasAccess); if (!hasAccess) return false; } catch (SystemException e) { e.printStackTrace(); } return true; }