Пример #1
0
  @Override
  public boolean createPortPair(PortPair portPair) {
    checkNotNull(portPair, PORT_PAIR_NULL);

    portPairStore.put(portPair.portPairId(), portPair);
    if (!portPairStore.containsKey(portPair.portPairId())) {
      log.debug(
          "The portPair is created failed which identifier was {}",
          portPair.portPairId().toString());
      return false;
    }
    return true;
  }
Пример #2
0
  @Override
  public boolean updatePortPair(PortPair portPair) {
    checkNotNull(portPair, PORT_PAIR_NULL);

    if (!portPairStore.containsKey(portPair.portPairId())) {
      log.debug(
          "The portPair is not exist whose identifier was {} ", portPair.portPairId().toString());
      return false;
    }

    portPairStore.put(portPair.portPairId(), portPair);

    if (!portPair.equals(portPairStore.get(portPair.portPairId()))) {
      log.debug(
          "The portPair is updated failed whose identifier was {} ",
          portPair.portPairId().toString());
      return false;
    }
    return true;
  }