TypedRest for Java
Public Member Functions | List of all members
net.typedrest.PollingEndpoint< TEntity > Interface Template Reference

REST endpoint that represents an entity that can be polled for state changes. More...

Inheritance diagram for net.typedrest.PollingEndpoint< TEntity >:
net.typedrest.ElementEndpoint< TEntity > net.typedrest.Endpoint net.typedrest.PollingEndpointImpl< TEntity >

Public Member Functions

int getPollingInterval ()
 Gets the interval in which to send requests to the server. More...
 
void setPollingInterval (int interval)
 Sets the interval in which to send requests to the server. More...
 
StoppableObservable< TEntity > getObservable ()
 Provides an observable stream of element states. More...
 
- Public Member Functions inherited from net.typedrest.ElementEndpoint< TEntity >
Class< TEntity > getEntityType ()
 Returns the type of entity the endpoint represents. More...
 
TEntity read () throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Returns the specific TEntity. More...
 
boolean exists () throws IOException, IllegalAccessException
 Determines whether the entity currently exists. More...
 
Optional< Boolean > isSetAllowed ()
 Shows whether the server has indicated that set(java.lang.Object) is currently allowed. More...
 
TEntity set (TEntity entity) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Sets/replaces the TEntity. More...
 
default TEntity update (TEntity entity) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Sets/replaces the TEntity. More...
 
default TEntity update (Consumer< TEntity > updateAction) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Reads the current state of the entity, applies a change to it and stores the result. More...
 
default TEntity update (Consumer< TEntity > updateAction, int maxRetries) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Reads the current state of the entity, applies a change to it and stores the result. More...
 
Optional< Boolean > isMergeAllowed ()
 Shows whether the server has indicated that merge(java.lang.Object) is currently allowed. More...
 
TEntity merge (TEntity entity) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Modifies an existing TEntity by merging changes. More...
 
Optional< Boolean > isDeleteAllowed ()
 Shows whether the server has indicated that delete() is currently allowed. More...
 
void delete () throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Deletes the TEntity. More...
 
- Public Member Functions inherited from net.typedrest.Endpoint
URI getUri ()
 The HTTP URI of the remote resource. More...
 
Executor getExecutor ()
 The REST executor used to communicate with the remote resource. More...
 
ObjectMapper getSerializer ()
 Controls the serialization of entities sent to and received from the server. More...
 
Set< URI > getLinks (String rel)
 Retrieves all links with a specific relation type cached from the last request. More...
 
Map< URI, String > getLinksWithTitles (String rel)
 Retrieves all links (with titles) with a specific relation type cached from the last request. More...
 
URI link (String rel)
 Retrieves a single link with a specific relation type. More...
 
UriTemplate linkTemplate (String rel)
 Retrieves a link template with a specific relation type. More...
 
default URI linkTemplate (String rel, String variableName, Object value)
 Retrieves a link template with a specific relation type and resolves it. More...
 

Detailed Description

REST endpoint that represents an entity that can be polled for state changes.

Parameters
<TEntity>The type of entity the endpoint represents.

Member Function Documentation

◆ getObservable()

StoppableObservable<TEntity> net.typedrest.PollingEndpoint< TEntity >.getObservable ( )

Provides an observable stream of element states.

Compares entities using Object#equals(java.lang.Object) to detect changes.

Returns
An observable stream of element states.

Implemented in net.typedrest.PollingEndpointImpl< TEntity >.

◆ getPollingInterval()

int net.typedrest.PollingEndpoint< TEntity >.getPollingInterval ( )

Gets the interval in which to send requests to the server.

The server can modify this value using the "Retry-After" header.

Returns
An interval in seconds.

◆ setPollingInterval()

void net.typedrest.PollingEndpoint< TEntity >.setPollingInterval ( int  interval)

Sets the interval in which to send requests to the server.

The server can modify this value using the "Retry-After" header.

Parameters
intervalAn interval in seconds.

The documentation for this interface was generated from the following file: