test_class.declarator: store
test_class.original_string: RegistrationStore store;
test_class.type: RegistrationStore
test_class.var_name: store
test_class.declarator: ep = "urn:endpoint"
test_class.original_string: String ep = "urn:endpoint";
test_class.type: String
test_class.var_name: ep
test_class.declarator: address
test_class.original_string: InetAddress address;
test_class.type: InetAddress
test_class.var_name: address
test_class.declarator: port = 23452
test_class.original_string: int port = 23452;
test_class.type: int
test_class.var_name: port
test_class.declarator: lifetime = 10000L
test_class.original_string: Long lifetime = 10000L;
test_class.type: Long
test_class.var_name: lifetime
test_class.declarator: sms = "0171-32423545"
test_class.original_string: String sms = "0171-32423545";
test_class.type: String
test_class.var_name: sms
test_class.declarator: binding = BindingMode.UQS
test_class.original_string: BindingMode binding = BindingMode.UQS;
test_class.type: BindingMode
test_class.var_name: binding
test_class.declarator: objectLinks = Link.parse("</3>".getBytes(StandardCharsets.UTF_8))
test_class.original_string: Link[] objectLinks = Link.parse("</3>".getBytes(StandardCharsets.UTF_8));
test_class.type: Link[]
test_class.var_name: objectLinks
test_class.declarator: registrationId = "4711"
test_class.original_string: String registrationId = "4711";
test_class.type: String
test_class.var_name: registrationId
test_class.declarator: registration
test_class.original_string: Registration registration;
test_class.type: Registration
test_class.var_name: registration
test_class.file: leshan-server-cf/src/test/java/org/eclipse/leshan/server/californium/registration/InMemoryRegistrationStoreTest.java
test_class.identifier: InMemoryRegistrationStoreTest
test_case.body: @Test
      public void client_registration_sets_time_to_live() {
          givenASimpleRegistration(lifetime);
          store.addRegistration(registration);
          Assert.assertTrue(registration.isAlive());
      }
test_case.class_method_signature: InMemoryRegistrationStoreTest.client_registration_sets_time_to_live()
test_case.full_signature: @Test public void client_registration_sets_time_to_live()
test_case.identifier: client_registration_sets_time_to_live
test_case.invocations: givenASimpleRegistration addRegistration assertTrue isAlive
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void client_registration_sets_time_to_live()
focal_class.declarator: LOG = LoggerFactory.getLogger(InMemoryRegistrationStore.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger LOG = LoggerFactory.getLogger(InMemoryRegistrationStore.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: regsByEp = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String /* end-point */, Registration> regsByEp = new HashMap<>();
focal_class.type: Map<String /* end-point */, Registration>
focal_class.var_name: regsByEp
focal_class.declarator: regsByAddr = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<InetSocketAddress, Registration> regsByAddr = new HashMap<>();
focal_class.type: Map<InetSocketAddress, Registration>
focal_class.var_name: regsByAddr
focal_class.declarator: regsByRegId = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String /* reg-id */, Registration> regsByRegId = new HashMap<>();
focal_class.type: Map<String /* reg-id */, Registration>
focal_class.var_name: regsByRegId
focal_class.declarator: obsByToken = new HashMap<>()
focal_class.modifier: private
focal_class.original_string: private Map<Token, org.eclipse.californium.core.observe.Observation> obsByToken = new HashMap<>();
focal_class.type: Map<Token, org.eclipse.californium.core.observe.Observation>
focal_class.var_name: obsByToken
focal_class.declarator: tokensByRegId = new HashMap<>()
focal_class.modifier: private
focal_class.original_string: private Map<String, Set<Token>> tokensByRegId = new HashMap<>();
focal_class.type: Map<String, Set<Token>>
focal_class.var_name: tokensByRegId
focal_class.declarator: lock = new ReentrantReadWriteLock()
focal_class.modifier: private final
focal_class.original_string: private final ReadWriteLock lock = new ReentrantReadWriteLock();
focal_class.type: ReadWriteLock
focal_class.var_name: lock
focal_class.declarator: expirationListener
focal_class.modifier: private
focal_class.original_string: private ExpirationListener expirationListener;
focal_class.type: ExpirationListener
focal_class.var_name: expirationListener
focal_class.declarator: schedExecutor
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService schedExecutor;
focal_class.type: ScheduledExecutorService
focal_class.var_name: schedExecutor
focal_class.declarator: cleanerTask
focal_class.modifier: private
focal_class.original_string: private ScheduledFuture<?> cleanerTask;
focal_class.type: ScheduledFuture<?>
focal_class.var_name: cleanerTask
focal_class.declarator: started = false
focal_class.modifier: private
focal_class.original_string: private boolean started = false;
focal_class.type: boolean
focal_class.var_name: started
focal_class.declarator: cleanPeriod
focal_class.modifier: private final
focal_class.original_string: private final long cleanPeriod;
focal_class.type: long
focal_class.var_name: cleanPeriod
focal_class.file: leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/registration/InMemoryRegistrationStore.java
focal_class.identifier: InMemoryRegistrationStore
focal_class.interfaces: implements CaliforniumRegistrationStore, Startable, Stoppable, Destroyable
focal_class.class_method_signature: InMemoryRegistrationStore.InMemoryRegistrationStore()
focal_class.full_signature: public  InMemoryRegistrationStore()
focal_class.identifier: InMemoryRegistrationStore
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  InMemoryRegistrationStore()
focal_class.class_method_signature: InMemoryRegistrationStore.InMemoryRegistrationStore(long cleanPeriodInSec)
focal_class.full_signature: public  InMemoryRegistrationStore(long cleanPeriodInSec)
focal_class.identifier: InMemoryRegistrationStore
focal_class.modifiers: public
focal_class.parameters: (long cleanPeriodInSec)
focal_class.signature:  InMemoryRegistrationStore(long cleanPeriodInSec)
focal_class.class_method_signature: InMemoryRegistrationStore.InMemoryRegistrationStore(ScheduledExecutorService schedExecutor, long cleanPeriodInSec)
focal_class.full_signature: public  InMemoryRegistrationStore(ScheduledExecutorService schedExecutor, long cleanPeriodInSec)
focal_class.identifier: InMemoryRegistrationStore
focal_class.modifiers: public
focal_class.parameters: (ScheduledExecutorService schedExecutor, long cleanPeriodInSec)
focal_class.signature:  InMemoryRegistrationStore(ScheduledExecutorService schedExecutor, long cleanPeriodInSec)
focal_class.class_method_signature: InMemoryRegistrationStore.addRegistration(Registration registration)
focal_class.full_signature: @Override public Deregistration addRegistration(Registration registration)
focal_class.identifier: addRegistration
focal_class.modifiers: @Override public
focal_class.parameters: (Registration registration)
focal_class.return: Deregistration
focal_class.signature: Deregistration addRegistration(Registration registration)
focal_class.class_method_signature: InMemoryRegistrationStore.updateRegistration(RegistrationUpdate update)
focal_class.full_signature: @Override public UpdatedRegistration updateRegistration(RegistrationUpdate update)
focal_class.identifier: updateRegistration
focal_class.modifiers: @Override public
focal_class.parameters: (RegistrationUpdate update)
focal_class.return: UpdatedRegistration
focal_class.signature: UpdatedRegistration updateRegistration(RegistrationUpdate update)
focal_class.class_method_signature: InMemoryRegistrationStore.getRegistration(String registrationId)
focal_class.full_signature: @Override public Registration getRegistration(String registrationId)
focal_class.identifier: getRegistration
focal_class.modifiers: @Override public
focal_class.parameters: (String registrationId)
focal_class.return: Registration
focal_class.signature: Registration getRegistration(String registrationId)
focal_class.class_method_signature: InMemoryRegistrationStore.getRegistrationByEndpoint(String endpoint)
focal_class.full_signature: @Override public Registration getRegistrationByEndpoint(String endpoint)
focal_class.identifier: getRegistrationByEndpoint
focal_class.modifiers: @Override public
focal_class.parameters: (String endpoint)
focal_class.return: Registration
focal_class.signature: Registration getRegistrationByEndpoint(String endpoint)
focal_class.class_method_signature: InMemoryRegistrationStore.getRegistrationByAdress(InetSocketAddress address)
focal_class.full_signature: @Override public Registration getRegistrationByAdress(InetSocketAddress address)
focal_class.identifier: getRegistrationByAdress
focal_class.modifiers: @Override public
focal_class.parameters: (InetSocketAddress address)
focal_class.return: Registration
focal_class.signature: Registration getRegistrationByAdress(InetSocketAddress address)
focal_class.class_method_signature: InMemoryRegistrationStore.getAllRegistrations()
focal_class.full_signature: @Override public Iterator<Registration> getAllRegistrations()
focal_class.identifier: getAllRegistrations
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Iterator<Registration>
focal_class.signature: Iterator<Registration> getAllRegistrations()
focal_class.class_method_signature: InMemoryRegistrationStore.removeRegistration(String registrationId)
focal_class.full_signature: @Override public Deregistration removeRegistration(String registrationId)
focal_class.identifier: removeRegistration
focal_class.modifiers: @Override public
focal_class.parameters: (String registrationId)
focal_class.return: Deregistration
focal_class.signature: Deregistration removeRegistration(String registrationId)
focal_class.class_method_signature: InMemoryRegistrationStore.addObservation(String registrationId, Observation observation)
focal_class.full_signature: @Override public Collection<Observation> addObservation(String registrationId, Observation observation)
focal_class.identifier: addObservation
focal_class.modifiers: @Override public
focal_class.parameters: (String registrationId, Observation observation)
focal_class.return: Collection<Observation>
focal_class.signature: Collection<Observation> addObservation(String registrationId, Observation observation)
focal_class.class_method_signature: InMemoryRegistrationStore.removeObservation(String registrationId, byte[] observationId)
focal_class.full_signature: @Override public Observation removeObservation(String registrationId, byte[] observationId)
focal_class.identifier: removeObservation
focal_class.modifiers: @Override public
focal_class.parameters: (String registrationId, byte[] observationId)
focal_class.return: Observation
focal_class.signature: Observation removeObservation(String registrationId, byte[] observationId)
focal_class.class_method_signature: InMemoryRegistrationStore.getObservation(String registrationId, byte[] observationId)
focal_class.full_signature: @Override public Observation getObservation(String registrationId, byte[] observationId)
focal_class.identifier: getObservation
focal_class.modifiers: @Override public
focal_class.parameters: (String registrationId, byte[] observationId)
focal_class.return: Observation
focal_class.signature: Observation getObservation(String registrationId, byte[] observationId)
focal_class.class_method_signature: InMemoryRegistrationStore.getObservations(String registrationId)
focal_class.full_signature: @Override public Collection<Observation> getObservations(String registrationId)
focal_class.identifier: getObservations
focal_class.modifiers: @Override public
focal_class.parameters: (String registrationId)
focal_class.return: Collection<Observation>
focal_class.signature: Collection<Observation> getObservations(String registrationId)
focal_class.class_method_signature: InMemoryRegistrationStore.removeObservations(String registrationId)
focal_class.full_signature: @Override public Collection<Observation> removeObservations(String registrationId)
focal_class.identifier: removeObservations
focal_class.modifiers: @Override public
focal_class.parameters: (String registrationId)
focal_class.return: Collection<Observation>
focal_class.signature: Collection<Observation> removeObservations(String registrationId)
focal_class.class_method_signature: InMemoryRegistrationStore.putIfAbsent(Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.full_signature: @Override public org.eclipse.californium.core.observe.Observation putIfAbsent(Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.identifier: putIfAbsent
focal_class.modifiers: @Override public
focal_class.parameters: (Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.return: org.eclipse.californium.core.observe.Observation
focal_class.signature: org.eclipse.californium.core.observe.Observation putIfAbsent(Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.class_method_signature: InMemoryRegistrationStore.put(Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.full_signature: @Override public org.eclipse.californium.core.observe.Observation put(Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.identifier: put
focal_class.modifiers: @Override public
focal_class.parameters: (Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.return: org.eclipse.californium.core.observe.Observation
focal_class.signature: org.eclipse.californium.core.observe.Observation put(Token token,
              org.eclipse.californium.core.observe.Observation obs)
focal_class.class_method_signature: InMemoryRegistrationStore.add(Token token,
              org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent)
focal_class.full_signature: private org.eclipse.californium.core.observe.Observation add(Token token,
              org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent)
focal_class.identifier: add
focal_class.modifiers: private
focal_class.parameters: (Token token,
              org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent)
focal_class.return: org.eclipse.californium.core.observe.Observation
focal_class.signature: org.eclipse.californium.core.observe.Observation add(Token token,
              org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent)
focal_class.class_method_signature: InMemoryRegistrationStore.get(Token token)
focal_class.full_signature: @Override public org.eclipse.californium.core.observe.Observation get(Token token)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (Token token)
focal_class.return: org.eclipse.californium.core.observe.Observation
focal_class.signature: org.eclipse.californium.core.observe.Observation get(Token token)
focal_class.class_method_signature: InMemoryRegistrationStore.setContext(Token token, EndpointContext ctx)
focal_class.full_signature: @Override public void setContext(Token token, EndpointContext ctx)
focal_class.identifier: setContext
focal_class.modifiers: @Override public
focal_class.parameters: (Token token, EndpointContext ctx)
focal_class.return: void
focal_class.signature: void setContext(Token token, EndpointContext ctx)
focal_class.class_method_signature: InMemoryRegistrationStore.remove(Token token)
focal_class.full_signature: @Override public void remove(Token token)
focal_class.identifier: remove
focal_class.modifiers: @Override public
focal_class.parameters: (Token token)
focal_class.return: void
focal_class.signature: void remove(Token token)
focal_class.class_method_signature: InMemoryRegistrationStore.unsafeGetObservation(Token token)
focal_class.full_signature: private org.eclipse.californium.core.observe.Observation unsafeGetObservation(Token token)
focal_class.identifier: unsafeGetObservation
focal_class.modifiers: private
focal_class.parameters: (Token token)
focal_class.return: org.eclipse.californium.core.observe.Observation
focal_class.signature: org.eclipse.californium.core.observe.Observation unsafeGetObservation(Token token)
focal_class.class_method_signature: InMemoryRegistrationStore.unsafeRemoveObservation(Token observationId)
focal_class.full_signature: private void unsafeRemoveObservation(Token observationId)
focal_class.identifier: unsafeRemoveObservation
focal_class.modifiers: private
focal_class.parameters: (Token observationId)
focal_class.return: void
focal_class.signature: void unsafeRemoveObservation(Token observationId)
focal_class.class_method_signature: InMemoryRegistrationStore.unsafeRemoveAllObservations(String registrationId)
focal_class.full_signature: private Collection<Observation> unsafeRemoveAllObservations(String registrationId)
focal_class.identifier: unsafeRemoveAllObservations
focal_class.modifiers: private
focal_class.parameters: (String registrationId)
focal_class.return: Collection<Observation>
focal_class.signature: Collection<Observation> unsafeRemoveAllObservations(String registrationId)
focal_class.class_method_signature: InMemoryRegistrationStore.unsafeGetObservations(String registrationId)
focal_class.full_signature: private Collection<Observation> unsafeGetObservations(String registrationId)
focal_class.identifier: unsafeGetObservations
focal_class.modifiers: private
focal_class.parameters: (String registrationId)
focal_class.return: Collection<Observation>
focal_class.signature: Collection<Observation> unsafeGetObservations(String registrationId)
focal_class.class_method_signature: InMemoryRegistrationStore.build(org.eclipse.californium.core.observe.Observation cfObs)
focal_class.full_signature: private Observation build(org.eclipse.californium.core.observe.Observation cfObs)
focal_class.identifier: build
focal_class.modifiers: private
focal_class.parameters: (org.eclipse.californium.core.observe.Observation cfObs)
focal_class.return: Observation
focal_class.signature: Observation build(org.eclipse.californium.core.observe.Observation cfObs)
focal_class.class_method_signature: InMemoryRegistrationStore.validateObservation(org.eclipse.californium.core.observe.Observation observation)
focal_class.full_signature: private String validateObservation(org.eclipse.californium.core.observe.Observation observation)
focal_class.identifier: validateObservation
focal_class.modifiers: private
focal_class.parameters: (org.eclipse.californium.core.observe.Observation observation)
focal_class.return: String
focal_class.signature: String validateObservation(org.eclipse.californium.core.observe.Observation observation)
focal_class.class_method_signature: InMemoryRegistrationStore.setExpirationListener(ExpirationListener listener)
focal_class.full_signature: @Override public void setExpirationListener(ExpirationListener listener)
focal_class.identifier: setExpirationListener
focal_class.modifiers: @Override public
focal_class.parameters: (ExpirationListener listener)
focal_class.return: void
focal_class.signature: void setExpirationListener(ExpirationListener listener)
focal_class.class_method_signature: InMemoryRegistrationStore.start()
focal_class.full_signature: @Override public synchronized void start()
focal_class.identifier: start
focal_class.modifiers: @Override public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void start()
focal_class.class_method_signature: InMemoryRegistrationStore.stop()
focal_class.full_signature: @Override public synchronized void stop()
focal_class.identifier: stop
focal_class.modifiers: @Override public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void stop()
focal_class.class_method_signature: InMemoryRegistrationStore.destroy()
focal_class.full_signature: @Override public synchronized void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: InMemoryRegistrationStore.removeFromMap(Map<K, V> map, K key, V value)
focal_class.full_signature: protected boolean removeFromMap(Map<K, V> map, K key, V value)
focal_class.identifier: removeFromMap
focal_class.modifiers: protected
focal_class.parameters: (Map<K, V> map, K key, V value)
focal_class.return: boolean
focal_class.signature: boolean removeFromMap(Map<K, V> map, K key, V value)
focal_class.class_method_signature: InMemoryRegistrationStore.setExecutor(ScheduledExecutorService executor)
focal_class.full_signature: @Override public void setExecutor(ScheduledExecutorService executor)
focal_class.identifier: setExecutor
focal_class.modifiers: @Override public
focal_class.parameters: (ScheduledExecutorService executor)
focal_class.return: void
focal_class.signature: void setExecutor(ScheduledExecutorService executor)
focal_method.body: @Override
      public Deregistration addRegistration(Registration registration) {
          try {
              lock.writeLock().lock();
  
              Registration registrationRemoved = regsByEp.put(registration.getEndpoint(), registration);
              regsByRegId.put(registration.getId(), registration);
              // If a registration is already associated to this address we don't care as we only want to keep the most
              // recent binding.
              regsByAddr.put(registration.getSocketAddress(), registration);
              if (registrationRemoved != null) {
                  Collection<Observation> observationsRemoved = unsafeRemoveAllObservations(registrationRemoved.getId());
                  if (!registrationRemoved.getSocketAddress().equals(registration.getSocketAddress())) {
                      removeFromMap(regsByAddr, registrationRemoved.getSocketAddress(), registrationRemoved);
                  }
                  if (!registrationRemoved.getId().equals(registration.getId())) {
                      removeFromMap(regsByRegId, registrationRemoved.getId(), registrationRemoved);
                  }
                  return new Deregistration(registrationRemoved, observationsRemoved);
              }
          } finally {
              lock.writeLock().unlock();
          }
          return null;
      }
focal_method.class_method_signature: InMemoryRegistrationStore.addRegistration(Registration registration)
focal_method.full_signature: @Override public Deregistration addRegistration(Registration registration)
focal_method.identifier: addRegistration
focal_method.invocations: lock writeLock put getEndpoint put getId put getSocketAddress unsafeRemoveAllObservations getId equals getSocketAddress getSocketAddress removeFromMap getSocketAddress equals getId getId removeFromMap getId unlock writeLock
focal_method.modifiers: @Override public
focal_method.parameters: (Registration registration)
focal_method.return: Deregistration
focal_method.signature: Deregistration addRegistration(Registration registration)