Codota Logo
Topic.getName
Code IndexAdd Codota to your IDE (free)

How to use
getName
method
in
com.google.api.services.pubsub.model.Topic

Best Java code snippets using com.google.api.services.pubsub.model.Topic.getName (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: Talend/components

public Set<String> listTopics() throws IOException {
  ListTopicsResponse listTopicsResponse = client.projects().topics().list(getProjectPath()).execute();
  List<Topic> topics = listTopicsResponse.getTopics();
  Set<String> topicsName = new HashSet<>();
  for (Topic topic : topics) {
    String topicName = topic.getName();
    String[] split = topicName.split("/");
    topicsName.add(split[3]);
  }
  return topicsName;
}
origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

@Override
public List<TopicPath> listTopics(ProjectPath project) throws IOException {
 Topics.List request = pubsub.projects().topics().list(project.getPath());
 ListTopicsResponse response = request.execute();
 if (response.getTopics() == null || response.getTopics().isEmpty()) {
  return ImmutableList.of();
 }
 List<TopicPath> topics = new ArrayList<>(response.getTopics().size());
 while (true) {
  for (Topic topic : response.getTopics()) {
   topics.add(topicPathFromPath(topic.getName()));
  }
  if (Strings.isNullOrEmpty(response.getNextPageToken())) {
   break;
  }
  request.setPageToken(response.getNextPageToken());
  response = request.execute();
 }
 return topics;
}
origin: org.apache.beam/beam-examples-java

 /** Create a topic if it doesn't exist. */
 public static void createTopic(Pubsub client, String fullTopicName) throws IOException {
  System.out.println("fullTopicName " + fullTopicName);
  try {
   client.projects().topics().get(fullTopicName).execute();
  } catch (GoogleJsonResponseException e) {
   if (e.getStatusCode() == HttpStatusCodes.STATUS_CODE_NOT_FOUND) {
    Topic topic = client.projects().topics().create(fullTopicName, new Topic()).execute();
    System.out.printf("Topic %s was created.%n", topic.getName());
   }
  }
 }
}
origin: GoogleCloudPlatform/cloud-pubsub-samples-java

/**
 * Creates a new topic with a given name.
 *
 * @param client Cloud Pub/Sub client.
 * @param args Command line arguments.
 * @throws IOException when Cloud Pub/Sub API calls fail.
 */
public static void createTopic(final Pubsub client, final String[] args)
    throws IOException {
  Main.checkArgsLength(args, 3);
  String topicName = PubsubUtils.getFullyQualifiedResourceName(
      PubsubUtils.ResourceType.TOPIC, args[0], args[2]);
  Topic topic = client.projects().topics()
      .create(topicName, new Topic())
      .execute();
  System.out.printf("Topic %s was created.\n", topic.getName());
}
origin: GoogleCloudPlatform/cloud-pubsub-samples-java

for (Topic topic : response.getTopics()) {
  hasTopics = true;
  System.out.println(topic.getName());
com.google.api.services.pubsub.modelTopicgetName

Javadoc

The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.

Popular methods of Topic

  • <init>
  • setName
    The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now