|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EndpointFilter
An EndpointFilter plug-in is invoked after the Dynamic Assembler has performed all its policy matching and has given a policy matching score to all the endpoints, but before an endpoint is selected. It is invoked with the entire list of all candidates that have been considered. For each such endpoint, the following items are also provided:
The plug-in is then free to take the following actions:
If an endpoint is rejected, then it will no longer be considered as a potential handler for the request. Otherwise, if the plug-in assigns tiers, then all other scoring, etc., is ignored. Every endpoint in the same tier will be considered equivalent for the purposes of finding an endpoint to handle the request.
For example, if the following shows the resulting tiers after calling an Endpoint Filter plug-in:
Endpoint name | Tier |
---|---|
A | 2 |
B | 3 |
C | 2 |
D | 4 |
Then endpoints A and C will be chosen from first for handling the request, with the requests being routed in a round-robin fashion. If neither A nor C are available (e.g. they are both inoperative due to limitations on the hours of operation), then endpoint B will be tried next. Endpoint D will only be chosen if all the others are unavailable.
A sample implementation
public CandidateList filterCandidates(CandidateList cl) { for (int i=0; i<cl.getCandidateCount(); i++) { CandidateItem item = cl.getCandidate(i); if (item.isRejected()) { continue; } if (item.getAddress().contains("UseMe")) { item.setTier(1); } else if (item.getCost().getCostPerMinute() < 1.0) { item.setTier(2); } else if (item.getCost().getCostPerMinute() > 100.0) { item.reject("Too expensive"); } else { item.setTier(3); } } // Return updates to DA return cl; }
Method Summary | |
---|---|
CandidateList |
filterCandidates(CandidateList candidates)
Called after the DA has performed all its policy matching and has given a policy matching score to all the endpoints, in order to allow the candidate list of endpoints to be modified. |
Method Detail |
---|
CandidateList filterCandidates(CandidateList candidates)
candidates
- A CandidateList that contains the following data items for each candidate endpoint:
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |