Package com.mtnfog.philter
Class FilterProfileRegistryClient
- java.lang.Object
-
- com.mtnfog.philter.FilterProfileRegistryClient
-
public class FilterProfileRegistryClient extends java.lang.Object
Client class for managing filter profiles either with Philter or with a Philter Profile Registry.
-
-
Field Summary
Fields Modifier and Type Field Description static int
KEEP_ALIVE_DURATION_MS
static int
MAX_IDLE_CONNECTIONS
static int
TIMEOUT_SEC
-
Constructor Summary
Constructors Constructor Description FilterProfileRegistryClient(java.lang.String endpoint)
Creates a new client.FilterProfileRegistryClient(java.lang.String endpoint, okhttp3.OkHttpClient okHttpClient)
Creates a new client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete(java.lang.String filterProfileName)
Deletes a filter profile.java.util.List<java.lang.String>
get()
Gets a list of filter profile names.java.lang.String
get(java.lang.String filterProfileName)
Gets the content of a filter profile.boolean
save(java.lang.String json)
Saves (or overwrites) the filter profile.StatusResponse
status()
Gets the status of Philter or the Filter Profile Registry.
-
-
-
Field Detail
-
TIMEOUT_SEC
public static final int TIMEOUT_SEC
- See Also:
- Constant Field Values
-
MAX_IDLE_CONNECTIONS
public static final int MAX_IDLE_CONNECTIONS
- See Also:
- Constant Field Values
-
KEEP_ALIVE_DURATION_MS
public static final int KEEP_ALIVE_DURATION_MS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FilterProfileRegistryClient
public FilterProfileRegistryClient(java.lang.String endpoint)
Creates a new client.- Parameters:
endpoint
- The Philter endpoint or the Filter Profile Registry endpoint, e.g.https://127.0.0.1:8080
.
-
FilterProfileRegistryClient
public FilterProfileRegistryClient(java.lang.String endpoint, okhttp3.OkHttpClient okHttpClient)
Creates a new client.- Parameters:
endpoint
- The Philter endpoint or the Filter Profile Registry endpoint, e.g.https://127.0.0.1:8080
.okHttpClient
- A customOkHttpClient
.
-
-
Method Detail
-
status
public StatusResponse status() throws java.io.IOException
Gets the status of Philter or the Filter Profile Registry.- Returns:
- The
StatusResponse
. - Throws:
java.io.IOException
- Thrown if the call not be executed.
-
get
public java.util.List<java.lang.String> get() throws java.io.IOException
Gets a list of filter profile names.- Returns:
- A list of filter profile names.
- Throws:
java.io.IOException
- Thrown if the call not be executed.
-
get
public java.lang.String get(java.lang.String filterProfileName) throws java.io.IOException
Gets the content of a filter profile.- Parameters:
filterProfileName
- The name of the filter profile to get.- Returns:
- The content of the filter profile.
- Throws:
java.io.IOException
- Thrown if the call not be executed.
-
save
public boolean save(java.lang.String json) throws java.io.IOException
Saves (or overwrites) the filter profile.- Parameters:
json
- The body of the filter profile.- Returns:
true
if successful, otherwisefalse
.- Throws:
java.io.IOException
- Thrown if the call not be executed.
-
delete
public boolean delete(java.lang.String filterProfileName) throws java.io.IOException
Deletes a filter profile.- Parameters:
filterProfileName
- The name of the filter profile to delete.- Returns:
true
if successful, otherwisefalse
.- Throws:
java.io.IOException
- Thrown if the call not be executed.
-
-