public class InterceptorsHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
INTERCEPTOR_CLASS_NAME_SEPARATOR |
static org.objectweb.util.monolog.api.Logger |
logger
logger
|
Constructor and Description |
---|
InterceptorsHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addInterceptors(String agentId,
String agentName,
String interceptorsKey,
List<Properties> list,
List<MessageInterceptor> interceptors)
re-create all interceptors
|
static void |
addInterceptors(String agentId,
String agentName,
String interceptorsKey,
Properties prop,
List<MessageInterceptor> interceptors)
Add the specified interceptors in the list.
|
static String |
getListInterceptors(List<MessageInterceptor> interceptors)
get the interceptors list.
|
private static boolean |
removeInterceptor(String interceptorClassName,
List<MessageInterceptor> interceptors)
Remove the first occurrence of interceptorClassName.
|
static void |
removeInterceptors(String listInterceptorClassName,
List<MessageInterceptor> interceptors)
Remove the first occurrence of interceptorClassName.
|
static boolean |
replaceInterceptor(String agentId,
String agentName,
String interceptorKeyNew,
String interceptorKeyOld,
List<MessageInterceptor> interceptors,
Properties prop)
Replace the first occurrence of oldInterceptor by the newInterceptor.
|
public static org.objectweb.util.monolog.api.Logger logger
public static final String INTERCEPTOR_CLASS_NAME_SEPARATOR
public static void addInterceptors(String agentId, String agentName, String interceptorsKey, Properties prop, List<MessageInterceptor> interceptors) throws Exception
agentId
- the string representation of agentIdagentName
- the agent nameinterceptorsKey
- the interceptors key properties see AdminCommandConstantprop
- Properties contains the string className interceptorinterceptors
- the list of the MessageInterceptor instanceException
public static void addInterceptors(String agentId, String agentName, String interceptorsKey, List<Properties> list, List<MessageInterceptor> interceptors) throws Exception
agentId
- the string representation of agentIdagentName
- the agent nameinterceptorsKey
- the interceptors key properties see AdminCommandConstantlist
- properties listinterceptors
- the list of the MessageInterceptor instanceException
private static boolean removeInterceptor(String interceptorClassName, List<MessageInterceptor> interceptors)
interceptorClassName
- the interceptor to remove.interceptors
- the list of the MessageInterceptor instancepublic static void removeInterceptors(String listInterceptorClassName, List<MessageInterceptor> interceptors) throws Exception
listInterceptorClassName
- list of string className interceptors (separate by INTERCEPTOR_CLASS_NAME_SEPARATOR)interceptors
- the list of the MessageInterceptor instanceException
public static boolean replaceInterceptor(String agentId, String agentName, String interceptorKeyNew, String interceptorKeyOld, List<MessageInterceptor> interceptors, Properties prop) throws Exception
agentId
- the string representation of agentIdagentName
- the agent nameinterceptorKeyNew
- the new interceptor key properties see AdminCommandConstantinterceptorKeyOld
- the old interceptor key properties see AdminCommandConstantinterceptors
- the list of the MessageInterceptor instanceprop
- Properties contains the string className interceptorException
public static String getListInterceptors(List<MessageInterceptor> interceptors)
interceptors
- the interceptors List.Copyright © 2019 ScalAgent D.T.. All rights reserved.