public class PortStatusEndpointMerger extends AbstractSingleEntityEndpoint<PortStatusEntity> implements ComponentEntityStatusMerger<PortStatusDTO>
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
INPUT_PORT_STATUS_URI_PATTERN |
static java.util.regex.Pattern |
OUTPUT_PORT_STATUS_URI_PATTERN |
Constructor and Description |
---|
PortStatusEndpointMerger() |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(java.net.URI uri,
java.lang.String method)
Indicates whether or not this EndpointResponseMapper can handle mapping responses
for the given URI and HTTP Method
|
protected java.lang.Class<PortStatusEntity> |
getEntityClass() |
protected void |
mergeResponses(PortStatusEntity clientEntity,
java.util.Map<NodeIdentifier,PortStatusEntity> entityMap,
java.util.Set<NodeResponse> successfulResponses,
java.util.Set<NodeResponse> problematicResponses)
Merges the responses from all nodes in the given map into the single given entity
|
void |
mergeStatus(PortStatusDTO clientStatus,
boolean clientStatusReadablePermission,
PortStatusDTO status,
boolean statusReadablePermission,
NodeIdentifier statusNodeIdentifier)
Merges status into clientStatus based on the given permissions.
|
merge
public static final java.util.regex.Pattern INPUT_PORT_STATUS_URI_PATTERN
public static final java.util.regex.Pattern OUTPUT_PORT_STATUS_URI_PATTERN
public boolean canHandle(java.net.URI uri, java.lang.String method)
EndpointResponseMerger
canHandle
in interface EndpointResponseMerger
uri
- the URI of the endpointmethod
- the HTTP Method used to interact with the endpointtrue
if the EndpointResponseMapper can handle mapping responses
for the endpoint described by the given URI and HTTP Methodprotected java.lang.Class<PortStatusEntity> getEntityClass()
getEntityClass
in class AbstractSingleEntityEndpoint<PortStatusEntity>
protected void mergeResponses(PortStatusEntity clientEntity, java.util.Map<NodeIdentifier,PortStatusEntity> entityMap, java.util.Set<NodeResponse> successfulResponses, java.util.Set<NodeResponse> problematicResponses)
AbstractSingleEntityEndpoint
mergeResponses
in class AbstractSingleEntityEndpoint<PortStatusEntity>
clientEntity
- the Entity to merge responses intoentityMap
- the responses from all nodessuccessfulResponses
- the responses from nodes that completed the request successfullyproblematicResponses
- the responses from nodes that did not complete the request successfullypublic void mergeStatus(PortStatusDTO clientStatus, boolean clientStatusReadablePermission, PortStatusDTO status, boolean statusReadablePermission, NodeIdentifier statusNodeIdentifier)
ComponentEntityStatusMerger
mergeStatus
in interface ComponentEntityStatusMerger<PortStatusDTO>
clientStatus
- The status that will be returned to the client after mergingclientStatusReadablePermission
- The read permission of the status that will be returned to the client after mergingstatus
- The status to be merged into the client statusstatusReadablePermission
- The read permission of the status to be merged into the client statusstatusNodeIdentifier
- The NodeIdentifier
of the node from which status was received