Skip to content

Commit

Permalink
- Fix vhost
Browse files Browse the repository at this point in the history
- Remove Cache wrapper.
- Use default namespace for ehcache.xml
  • Loading branch information
rathnapandi committed Mar 11, 2024
1 parent 4c13616 commit 0a03578
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 273 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,14 @@ public <K, V> Cache<K, V> createCache(String arg0, Builder<? extends CacheConfig

@Override
public <K, V> Cache<K, V> getCache(String alias, Class<K> keyType, Class<V> valueType) {
String cachePrefix;
try {
cachePrefix = CoreParameters.getInstance().getAPIManagerURL().toString();
} catch (AppException e) {
throw new RuntimeException(e);
}
if (this.enabledCaches == null) {
// Caches not specified, return requested cache
// however, cacheManager might be a DoNothingCacheManager if ignoreCache is set
Cache<K, V> plainCache = cacheManager.getCache(alias, keyType, valueType);
return new APIMCLICache<>(plainCache, cachePrefix);
return cacheManager.getCache(alias, keyType, valueType);
} else {
if (this.enabledCaches.contains(alias)) {
LOG.debug("Using cache: {} as it is enabled.", alias);
Cache<K, V> plainCache = cacheManager.getCache(alias, keyType, valueType);
return new APIMCLICache<>(plainCache, cachePrefix);
return cacheManager.getCache(alias, keyType, valueType);
} else {
return new DoNothingCache<>();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
package com.axway.apim.lib;

import com.axway.apim.adapter.CacheType;
import java.util.Collections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.List;

public class StandardImportParams extends CoreParameters {

private static final Logger LOG = LoggerFactory.getLogger(StandardImportParams.class);
private static final Logger LOG = LoggerFactory.getLogger(StandardImportParams.class);

private String config;
private String config;

private String stageConfig;
private String stageConfig;

private String enabledCaches;
private String enabledCaches;

private List<CacheType> enabledCacheTypes = null;
private List<CacheType> enabledCacheTypes = null;

public String getConfig() {
return config;
}
public String getConfig() {
return config;
}

public void setConfig(String config) {
this.config = config;
}
public void setConfig(String config) {
this.config = config;
}

public String getStageConfig() {
return stageConfig;
}
public String getStageConfig() {
return stageConfig;
}

public void setStageConfig(String stageConfig) {
this.stageConfig = stageConfig;
}
public void setStageConfig(String stageConfig) {
this.stageConfig = stageConfig;
}

public static synchronized StandardImportParams getInstance() {
return (StandardImportParams)CoreParameters.getInstance();
}
public static synchronized StandardImportParams getInstance() {
return (StandardImportParams) CoreParameters.getInstance();
}

@Override
public boolean isIgnoreCache() {
// Caches are disabled for import actions if not explicitly enabled
return getEnabledCaches() == null || super.isIgnoreCache();
}
@Override
public boolean isIgnoreCache() {
// Caches are disabled for import actions if not explicitly enabled
return getEnabledCaches() == null || super.isIgnoreCache();
}

public String getEnabledCaches() {
return enabledCaches;
}
public String getEnabledCaches() {
return enabledCaches;
}

public List<CacheType> getEnabledCacheTypes() {
if(isIgnoreCache()) return Collections.emptyList();
if(getEnabledCaches()==null) return Collections.emptyList();
if(enabledCacheTypes!=null) return enabledCacheTypes;
enabledCacheTypes = createCacheList(getEnabledCaches());
LOG.warn("Using caches for Import-Actions is BETA. Enable only as many caches as necessary to improve performance and monitor behavior closely. Please read: https://bit.ly/3FjXRXE");
return enabledCacheTypes;
}
public List<CacheType> getEnabledCacheTypes() {
if (isIgnoreCache()) return Collections.emptyList();
if (getEnabledCaches() == null) return Collections.emptyList();
if (enabledCacheTypes != null) return enabledCacheTypes;
enabledCacheTypes = createCacheList(getEnabledCaches());
LOG.warn("Using caches for Import-Actions is BETA. Enable only as many caches as necessary to improve performance and monitor behavior closely. Please read: https://bit.ly/3FjXRXE");
return enabledCacheTypes;
}

public void setEnabledCaches(String enabledCaches) {
this.enabledCaches = enabledCaches;
}
public void setEnabledCaches(String enabledCaches) {
this.enabledCaches = enabledCaches;
}

@Override
public String toString() {
return "[" + super.toString() + ", config=" + config + "]";
}
@Override
public String toString() {
return "[" + super.toString() + ", config=" + config + "]";
}
}
Loading

0 comments on commit 0a03578

Please sign in to comment.