Codota Logo
Pair
Code IndexAdd Codota to your IDE (free)

How to use
Pair
in
rocks.inspectit.shared.all.util

Best Java code snippets using rocks.inspectit.shared.all.util.Pair (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public BusinessTransactionData getBusinessTransactionForId(int appId, int businessTxId) {
  return businessTransactions.get(new Pair<Integer, Integer>(appId, businessTxId));
}
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
  final int prime = 31;
  int result = 1;
  result = (prime * result) + ((getFirst() == null) ? 0 : getFirst().hashCode());
  result = (prime * result) + ((getSecond() == null) ? 0 : getSecond().hashCode());
  return result;
}
origin: inspectIT/inspectIT

if (pair != null) {
  @SuppressWarnings("rawtypes")
  AbstractEUMPointBuilder responsibleBuilder = pair.getSecond();
  boolean isBrowserInfoCaptured = pair.getFirst();
  Pair<Long, Long> plrSessionTabId = new Pair<Long, Long>(sessId, tabId);
origin: inspectIT/inspectIT

  @SuppressWarnings("unchecked")
  @Override
  public void onRemoval(RemovalNotification<AbstractEUMSpanDetails, Pair<Boolean, AbstractEUMPointBuilder>> notification) {
    AbstractEUMSpanDetails element = notification.getKey();
    synchronized (element) {
      AbstractEUMPointBuilder builder = notification.getValue().getSecond();
      Long sessId = element.getOwningSpan().getSessionId();
      Long tabId = element.getOwningSpan().getTabId();
      Pair<Long, Long> plrSessionTabId = new Pair<Long, Long>(sessId, tabId);
      missingSessionInfosMap.remove(sessId, element);
      missingPageLoadRequestsMap.remove(plrSessionTabId, element);
      // Force a write even if data is still missing in case of an cache
      // eviction because of the timeout
      if (notification.getCause() != RemovalCause.EXPLICIT) {
        PageLoadRequest plr = pageLoadRequestCache.getIfPresent(plrSessionTabId);
        UserSessionInfo sessionInfo = sessionInfoCache.getIfPresent(sessId);
        dataPointsToWrite.addAll(builder.build(sessionInfo, plr, element));
      }
    }
  }
}).build();
origin: inspectIT/inspectIT

@Test
private void musteReturnAnObjectWithAPairLongStringIfTheTimerDataHasHttpTimerData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  HttpTimerData timerData = new HttpTimerData(new Timestamp(10), 10, 10, 108L);
  HttpInfo httpInfo = new HttpInfo("URI", "requestMethod", "headerValue");
  timerData.setHttpInfo(httpInfo);
  invocationSequenceData.setTimerData(timerData);
  Pair<Long, String> aggregationKey = (Pair<Long, String>) DiagnosisDataAggregator.getInstance().getAggregationKey(invocationSequenceData);
  assertThat("The string of the pair must be the sql data", aggregationKey.getSecond(), is(timerData.getHttpInfo().getUri()));
}
origin: inspectIT/inspectIT

@Test
private void musteReturnAnObjectWithAPairLongStringIfTheTimerDataHasSqlData() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L);
  SqlStatementData sqlStatementData = new SqlStatementData(new Timestamp(10), 10, 10, 108L);
  sqlStatementData.setCount(1);
  sqlStatementData.setSql("blahblahblah");
  invocationSequenceData.setSqlStatementData(sqlStatementData);
  TimerData timerData = new TimerData();
  invocationSequenceData.setTimerData(timerData);
  Pair<Long, String> aggregationKey = (Pair<Long, String>) DiagnosisDataAggregator.getInstance().getAggregationKey(invocationSequenceData);
  assertThat("The string of the pair must be the sql data", aggregationKey.getSecond(), is(sqlStatementData.getSql()));
}
origin: inspectIT/inspectIT

  /**
   * {@inheritDoc}
   */
  @Override
  public BusinessTransactionData getBusinessTransactionForId(int appId, int businessTxId) {
    return businessTransactions.get(new Pair<Integer, Integer>(appId, businessTxId));
  }
}
origin: inspectIT/inspectIT

if (getFirst() == null) {
  if (other.getFirst() != null) {
    return false;
} else if (!getFirst().equals(other.getFirst())) {
  return false;
if (getSecond() == null) {
  if (other.getSecond() != null) {
    return false;
} else if (!getSecond().equals(other.getSecond())) {
  return false;
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public BusinessTransactionData getBusinessTransactionForId(int appId, int businessTxId) {
  Pair<Integer, Integer> keyPair = new Pair<Integer, Integer>(appId, businessTxId);
  if (!businessTransactionsMap.containsKey(keyPair)) {
    refreshBusinessContext();
  }
  BusinessTransactionData businessTxData = businessTransactionsMap.get(keyPair);
  return businessTxData;
}
origin: inspectIT/inspectIT

/**
 * Sets the message based on the page contents.
 */
protected void setPageMessage() {
  if (thresholdBox.getText().isEmpty()) {
    setMessage("Threshold must not be empty!", ERROR);
    return;
  }
  if (timerangeSpinner.getText().isEmpty()) {
    setMessage("Check interval must not be empty!", ERROR);
    return;
  }
  Pair<Integer, String> emailsErrorMessage = checkEmailText();
  if (null != emailsErrorMessage) {
    setMessage("The email address '" + emailsErrorMessage.getSecond() + "' in line " + emailsErrorMessage.getFirst() + " is not valid!", ERROR);
    return;
  }
  setMessage(DEFAULT_MESSAGE);
}
origin: inspectIT/inspectIT

/**
 * Validates the content of the email addresses input field checking whether the e-mails have a
 * correct syntax.
 *
 * @return Returns a integer-string pair indicating the line number and e-mail address that is
 *         not correct. If all e-mail addresses have a correct syntax, then this method returns
 *         <code>null</code>.
 */
private Pair<Integer, String> checkEmailText() {
  int i = 0;
  for (String address : getEmailAddresses()) {
    if (!address.isEmpty() && !EMailUtils.isValidEmailAddress(address)) {
      return new Pair<Integer, String>(i + 1, address);
    }
    i++;
  }
  return null;
}
origin: inspectIT/inspectIT

ExternalServiceStatus serviceStatus = cmrStatusData.getExternalServiceStatusMap().get(serviceEntry.getKey());
if (serviceStatus == ExternalServiceStatus.CONNECTED) {
  serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD_GREEN));
  serviceEntry.getValue().getSecond().setText("Connected");
} else if (serviceStatus == ExternalServiceStatus.DISCONNECTED) {
  serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD));
  serviceEntry.getValue().getSecond().setText("Disconnected");
} else if (serviceStatus == ExternalServiceStatus.DISABLED) {
  serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD_GRAY));
  serviceEntry.getValue().getSecond().setText("Disabled");
} else if (serviceStatus == ExternalServiceStatus.UNKNOWN) {
  serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD_YELLOW));
  serviceEntry.getValue().getSecond().setText("Unknown status");
serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD_GRAY));
serviceEntry.getValue().getSecond().setText("");
origin: inspectIT/inspectIT

/**
 * Handles teh arrival of a new PageLoadRequest.
 *
 * @param plr
 *            the received pageloadrequest
 */
private void newPageLoadRequestReceived(PageLoadRequest plr) {
  Long sessionID = plr.getOwningSpan().getSessionId();
  Long tabID = plr.getOwningSpan().getTabId();
  Pair<Long, Long> plrSessionTabId = new Pair<Long, Long>(sessionID, tabID);
  pageLoadRequestCache.put(plrSessionTabId, plr);
  Iterator<AbstractEUMSpanDetails> it = missingPageLoadRequestsMap.get(plrSessionTabId).iterator();
  while (it.hasNext()) {
    AbstractEUMSpanDetails next = it.next();
    it.remove();
    tryPointBuildingForPendingElement(next);
  }
}
origin: inspectIT/inspectIT

/**
 * Reloads the business context data.
 */
private void refreshBusinessContext() {
  applicationMap.clear();
  businessTransactionsMap.clear();
  for (BusinessTransactionData businessTx : businessContextService.getBusinessTransactions()) {
    businessTransactionsMap.put(new Pair<Integer, Integer>(businessTx.getApplication().getId(), businessTx.getId()), businessTx);
  }
  for (ApplicationData application : businessContextService.getApplications()) {
    applicationMap.put(application.getId(), application);
  }
}
origin: inspectIT/inspectIT

/**
 * Sets {@link #businessTransactions}.
 *
 * @param businessTransactions
 *            A collection of {@link BusinessTransactionData} instances.
 */
public void setBusinessTransactions(Collection<BusinessTransactionData> businessTransactions) {
  for (BusinessTransactionData businessTx : businessTransactions) {
    this.businessTransactions.put(new Pair<Integer, Integer>(businessTx.getApplication().getId(), businessTx.getId()), businessTx);
    this.applications.put(businessTx.getApplication().getId(), businessTx.getApplication());
  }
}
origin: inspectIT/inspectIT

Pair<Long, Long> plrSessionTabId = new Pair<Long, Long>(sessId, tabId);
  result.addAll(responsibleBuilder.build(sessInfo, plr, details));
} else {
  pendingDataPoints.put(details, new Pair<>(isBrowserInfoCaptured, responsibleBuilder));
origin: inspectIT/inspectIT

/**
 * Get key for aggregation.
 *
 * @param invocationSequenceData
 *            invocationSequenceData to key should be determined
 * @return key as object
 */
public Object getAggregationKey(InvocationSequenceData invocationSequenceData) {
  if (InvocationSequenceDataHelper.hasSQLData(invocationSequenceData)) {
    return new Pair<Long, String>(invocationSequenceData.getMethodIdent(), invocationSequenceData.getSqlStatementData().getSql());
  } else if (InvocationSequenceDataHelper.hasHttpTimerData(invocationSequenceData)) {
    return new Pair<Long, String>(invocationSequenceData.getMethodIdent(), ((HttpTimerData) invocationSequenceData.getTimerData()).getHttpInfo().getUri());
  } else {
    return invocationSequenceData.getMethodIdent();
  }
}
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
public BusinessTransactionData registerBusinessTransaction(ApplicationData application, BusinessTransactionDefinition businessTransactionDefinition, String businessTransactionName) {
  int businessTxId = deriveInstanceId(businessTransactionName, businessTransactionDefinition.getId());
  BusinessTransactionData businessTransaction = getBusinessTransactionForId(application.getId(), businessTxId);
  if (null == businessTransaction) {
    businessTransaction = new BusinessTransactionData(businessTxId, businessTransactionDefinition.getId(), application, businessTransactionName);
    Pair<Integer, Integer> key = new Pair<Integer, Integer>(application.getId(), businessTransaction.getId());
    BusinessTransactionData existingBusinessTx = businessTransactions.putIfAbsent(key, businessTransaction);
    if (null != existingBusinessTx) {
      businessTransaction = existingBusinessTx;
    }
  }
  return businessTransaction;
}
origin: inspectIT/inspectIT

  @Test
  private void ifTheAggregatedObjectHasHttpTimerDataAndIsDefinedInTheMapItMustBeAggregatedToTheDiagnosisAggregator() {
    InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 2L);
    diagnosisDataAggregationPerformer = new DiagnosisDataAggregationPerformer();
    HttpTimerData timerData = new HttpTimerData(new Timestamp(10), 10, 10, 108L);
    HttpInfo httpInfo = new HttpInfo("URI", "requestMethod", "headerValue");
    timerData.setHttpInfo(httpInfo);
    invocationSequenceData.setTimerData(timerData);
    Object key = new Pair<Long, String>(invocationSequenceData.getMethodIdent(), ((HttpTimerData) invocationSequenceData.getTimerData()).getHttpInfo().getUri());
    diagnosisDataAggregationPerformer.diagnosisDataAggregationMap.put(key, alreadyAggregatedObject);
    diagnosisDataAggregationPerformer.aggregateInvocationSequenceData(invocationSequenceData);
    verify(alreadyAggregatedObject, times(1)).aggregate(invocationSequenceData);
  }
}
origin: inspectIT/inspectIT

@Test
private void ifTheAggregatedObjectHasSQLDataAndIsDefinedInTheMapItMustBeAggregatedToTheDiagnosisAggregator() {
  InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 2L);
  diagnosisDataAggregationPerformer = new DiagnosisDataAggregationPerformer();
  SqlStatementData sqlStatementData = new SqlStatementData(new Timestamp(10), 10, 10, 108L);
  sqlStatementData.setCount(1);
  sqlStatementData.setSql("blahblahblah");
  invocationSequenceData.setSqlStatementData(sqlStatementData);
  HttpTimerData timerData = new HttpTimerData(new Timestamp(10), 10, 10, 108L);
  invocationSequenceData.setTimerData(timerData);
  Object key = new Pair<Long, String>(invocationSequenceData.getMethodIdent(), invocationSequenceData.getSqlStatementData().getSql());
  diagnosisDataAggregationPerformer.diagnosisDataAggregationMap.put(key, alreadyAggregatedObject);
  diagnosisDataAggregationPerformer.aggregateInvocationSequenceData(invocationSequenceData);
  verify(alreadyAggregatedObject, times(1)).aggregate(invocationSequenceData);
}
rocks.inspectit.shared.all.utilPair

Javadoc

Simple Pair of two objects. TODO: remove when commons lang are updated to version 3.0+

Most used methods

  • <init>
    Constructor.
  • getSecond
    Gets #second.
  • getFirst
    Gets #first.

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Menu (java.awt)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now