public class RouterImpl extends Object implements IRouter
Modifier and Type | Class and Description |
---|---|
protected class |
RouterImpl.AnswerEntry |
protected class |
RouterImpl.RedirectEntry |
Modifier and Type | Field and Description |
---|---|
static int |
ALL_APPLICATION |
static int |
ALL_HOST |
static int |
ALL_REALM |
static int |
ALL_SESSION |
static int |
ALL_USER |
protected IConcurrentFactory |
concurrentFactory |
protected IContainer |
container |
static int |
DONT_CACHE |
protected boolean |
isStopped |
protected MetaData |
metaData |
static int |
REALM_AND_APPLICATION |
protected IRealmTable |
realmTable |
int |
REDIRECT_TABLE_SIZE |
protected List<RouterImpl.RedirectEntry> |
redirectTable |
protected ReadWriteLock |
redirectTableLock |
static int |
REQUEST_TABLE_CLEAR_SIZE |
static int |
REQUEST_TABLE_SIZE |
protected Map<String,RouterImpl.AnswerEntry> |
requestEntryMap |
protected Lock |
requestEntryTableLock |
Constructor and Description |
---|
RouterImpl(IContainer container,
IConcurrentFactory concurrentFactory,
IRealmTable realmTable,
Configuration config,
MetaData aMetaData) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Release all resources
|
void |
garbageCollectRequestRouteInfo(IMessage message) |
IPeer |
getPeer(IMessage message,
IPeerTable manager)
Return peer from inner peer table by predefined parameters.
|
protected IPeer |
getPeerPredProcessing(IMessage message,
String destRealm,
String destHost) |
IRealmTable |
getRealmTable()
Return realm table
|
String[] |
getRequestRouteInfo(IMessage message)
Return Request route info
|
protected void |
loadConfiguration(Configuration config) |
void |
processRedirectAnswer(IRequest request,
IAnswer answer,
IPeerTable table)
Called when redirect answer is received for request.
|
void |
registerRequestRouteInfo(IRequest request)
Register route information by received request.
|
protected IPeer |
selectPeer(List<IPeer> availablePeers) |
void |
start()
Start inner time facilities
|
void |
stop()
Stop inner time facilities
|
boolean |
updateRoute(IRequest message)
Based on Redirect entries or any other factors, this method changes route information.
|
public static final int DONT_CACHE
public static final int ALL_SESSION
public static final int ALL_REALM
public static final int REALM_AND_APPLICATION
public static final int ALL_APPLICATION
public static final int ALL_HOST
public static final int ALL_USER
protected MetaData metaData
protected IRealmTable realmTable
public final int REDIRECT_TABLE_SIZE
protected List<RouterImpl.RedirectEntry> redirectTable
protected IConcurrentFactory concurrentFactory
protected IContainer container
public static int REQUEST_TABLE_SIZE
public static int REQUEST_TABLE_CLEAR_SIZE
protected Lock requestEntryTableLock
protected ReadWriteLock redirectTableLock
protected Map<String,RouterImpl.AnswerEntry> requestEntryMap
protected boolean isStopped
public RouterImpl(IContainer container, IConcurrentFactory concurrentFactory, IRealmTable realmTable, Configuration config, MetaData aMetaData)
protected void loadConfiguration(Configuration config)
public void registerRequestRouteInfo(IRequest request)
IRouter
registerRequestRouteInfo
in interface IRouter
request
- requestpublic String[] getRequestRouteInfo(IMessage message)
IRouter
getRequestRouteInfo
in interface IRouter
public void garbageCollectRequestRouteInfo(IMessage message)
garbageCollectRequestRouteInfo
in interface IRouter
public IPeer getPeer(IMessage message, IPeerTable manager) throws RouteException, AvpDataException
IRouter
IRouter.updateRoute(org.jdiameter.client.api.IRequest)
.getPeer
in interface IRouter
message
- message with routed avpsmanager
- instance of peer managerRouteException
AvpDataException
public IRealmTable getRealmTable()
IRouter
getRealmTable
in interface IRouter
public void processRedirectAnswer(IRequest request, IAnswer answer, IPeerTable table) throws InternalException, RouteException
IRouter
processRedirectAnswer
in interface IRouter
InternalException
RouteException
public boolean updateRoute(IRequest message) throws RouteException, AvpDataException
IRouter
updateRoute
in interface IRouter
RouteException
AvpDataException
protected IPeer getPeerPredProcessing(IMessage message, String destRealm, String destHost)
public void start()
IRouter
public void stop()
IRouter
public void destroy()
IRouter
Copyright © 2016. All Rights Reserved.