com.jakewharton.pingdom.services.ProbeService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pingdom-java Show documentation
Show all versions of pingdom-java Show documentation
A Java wrapper around the Pingdom RESTful API and a simple DSL for easy interaction.
The newest version!
package com.jakewharton.pingdom.services;
import java.util.List;
import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import com.jakewharton.pingdom.PingdomApiBuilder;
import com.jakewharton.pingdom.PingdomApiService;
import com.jakewharton.pingdom.entities.Probe;
/**
* Represents Pingdom's remote probe service.
*/
public class ProbeService extends PingdomApiService {
/**
* Returns a list of all Pingdom probe servers.
*
* @return Builder instance.
* @since 2.0
*/
public ListBuilder list() {
return new ListBuilder(this);
}
/**
* Request builder for {@link ProbeService#list()}.
*/
public static final class ListBuilder extends PingdomApiBuilder> {
private static final String URI = "/probes";
private ListBuilder(ProbeService service) {
super(service, new TypeToken>() {}, URI);
}
@Override
protected JsonElement execute() {
return super.execute().getAsJsonObject().get("probes").getAsJsonArray();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy