Class ProxyQueryEvent
- java.lang.Object
-
- com.velocitypowered.api.event.query.ProxyQueryEvent
-
@AwaitingEvent public final class ProxyQueryEvent extends Object
This event is fired if proxy is getting queried over GS4 Query protocol. Velocity will wait on this event to fire before providing a response to the client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProxyQueryEvent.QueryType
Represents the type of query the client is asking for.
-
Constructor Summary
Constructors Constructor Description ProxyQueryEvent(ProxyQueryEvent.QueryType queryType, InetAddress querierAddress, QueryResponse response)
Creates a new event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InetAddress
getQuerierAddress()
Get the address of the client that sent this query.ProxyQueryEvent.QueryType
getQueryType()
Returns the kind of query the remote client is performing.QueryResponse
getResponse()
Returns the current query response.void
setResponse(QueryResponse response)
Sets a new query response.String
toString()
-
-
-
Constructor Detail
-
ProxyQueryEvent
public ProxyQueryEvent(ProxyQueryEvent.QueryType queryType, InetAddress querierAddress, QueryResponse response)
Creates a new event.- Parameters:
queryType
- the type of queryquerierAddress
- the remote address for the queryresponse
- the current query response
-
-
Method Detail
-
getQueryType
public ProxyQueryEvent.QueryType getQueryType()
Returns the kind of query the remote client is performing.- Returns:
- query type
-
getQuerierAddress
public InetAddress getQuerierAddress()
Get the address of the client that sent this query.- Returns:
- querier address
-
getResponse
public QueryResponse getResponse()
Returns the current query response.- Returns:
- the current query response
-
setResponse
public void setResponse(QueryResponse response)
Sets a new query response.- Parameters:
response
- the new non-null query response
-
-