示例#1
0
  @Override
  public boolean removePortPair(PortPairId portPairId) {
    checkNotNull(portPairId, PORT_PAIR_NULL);

    portPairStore.remove(portPairId);
    if (portPairStore.containsKey(portPairId)) {
      log.debug("The portPair is removed failed whose identifier was {}", portPairId.toString());
      return false;
    }
    return true;
  }
示例#2
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;
  }
示例#3
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;
  }
示例#4
0
 @Override
 public Iterable<PortPair> getPortPairs() {
   return Collections.unmodifiableCollection(portPairStore.values());
 }
示例#5
0
 @Override
 public int getPortPairCount() {
   return portPairStore.size();
 }
示例#6
0
 @Override
 public boolean exists(PortPairId portPairId) {
   checkNotNull(portPairId, PORT_PAIR_ID_NULL);
   return portPairStore.containsKey(portPairId);
 }
示例#7
0
 @Deactivate
 public void deactivate() {
   portPairStore.destroy();
   log.info("Stopped");
 }
示例#8
0
 @Override
 public PortPair getPortPair(PortPairId portPairId) {
   checkNotNull(portPairId, PORT_PAIR_ID_NULL);
   return portPairStore.get(portPairId);
 }