@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; }
@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; }
@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; }
@Override public Iterable<PortPair> getPortPairs() { return Collections.unmodifiableCollection(portPairStore.values()); }
@Override public int getPortPairCount() { return portPairStore.size(); }
@Override public boolean exists(PortPairId portPairId) { checkNotNull(portPairId, PORT_PAIR_ID_NULL); return portPairStore.containsKey(portPairId); }
@Deactivate public void deactivate() { portPairStore.destroy(); log.info("Stopped"); }
@Override public PortPair getPortPair(PortPairId portPairId) { checkNotNull(portPairId, PORT_PAIR_ID_NULL); return portPairStore.get(portPairId); }