List of usage examples for org.apache.commons.lang.builder ToStringBuilder reflectionToString
public static String reflectionToString(Object object)
Forwards to ReflectionToStringBuilder
.
From source file:almira.sample.domain.Catapult.java
@Override public String toString() { return ToStringBuilder.reflectionToString(this); }
From source file:fi.vm.sade.osoitepalvelu.kooste.service.search.DefaultSearchService.java
@Override @Cacheable(cacheName = "osoitepalveluSearchResultsCache") public SearchResultsDto find(@PartialCacheKey SearchTermsDto terms, CamelRequestContext context) throws TooFewSearchConditionsForOrganisaatiosException, TooFewSearchConditionsForHenkilosException, TooFewSearchConditionsForKoulutusException, OrganisaatioTyyppiMissingForOrganisaatiosException { logger.info("Starting search by {}", getLoggedInUserOidOrNull()); SearchResultsDto results = new SearchResultsDto(); boolean searchHenkilos = terms.containsAnyTargetGroup(SearchTargetGroup.GroupType.getHenkiloHakuTypes()), returnOrgansiaatios = terms.containsAnyTargetGroup( SearchTargetGroup.GroupType.getOrganisaatioPalveluTypes(), SearchTargetGroup.TargetType.ORGANISAATIO), searchKoulutuksenTarjoajat = terms .containsAnyTargetGroup(SearchTargetGroup.GroupType.getKoulutusHakuTypes()); OrganisaatioYhteystietoCriteriaDto organisaatioCriteria = produceOrganisaatioCriteria(terms); boolean anyOrganisaatioRelatedConditionsUsed = organisaatioCriteria.getNumberOfUsedConditions() > 0, searchOrganisaatios = returnOrgansiaatios || (searchHenkilos && anyOrganisaatioRelatedConditionsUsed); List<OrganisaatioYhteystietoHakuResultDto> organisaatioYhteystietoResults = new ArrayList<OrganisaatioYhteystietoHakuResultDto>(); logger.debug("searchKoulutuksenTarjoajat == " + searchKoulutuksenTarjoajat); if (searchKoulutuksenTarjoajat) { OrganisaatioYhteystietoCriteriaDto ktOrgCriteria = produceOrganisaatioCriteria(terms); // Otetaan organisaatiotyypit "KOULUTUKSEN_TARJOAJAT" optioista ktOrgCriteria.setOrganisaatioTyyppis( parseOrganisaatioTyyppis(terms, SearchTargetGroup.GroupType.KOULUTUKSEN_TARJOAJAT)); logger.debug("Koulutuksen tarjoajat, Organisaatiotyypit: " + ktOrgCriteria.getOrganisaatioTyyppis()); // Luodaan koulutuskriteerit KoulutusCriteriaDto koulutusCriteria = produceKoulutusCriteria(terms); List<String> oidList = tarjontaService.findOrganisaatios(koulutusCriteria, context); if (oidList.isEmpty()) { logger.info(//from w ww . j a v a 2 s . c om "Oid list of KOULUTUKSEN_TARJOAJA empty --> no organisations found with koulutus criteria!"); } else { // Haetaan koulutusten tarjoajaorganisaatioiden yhteystiedot ktOrgCriteria.setOidList(oidList); List<OrganisaatioYhteystietoHakuResultDto> ktOrgYhteystietoResults; ktOrgYhteystietoResults = organisaatioService.findOrganisaatioYhteystietos(ktOrgCriteria, terms.getLocale(), context); // Listn koulutusten tarjoajaorganisaatioiden yhteystiedot muiden organisaatioyhteystietojen joukkoon organisaatioYhteystietoResults.addAll(ktOrgYhteystietoResults); logger.debug( "Organisaatioiden haku kriteerit: " + ToStringBuilder.reflectionToString(ktOrgCriteria)); logger.debug("Koulutuksen tarjoajat, organisaatioiden yhteystiedot size: " + ktOrgYhteystietoResults.size()); // Convert to result DTOs (with e.g. postinumeros): List<OrganisaatioResultDto> convertedResults = dtoConverter.convert(ktOrgYhteystietoResults, new ArrayList<OrganisaatioResultDto>(), OrganisaatioResultDto.class, terms.getLocale()); results.addOrganisaatios(convertedResults); } } logger.debug("searchOrganisaatios == " + searchOrganisaatios); if (searchOrganisaatios) { SearchTargetGroup.TargetType[] targetTypes; if (returnOrgansiaatios) { // Only the ones with target group and ORGANISAATIO-type selected: // (and apply other possible constraints): targetTypes = new SearchTargetGroup.TargetType[] { SearchTargetGroup.TargetType.ORGANISAATIO }; } else { // No ORGANISAATIO types selected but possibly a number of organisaatio kind target groups present, // use them to filter organisaatios by which to return henkilos as well // (as other possible filterin constaints): targetTypes = new SearchTargetGroup.TargetType[0]; } organisaatioCriteria.setOrganisaatioTyyppis(parseOrganisaatioTyyppis(terms, targetTypes)); // When searching henkils we don't want to limit the search. if (!searchHenkilos) { ensureAtLeastOneConditionUsed(organisaatioCriteria); } List<OrganisaatioYhteystietoHakuResultDto> orgYhteystietoResults; orgYhteystietoResults = organisaatioService.findOrganisaatioYhteystietos(organisaatioCriteria, terms.getLocale(), context); organisaatioYhteystietoResults.addAll(orgYhteystietoResults); if (returnOrgansiaatios) { // Convert to result DTOs (with e.g. postinumeros): List<OrganisaatioResultDto> convertedResults = dtoConverter.convert(orgYhteystietoResults, new ArrayList<OrganisaatioResultDto>(), OrganisaatioResultDto.class, terms.getLocale()); results.addOrganisaatios(convertedResults); } } logger.debug("searchHenkilos == " + searchHenkilos); if (searchHenkilos) { List<String> organisaatioOids = oids(organisaatioYhteystietoResults); List<HenkiloDetailsDto> henkiloDetails = findHenkilos(terms, context, organisaatioOids); // Searching individuals may contain sensitive content so it is logged. logRead(henkiloDetails); List<HenkiloHakuResultDto> henkiloResults = dtoConverter.convert(henkiloDetails, new ArrayList<HenkiloHakuResultDto>(), HenkiloHakuResultDto.class, terms.getLocale()); results.setHenkilos(henkiloResults); } logger.debug("Search end by {}", getLoggedInUserOidOrNull()); return results; }
From source file:com.intuit.tank.standalone.agent.StandaloneAgentStartup.java
private void sendAvailability() { // create new availability as a copy of the original AgentAvailability availability = new AgentAvailability(currentAvailability.getInstanceId(), currentAvailability.getInstanceUrl(), currentAvailability.getCapacity(), currentAvailability.getAvailabilityStatus()); LOG.info("Sending availaability: " + ToStringBuilder.reflectionToString(availability)); agentClient.standaloneAgentAvailable(availability); }
From source file:cn.loveapple.service.controller.member.action.MemberController.java
/** * //from ww w .jav a2 s .c om * * @param session * @param model * @return */ @RequestMapping(value = "registComplete", method = RequestMethod.POST) public String registComplete(HttpSession session, HttpServletRequest request, Model model, Locale locale) { LoveappleMemberModel member = (LoveappleMemberModel) session.getAttribute(LOVEAPPLE_MEMBER_TMP); if (member == null) { try { throw new NoSuchRequestHandlingMethodException(request); } catch (NoSuchRequestHandlingMethodException e) { throw new HttpMessageNotWritableException(e.getMessage(), e); } } member = memberCoreService.insertLoveappleMember(member); if (member == null) { throw new HttpMessageNotWritableException("can not regist member. " + ToStringBuilder.reflectionToString(session.getAttribute(LOVEAPPLE_MEMBER_TMP))); } session.removeAttribute(FORM); session.removeAttribute(LOVEAPPLE_MEMBER_TMP); // ?? try { MimeMessage message = memberCoreService.sendRegistCertificationMail(member); log.info("Send mail: " + ToStringBuilder.reflectionToString(message)); } catch (MailException e) { log.warn("?", e); } return "redirect:/member/certification"; }
From source file:com.intuit.tank.vm.vmManager.JobRequestImpl.java
/** * @{inheritDoc private String id;/* w w w.j a va 2 s . c o m*/ * * private IncrementStrategy incrementStrategy = IncrementStrategy.increasing; private Location * location = Location.san_diego; private TerminationPolicy terminationPolicy = TerminationPolicy.time; * private int rampTime; private int baselineVirtualUsers; private int simulationTime; private int * userIntervalIncrement; private ReportingMode reportingMode = ReportingMode.None; private * JobQueueStatus status = JobQueueStatus.Created; private Set<? extends RegionRequest> regions = new * HashSet<RegionRequest>(); private Set<? extends Notification> notifications = new * HashSet<Notification>(); private Set<Integer> dataFileIds = new HashSet<Integer>(); */ @Override public String toString() { return new ToStringBuilder(this).append("id", id).append("location", location) .append("terminationPolicy", terminationPolicy).append("rampTime", rampTime) .append("loggingProfile", LoggingProfile.fromString(loggingProfile).getDisplayName()) .append("stopBehavior", StopBehavior.fromString(stopBehavior).getDisplay()) .append("simulationTime", simulationTime).append("useEips", useEips) .append("baselineVirtualUsers", baselineVirtualUsers) .append("userIntervalIncrement", userIntervalIncrement).append("reportingMode", reportingMode) .append("regions", ToStringBuilder.reflectionToString(regions)).toString(); }
From source file:fr.dudie.keolis.client.JsonKeolisClientTest.java
/** * Test method for {@link JsonKeolisClient#getAllRelayParks()}. * /*from w ww .ja v a 2 s. c o m*/ * @throws IOException * an error occurred */ @Test public void testGetAllRelayParks() throws IOException { LOGGER.info("testGetAllRelayParks.start"); List<RelayPark> parks = null; parks = getKeolisClient().getAllRelayParks(); assertNotNull("no relay parks returned by the api", parks); assertTrue("at least one park should be returned by the api", parks.size() > 0); assertEquals("on September, 3rd 2011, the keolis API returns 4 relay parks", 4, parks.size()); for (final RelayPark park : parks) { LOGGER.debug("{}", ToStringBuilder.reflectionToString(park)); } LOGGER.info("testGetAllRelayParks.end"); }
From source file:com.cubeia.game.server.service.wallet.LocalDummyWalletService.java
@Override public synchronized RoundResultResponse roundResult(long type, long contextId, long subContextId, Collection<ResultEntry> results, String description) { log.debug("round result: type = " + type + ", contextId = " + contextId + ", subContextId = " + subContextId + ", desc = '" + description + "'"); RoundResultResponse response = new RoundResultResponse(); Collection<AccountBalanceResult> balances = new ArrayList<AccountBalanceResult>(); for (ResultEntry re : results) { long sessionId = re.getSessionId(); log.debug("round result entry: sessionId = " + sessionId + ", amount = " + re.getAmount()); AccountContainer acnt = accountMap.get(sessionId); if (acnt == null) { throw new RuntimeException("error handling round report, session not found: " + ToStringBuilder.reflectionToString(response)); }/*from w w w . j ava 2s.c o m*/ acnt = acnt.credit(new Money(re.getCurrencyCode(), FRACTIONS, re.getAmount())); if (acnt.getBalance().getAmount().signum() < 0) { throw new RuntimeException( "error handling round report, insufficient funds, sessionId = " + sessionId); } accountMap.put(sessionId, acnt); log.debug("balance updated, sessionId = " + sessionId + ", account = " + acnt); AccountBalanceResult accountBalance = new AccountBalanceResult(sessionId, acnt.getBalance()); balances.add(accountBalance); } response.setBalances(balances); return response; }
From source file:fr.dudie.keolis.client.JsonKeolisClientTest.java
/** * Test method for {@link JsonKeolisClient#getRelayParksNearFrom(int, int)}. * /*from w w w . jav a2s . co m*/ * @throws IOException * an error occurred */ @Test public void testRelayParksNearFrom() throws IOException { LOGGER.info("testRelayParksNearFrom.start"); List<RelayPark> parks = null; parks = getKeolisClient().getRelayParksNearFrom(1600000, 1600000); assertNotNull("no relay parks returned by the api", parks); assertTrue("at least one park should be returned by the api", parks.size() > 0); assertEquals("on September, 3rd 2011, the keolis API returns 4 relay parks", 4, parks.size()); for (final RelayPark park : parks) { LOGGER.debug("{}", ToStringBuilder.reflectionToString(park)); } LOGGER.info("testRelayParksNearFrom.end"); }
From source file:de.xirp.io.comm.data.Datapool.java
/** * Adds the given message to a queue of messages which are send to * a robot within a thread.//from w ww. j ava 2 s . com * * @param message * the message to send * @return <code>false</code> if there was no more space in the * send queue or there was no handler available */ public boolean sendToRobot(DatapoolMessage message) { boolean ableToSend = false; if (handler != null) { ableToSend = sendQueue.offer(message); if (!ableToSend) { logClass.warn(robot.getName(), I18n.getString("Datapool.log.failedToSend") //$NON-NLS-1$ + ToStringBuilder.reflectionToString(message) + I18n.getString("Datapool.log.reasonCouldNotOffer") //$NON-NLS-1$ + Constants.LINE_SEPARATOR); } } else { logClass.warn(robot.getName(), I18n.getString("Datapool.log.failedToSend") + ToStringBuilder.reflectionToString(message) //$NON-NLS-1$ + I18n.getString("Datapool.log.reasonNoHandler") + Constants.LINE_SEPARATOR); //$NON-NLS-1$ } return ableToSend; }
From source file:com.cubeia.game.server.service.wallet.LocalDummyWalletService.java
@Override public TransactionResult doTransaction(TransactionRequest txRequest) { log.debug("do transaction: " + txRequest); TransactionResult response = new TransactionResult(); response.setTransactionId(-1L);//from w w w .ja v a2 s. c om Collection<AccountBalanceResult> balances = new ArrayList<AccountBalanceResult>(); for (TransactionEntry te : txRequest.getEntries()) { long accountId = te.getAccountId(); log.debug("tx entry: accountId = " + accountId + ", amount = " + te.getAmount()); AccountContainer acnt = accountMap.get(accountId); if (acnt == null) { throw new RuntimeException("error handling round report, session not found: " + ToStringBuilder.reflectionToString(response)); } acnt = acnt.credit(te.getAmount()); if (acnt.getBalance().getAmount().signum() < 0) { throw new RuntimeException( "error handling tx request, insufficient funds, sessionId = " + accountId); } accountMap.put(accountId, acnt); log.debug("balance updated, sessionId = " + accountId + ", balance = " + acnt); AccountBalanceResult accountBalance = new AccountBalanceResult(accountId, acnt.getBalance()); balances.add(accountBalance); } response.setBalances(balances); return response; }