本文整理了Java中com.netflix.zuul.ZuulApplicationInfo.getApplicationName()
方法的一些代码示例,展示了ZuulApplicationInfo.getApplicationName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZuulApplicationInfo.getApplicationName()
方法的具体详情如下:
包路径:com.netflix.zuul.ZuulApplicationInfo
类名称:ZuulApplicationInfo
方法名:getApplicationName
暂无
代码示例来源:origin: Netflix/zuul
/**
* verifies compilation, instanciation and that it is a ZuulFilter
*
* @param sFilterCode
* @return a FilterInfo object representing that code
* @throws org.codehaus.groovy.control.CompilationFailedException
*
* @throws IllegalAccessException
* @throws InstantiationException
*/
public FilterInfo verifyFilter(String sFilterCode) throws org.codehaus.groovy.control.CompilationFailedException, IllegalAccessException, InstantiationException {
Class groovyClass = compileGroovy(sFilterCode);
Object instance = instanciateClass(groovyClass);
checkZuulFilterInstance(instance);
BaseFilter filter = (BaseFilter) instance;
String filter_id = FilterInfo.buildFilterID(ZuulApplicationInfo.getApplicationName(), filter.filterType(), groovyClass.getSimpleName());
return new FilterInfo(filter_id, sFilterCode, filter.filterType(), groovyClass.getSimpleName(), filter.disablePropertyName(), "" + filter.filterOrder(), ZuulApplicationInfo.getApplicationName());
}
代码示例来源:origin: Netflix/zuul
/**
* verifies compilation, instanciation and that it is a ZuulFilter
*
* @param sFilterCode
* @return a FilterInfo object representing that code
* @throws org.codehaus.groovy.control.CompilationFailedException
*
* @throws IllegalAccessException
* @throws InstantiationException
*/
public FilterInfo verifyFilter(String sFilterCode) throws org.codehaus.groovy.control.CompilationFailedException, IllegalAccessException, InstantiationException {
Class groovyClass = compileGroovy(sFilterCode);
Object instance = instanciateClass(groovyClass);
checkZuulFilterInstance(instance);
BaseFilter filter = (BaseFilter) instance;
String filter_id = FilterInfo.buildFilterID(ZuulApplicationInfo.getApplicationName(), filter.filterType(), groovyClass.getSimpleName());
return new FilterInfo(filter_id, sFilterCode, filter.filterType(), groovyClass.getSimpleName(), filter.disablePropertyName(), "" + filter.filterOrder(), ZuulApplicationInfo.getApplicationName());
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
private String getScriptsForFilterIndexKey(String filter_id) {
return SCRIPTS_FOR_FILTER + ZuulApplicationInfo.getApplicationName() + "_" + filter_id;
}
代码示例来源:origin: com.netflix.zuul/zuul-core
private String getScriptsForFilterIndexKey(String filter_id) {
return SCRIPTS_FOR_FILTER + ZuulApplicationInfo.getApplicationName() + "_" + filter_id;
}
代码示例来源:origin: com.netflix.zuul/zuul-core
@Override
public List<FilterInfo> getAllActiveFilters() {
List<FilterInfo> filterInfos = getFiltersForIndex(ACTIVE_SCRIPTS + ZuulApplicationInfo.getApplicationName());
if (filterInfos == null || filterInfos.size() == 0) {
return Collections.emptyList();
} else {
Collections.sort(filterInfos);
return filterInfos;
}
}
代码示例来源:origin: com.netflix.zuul/zuul-core
@Override
public List<String> getAllFilterIDs() {
return getFilterIdsIndex(FILTER_ID + ZuulApplicationInfo.getApplicationName());
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
@Override
public List<FilterInfo> getAllCanaryFilters() {
List<FilterInfo> filterInfos = getFiltersForIndex(CANARY_SCRIPTS + ZuulApplicationInfo.getApplicationName());
if (filterInfos == null || filterInfos.size() == 0) {
return Collections.emptyList();
} else {
Collections.sort(filterInfos);
return filterInfos;
}
}
代码示例来源:origin: com.netflix.zuul/zuul-core
@Override
public List<FilterInfo> getAllCanaryFilters() {
List<FilterInfo> filterInfos = getFiltersForIndex(CANARY_SCRIPTS + ZuulApplicationInfo.getApplicationName());
if (filterInfos == null || filterInfos.size() == 0) {
return Collections.emptyList();
} else {
Collections.sort(filterInfos);
return filterInfos;
}
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
/**
* sets the application name of the origin
*
* @param applicationName
*/
public static void setApplicationName(String applicationName) {
RibbonConfig.APPLICATION_NAME = applicationName;
if (ZuulApplicationInfo.getApplicationName() == null) ZuulApplicationInfo.setApplicationName(applicationName);
LOG.info("Setting back end VIP application = " + applicationName);
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
@Override
public List<FilterInfo> getAllActiveFilters() {
List<FilterInfo> filterInfos = getFiltersForIndex(ACTIVE_SCRIPTS + ZuulApplicationInfo.getApplicationName());
if (filterInfos == null || filterInfos.size() == 0) {
return Collections.emptyList();
} else {
Collections.sort(filterInfos);
return filterInfos;
}
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
@Override
public List<String> getAllFilterIDs() {
return getFilterIdsIndex(FILTER_ID + ZuulApplicationInfo.getApplicationName());
}
代码示例来源:origin: com.netflix.zuul/zuul-core
public static String buildFilterID(FilterType filter_type, String filter_name) {
return FilterInfo.buildFilterID(ZuulApplicationInfo.getApplicationName(), filter_type, filter_name);
}
代码示例来源:origin: com.netflix.zuul/zuul-core
public FilterInfo getCanaryScriptForFilter(String filter_id) {
List<FilterInfo> filterInfos = getFiltersForIndex(CANARY_SCRIPTS + ZuulApplicationInfo.getApplicationName());
for (int i = 0; i < filterInfos.size(); i++) {
FilterInfo filterInfo = filterInfos.get(i);
if (filterInfo.getFilterID().equals(filter_id)) return filterInfo;
}
return null;
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
@Override
public FilterInfo getActiveFilterInfoForFilter(String filter_id) {
List<FilterInfo> filterInfos = getFiltersForIndex(ACTIVE_SCRIPTS + ZuulApplicationInfo.getApplicationName());
for (int i = 0; i < filterInfos.size(); i++) {
FilterInfo filterInfo = filterInfos.get(i);
if (filterInfo.getFilterID().equals(filter_id)) return filterInfo;
}
return null;
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
public FilterInfo getCanaryScriptForFilter(String filter_id) {
List<FilterInfo> filterInfos = getFiltersForIndex(CANARY_SCRIPTS + ZuulApplicationInfo.getApplicationName());
for (int i = 0; i < filterInfos.size(); i++) {
FilterInfo filterInfo = filterInfos.get(i);
if (filterInfo.getFilterID().equals(filter_id)) return filterInfo;
}
return null;
}
代码示例来源:origin: com.netflix.zuul/zuul-core
@Override
public FilterInfo getActiveFilterInfoForFilter(String filter_id) {
List<FilterInfo> filterInfos = getFiltersForIndex(ACTIVE_SCRIPTS + ZuulApplicationInfo.getApplicationName());
for (int i = 0; i < filterInfos.size(); i++) {
FilterInfo filterInfo = filterInfos.get(i);
if (filterInfo.getFilterID().equals(filter_id)) return filterInfo;
}
return null;
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
public FilterInfo(String filterCode, String filterName, ZuulFilter filter) {
this.filter_code = filterCode;
this.filter_type = filter.filterType();
this.filter_name = filterName;
this.filter_disablePropertyName = filter.disablePropertyName();
this.filter_order = "" + filter.filterOrder();
this.application_name = ZuulApplicationInfo.getApplicationName();
isActive.set(false);
isCanary.set(false);
this.filter_id = buildFilterId();
}
代码示例来源:origin: com.netflix.zuul/zuul-core
@Override
public FilterInfo deActivateFilter(String filter_id, int revision) throws Exception {
FilterInfo filter = getFilterInfo(filter_id, revision);
if (filter == null) throw new Exception("Filter not Found " + filter_id + "revision:" + revision);
if (!filter.isCanary() && !filter.isActive()) {
throw new Exception("Filter must be canary or active to deactivate" + filter_id + "revision:" + revision);
}
removeFilterIdFromIndex(ACTIVE_SCRIPTS + ZuulApplicationInfo.getApplicationName(), filter_id + "_" + filter.getRevision());
removeFilterIdFromIndex(CANARY_SCRIPTS + ZuulApplicationInfo.getApplicationName(), filter_id + "_" + filter.getRevision());
/* activate the revision */
Map<String, Object> attributesForActivation = new HashMap<String, Object>();
attributesForActivation.put("active", false);
attributesForActivation.put("canary", false);
cassandraGateway.upsert(filter_id + "_" + revision, attributesForActivation);
setChanged();
notifyObservers(new ZuulEvent("ZUUL_SCRIPT_CHANGE", "DEACTIVATED ZUUL FILTER id = " + filter_id + " revision = " + revision));
return getFilterInfoForFilter(filter_id, revision);
}
代码示例来源:origin: com.netflix.zuul/zuul-core
/**
* verifies compilation, instanciation and that it is a ZuulFilter
*
* @param sFilterCode
* @return a FilterInfo object representing that code
* @throws org.codehaus.groovy.control.CompilationFailedException
*
* @throws IllegalAccessException
* @throws InstantiationException
*/
public FilterInfo verifyFilter(String sFilterCode) throws org.codehaus.groovy.control.CompilationFailedException, IllegalAccessException, InstantiationException {
Class groovyClass = compileGroovy(sFilterCode);
Object instance = instanciateClass(groovyClass);
checkZuulFilterInstance(instance);
BaseFilter filter = (BaseFilter) instance;
String filter_id = FilterInfo.buildFilterID(ZuulApplicationInfo.getApplicationName(), filter.filterType(), groovyClass.getSimpleName());
return new FilterInfo(filter_id, sFilterCode, filter.filterType(), groovyClass.getSimpleName(), filter.disablePropertyName(), "" + filter.filterOrder(), ZuulApplicationInfo.getApplicationName());
}
代码示例来源:origin: com.netflix.zuul/zuul-netflix
@Override
public FilterInfo deActivateFilter(String filter_id, int revision) throws Exception {
FilterInfo filter = getFilterInfo(filter_id, revision);
if (filter == null) throw new Exception("Filter not Found " + filter_id + "revision:" + revision);
if (!filter.isCanary() && !filter.isActive()) {
throw new Exception("Filter must be canary or active to deactivate" + filter_id + "revision:" + revision);
}
removeFilterIdFromIndex(ACTIVE_SCRIPTS + ZuulApplicationInfo.getApplicationName(), filter_id + "_" + filter.getRevision());
removeFilterIdFromIndex(CANARY_SCRIPTS + ZuulApplicationInfo.getApplicationName(), filter_id + "_" + filter.getRevision());
/* activate the revision */
Map<String, Object> attributesForActivation = new HashMap<String, Object>();
attributesForActivation.put("active", false);
attributesForActivation.put("canary", false);
cassandraGateway.upsert(filter_id + "_" + revision, attributesForActivation);
setChanged();
notifyObservers(new ZuulEvent("ZUUL_SCRIPT_CHANGE", "DEACTIVATED ZUUL FILTER id = " + filter_id + " revision = " + revision));
return getFilterInfoForFilter(filter_id, revision);
}
内容来源于网络,如有侵权,请联系作者删除!