Search in sources :

Example 1 with RemoteDeflectorResource

use of org.graylog2.shared.rest.resources.system.RemoteDeflectorResource in project graylog2-server by Graylog2.

the class ClusterDeflectorResource method getDeflectorResource.

private RemoteDeflectorResource getDeflectorResource() {
    final Node master = findMasterNode();
    final Function<String, Optional<RemoteDeflectorResource>> remoteInterfaceProvider = createRemoteInterfaceProvider(RemoteDeflectorResource.class);
    final Optional<RemoteDeflectorResource> deflectorResource = remoteInterfaceProvider.apply(master.getNodeId());
    return deflectorResource.orElseThrow(() -> new InternalServerErrorException("Unable to get remote deflector resource."));
}
Also used : RemoteDeflectorResource(org.graylog2.shared.rest.resources.system.RemoteDeflectorResource) Optional(java.util.Optional) Node(org.graylog2.cluster.Node) InternalServerErrorException(javax.ws.rs.InternalServerErrorException)

Aggregations

Optional (java.util.Optional)1 InternalServerErrorException (javax.ws.rs.InternalServerErrorException)1 Node (org.graylog2.cluster.Node)1 RemoteDeflectorResource (org.graylog2.shared.rest.resources.system.RemoteDeflectorResource)1