Tabnine Logo
EndpointGroupDao.removeTopicFromEndpointGroup
Code IndexAdd Tabnine to your IDE (free)

How to use
removeTopicFromEndpointGroup
method
in
org.kaaproject.kaa.server.common.dao.impl.EndpointGroupDao

Best Java code snippets using org.kaaproject.kaa.server.common.dao.impl.EndpointGroupDao.removeTopicFromEndpointGroup (Showing top 2 results out of 315)

origin: kaaproject/kaa

@Test
public void removeTopicFromEndpointGroup() {
 Topic first = generateTopic(null, null, "first");
 Topic second = generateTopic(first.getApplication(), null, "second");
 Topic third = generateTopic(first.getApplication(), null, "third");
 Set<Topic> topics = new HashSet<>();
 topics.add(first);
 topics.add(second);
 topics.add(third);
 EndpointGroup endpointGroup = generateEndpointGroup(first.getApplication(), topics);
 Assert.assertEquals(3, endpointGroup.getTopics().size());
 endpointGroupDao.removeTopicFromEndpointGroup(endpointGroup.getId().toString(), first.getId().toString());
 EndpointGroup group = endpointGroupDao.removeTopicFromEndpointGroup(endpointGroup.getId().toString(), second.getId().toString());
 Set<Topic> expected = new HashSet<>();
 expected.add(third);
 Assert.assertEquals(expected, group.getTopics());
}
origin: kaaproject/kaa

@Override
@Transactional
public UpdateNotificationDto<EndpointGroupDto> removeTopicFromEndpointGroup(String id, String
    topicId) {
 validateSqlId(id, "Can't remove endpoint group topics "
          + topicId
          + ". Incorrect endpoint group id."
          + id);
 UpdateNotificationDto<EndpointGroupDto> dto = null;
 EndpointGroup endpointGroup = endpointGroupDao.removeTopicFromEndpointGroup(id, topicId);
 if (endpointGroup
   != null) {
  dto = new UpdateNotificationDto<>();
  HistoryDto history = addHistory(endpointGroup.toDto(), ChangeType.REMOVE_TOPIC, topicId);
  if (history
    != null) {
   dto.setAppId(history.getApplicationId());
   dto.setAppSeqNumber(history.getSequenceNumber());
  }
  dto.setChangeType(ChangeType.REMOVE_TOPIC);
  dto.setTopicId(topicId);
  dto.setGroupId(endpointGroup.getId().toString());
  dto.setPayload(endpointGroup.toDto());
 } else {
  LOG.debug("Can't remove topic [{}] from endpoint group [{}]", topicId, id);
 }
 return dto;
}
org.kaaproject.kaa.server.common.dao.implEndpointGroupDaoremoveTopicFromEndpointGroup

Javadoc

Removes the topic from endpoint group.

Popular methods of EndpointGroupDao

  • addTopicToEndpointGroup
    Adds the topic to endpoint group.
  • findByAppIdAndName
    Find endpoint group by application id and group name. This method used for validation. For one appli
  • findByAppIdAndWeight
    Find endpoint group by application id and weight. This method used for validation. For one applicati
  • findByApplicationId
    Find endpoint group by application id.
  • findById
  • findEndpointGroupsByTopicIdAndAppId
    Find endpoint groups by topic id and application id.
  • removeById
  • save

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now