@Override public void deleteById(String id) { this.sessions.remove(id); }
@Override public void delete(final String id) { sessions.remove(id); }
@Override public void remove(String region, String key) { IMap<String, Object> cacheRegion = getRegion(region); cacheRegion.remove(key); }
@Test public void delete() { verify(this.sessions, times(1)).addEntryListener(any(MapListener.class), anyBoolean()); String sessionId = "testSessionId"; this.repository.deleteById(sessionId); verify(this.sessions, times(1)).remove(eq(sessionId)); verifyZeroInteractions(this.sessions); }
@Test public void getSessionExpired() { verify(this.sessions, times(1)).addEntryListener(any(MapListener.class), anyBoolean()); MapSession expired = new MapSession(); expired.setLastAccessedTime(Instant.now() .minusSeconds(MapSession.DEFAULT_MAX_INACTIVE_INTERVAL_SECONDS + 1)); given(this.sessions.get(eq(expired.getId()))).willReturn(expired); HazelcastSession session = this.repository.findById(expired.getId()); assertThat(session).isNull(); verify(this.sessions, times(1)).get(eq(expired.getId())); verify(this.sessions, times(1)).remove(eq(expired.getId())); verifyZeroInteractions(this.sessions); }
@Override public void delete(String sessionId) { this.sessions.remove(sessionId); } }
@Override public boolean deleteTicket(String ticketId) { logger.debug("Removing Ticket[{}] from the Hazelcast IMap", ticketId); return this.ticketsMap.remove(ticketId) != null; }
public void run() { IMap map = hazelcast.getMap("myMap"); map.remove(random.nextInt(SIZE)); } }, 10);
@RequestMapping("/remove") public CommandResponse remove(@RequestParam(value = "key") String key) { IMap<String, String> map = hazelcastClient.getMap("map"); String value = map.remove(key); return new CommandResponse(value); }
@RequestMapping("/remove") public CommandResponse remove(@RequestParam(value = "key") String key) { IMap<String, String> map = hazelcastClient.getMap("map"); String value = map.remove(key); return new CommandResponse(value); }
/** * Deletes the record associated with key. * * @param key The key to remove. * @return {@literal true}, if record was exist; otherwise, {@literal false}. */ @Override public boolean delete(final Comparable<?> key) { return getDistributedObject().remove(key) != null; }
@Override public boolean delete( String id ) throws Exception { return sessionDataMap == null ? false : sessionDataMap.remove( getCacheKey( id ) ) != null; }
@Override public void invalidateAll(Iterable<?> keys) { if (available()) { for (Object k : keys) { hzMap.remove(String.valueOf(k)); } } }
@RequestMapping("/remove") public CommandResponse remove(@RequestParam(value = "key") String key) { IMap<String, String> map = hazelcastInstance.getMap("map"); String value = map.remove(key); return new CommandResponse(value); }
@RequestMapping("/remove") public CommandResponse remove(@RequestParam(value = "key") String key) { IMap<String, String> map = hazelcastInstance.getMap("map"); String value = map.remove(key); return new CommandResponse(value); }
@Override public void remove() { if (result == null || currentIndex < 0) { throw new IllegalStateException("Iterator.next() must be called before remove()!"); } Data keyData = getKey(currentIndex); map.remove(keyData); currentIndex = -1; }
@Override public void remove(String key) throws SiteWhereException { if (getParent().getLifecycleStatus() == LifecycleStatus.Started) { hMap.remove(key); } else { throw new SiteWhereException("Cache put() called after shutdown."); } }
public void remove(String identifier) { if (!StringUtils.isEmpty(identifier) && getCacheMap().containsKey(identifier)) { getCacheMap().remove(identifier); } }
public void remove(String identifier) { if (!StringUtils.isEmpty(identifier) && getCacheMap().containsKey(identifier)) { getCacheMap().remove(identifier); } }
@Override protected void update(NoSqlSession session, String newClusterId, String newNodeId) throws Exception { HazelcastSessionData sessionData = sessions.get(session.getClusterId()); sessions.set(newClusterId, sessionData); sessions.remove(session.getClusterId()); }