List of usage examples for java.lang Long toString
public String toString()
From source file:com.greenline.guahao.web.module.home.controllers.json.patient.JsonPatientController.java
/** * json/*from w w w. j a v a 2s . com*/ * * @param model * @param patientId * @return OperationJsonObject */ @MethodRemark(value = "remark=json,method=ajax,patientId=id") @RequestMapping(value = JsonPathConstants.J_PATIENT_DEL_PATH, method = RequestMethod.GET) public @ResponseBody BaseJsonObject patientDel(ModelMap model, @PathVariable("pid") String patientId) { BaseJsonObject json = new BaseJsonObject(Boolean.FALSE, MobileMsgConstants.M_PATIENT_DEL_SUC); // id String decodePatientId = DESUtil.DESDecode(patientId, EncodeKeyConstants.PATIENT_ENCODE_KEY); if (!StringUtils.isNumeric(decodePatientId)) { // id? json.setHasError(Boolean.TRUE); json.setCode(ReservationConstants.RESERVATION_ERROR_CODE_JSON); json.setMessage("?"); } else { PatientInfoDO patientInfoDO = patientManager.getPatientByPatientId(Long.parseLong(decodePatientId)); if (null != patientInfoDO) { Long userId = UserCookieUtil.getUserId(request); if (!userId.toString().equals(String.valueOf(patientInfoDO.getUser_id()))) { // ?? json.setHasError(Boolean.TRUE); json.setCode(ReservationConstants.RESERVATION_ERROR_CODE_JSON); json.setMessage("?"); } else { PatientResult pr = patientManager.removePatient(Long.valueOf(decodePatientId)); if (pr.isSystemError()) { json.setHasError(Boolean.TRUE); json.setMessage(pr.getResponseDesc()); } } } } return json; }
From source file:com.taobao.ad.es.common.test.DTHttpJobExecutorTest.java
@Before public void init() { jobData = new JobData(); jobData.setJobId("1234"); jobData.setJobGroup("1234"); jobData.setJobName("testDTJob"); jobData.setJobType(JobData.JOBTYPE_DTJOB); Long signTime = System.currentTimeMillis() / 1000; String token = TokenUtils.generateToken(signTime.toString()); jobData.setSignTime(signTime.toString()); jobData.setToken(token);//from w w w .j a v a 2 s .com jobData.setSync(true); Map<String, String> data = new HashMap<String, String>(); data.put(JobData.JOBDATA_DATA_TRACKINGSQL, "select 1"); data.put(JobData.JOBDATA_DATA_DATASOURCE, "esMysqlDS-mysql"); data.put(JobData.JOBDATA_DATA_DATASOURCE_TYPE, "" + JobData.JOBDATA_DATA_DATASOURCE_TYPE_DYNAMIC); jobData.setData(data); dsContextPath = this.getClass().getClassLoader().getResource("es-agent-test-ds.xml").getPath(); }
From source file:com.carlos.projects.billing.ui.controllers.NewBudgetControllerTest.java
@Test public void shouldAddDocumentIdToModelIfItIsPresentOnRequest() throws Exception { //given/* www.j a v a 2s.c o m*/ Long documentId = 123L; when(request.getParameter("documentId")).thenReturn(documentId.toString()); //when ModelAndView modelAndView = controller.handleRequest(request, response); //then assertThat("Document id is not correct", (Long) modelAndView.getModel().get("documentId"), is(documentId)); }
From source file:org.syncope.core.workflow.activiti.SyncopeGroupManager.java
@Override public List<Group> findGroupsByUser(final String userId) { List<Group> result = Collections.EMPTY_LIST; SyncopeUser user = userDAO.find(userId); if (user != null) { result = new ArrayList<Group>(); for (Long roleId : user.getRoleIds()) { result.add(new GroupEntity(roleId.toString())); }//from w ww. j a v a2 s. com } return result; }
From source file:es.pode.administracion.presentacion.nodos.bajaNodo.BajaNodoControllerImpl.java
/** * @see es.pode.administracion.presentacion.nodos.bajaNodo.BajaNodoController#obtenerNodos(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.nodos.bajaNodo.ObtenerNodosForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) *///w w w .j a v a 2 s .c o m public final void obtenerNodos(ActionMapping mapping, es.pode.administracion.presentacion.nodos.bajaNodo.ObtenerNodosForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { try { log.info("Entramos en obtenerNodos"); SrvNodoService srvNodoService = this.getSrvNodoService(); Iterator iter = (form.getIds()).iterator(); NodoVO[] nodos = new NodoVO[form.getIds().size()]; int i = 0; String listaId = ""; while (iter.hasNext()) { log.info("Iteramos"); Long id = new Long((String) iter.next()); listaId = listaId + id.toString() + " "; NodoVO nodoVO = srvNodoService.obtenerNodo(id); nodos[i] = nodoVO; i = i + 1; } log.info("Salimos con la lista " + listaId); form.setListaId(listaId.trim()); form.setNodos(nodos); } catch (Exception e) { log.error("Se ha producido un error al recuperar los nodos: " + e); throw new ValidatorException("{errors.borrarNodo}"); } }
From source file:jp.primecloud.auto.sdk.client.component.StartComponent.java
public void execute(Long componentNo, List<Long> instanceNos) { Map<String, String> parameters = new LinkedHashMap<String, String>(); parameters.put("ComponentNo", componentNo.toString()); parameters.put("InstanceNos", StringUtils.join(instanceNos, ",")); requester.execute("/StartComponent", parameters); }
From source file:org.dawnsci.marketplace.services.FileService.java
public void deleteSolution(Long id) { File file = solutionsRoot.resolve(id.toString()).toFile(); try {//ww w. ja v a 2 s . c o m FileUtils.forceDelete(file); } catch (IOException e) { e.printStackTrace(); } }
From source file:com.facebook.ads.sdk.LeadgenForm.java
public static LeadgenForm fetchById(Long id, APIContext context) throws APIException { return fetchById(id.toString(), context); }
From source file:no.dusken.barweb.admin.editor.GenericEditor.java
@Override public String getAsText() { if (log.isDebugEnabled()) log.debug(getValue().toString()); @SuppressWarnings({ "unchecked" }) T entity = (T) getValue();//from w w w . jav a 2 s . c om if (entity == null) return " "; Long ID = entity.getId(); if (ID == null) return " "; if (log.isDebugEnabled()) log.debug(ID.toString()); return ID.toString(); }
From source file:es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.BajaCatalogadoresControllerImpl.java
/** * @see es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.BajaCatalogadoresController#recogerCatalogadores(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.RecogerCatalogadoresForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) *//*www.java2 s . c o m*/ public final void recogerCatalogadores(ActionMapping mapping, es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.RecogerCatalogadoresForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { try { SrvAdminUsuariosService srvAdminUsuariosService = this.getSrvAdminUsuariosService(); Iterator iter = (form.getIds()).iterator(); GrupoTrabajoVO[] gruposTrabajo = new GrupoTrabajoVO[form.getIds().size()]; int i = 0; String listaId = ""; while (iter.hasNext()) { Long id = new Long((String) iter.next()); listaId = listaId + id.toString() + " "; GrupoTrabajoVO grupoTrabajoVO = srvAdminUsuariosService.descripcionGrupoTrabajo(id); gruposTrabajo[i] = grupoTrabajoVO; i = i + 1; } form.setListaId(listaId.trim()); form.setGruposTrabajo(gruposTrabajo); if ((listaId.length() == 0) || (gruposTrabajo.length == 0)) { saveErrorMessage(request, "errors.borrarGrupo"); } } catch (Exception e) { log.error("Error: " + e); throw new ValidatorException("{errors.borrarGrupo}"); } }