Skip to content

Commit 821fd47

Browse files
namedgraphclaude
andcommitted
Introduce ServiceContext to decouple HTTP infrastructure from Service
`Service` is now a pure data interface (SPARQL endpoint URLs + credentials only), no longer extending `RemoteService`. HTTP client/proxy infrastructure is moved into the new `ServiceContext` class, which pairs a `Service` with its `Client`, `MediaTypes`, `maxGetRequestSize`, and backend proxy URI. - `lapp:frontendProxy` and `lapp:backendProxy` removed from RDF model; loaded from system-level config (`LDHC.frontendProxy`, `LDHC.backendProxy`) at startup and stored in a `serviceContextMap` in `Application` - `Application.getServiceContext(Service)` looks up the `ServiceContext` for any `Service` at runtime - All JAX-RS resources and filters obtain client/proxy access via `getSystem().getServiceContext(service).getX()` - Import chain (`ImportExecutor`, `CSVGraphStore*`, `RDFGraphStoreOutput`, `StreamRDFOutputWriter`) receives `Service + Application system` (not `ServiceContext`) since they are plain Java objects, not HK2-managed beans - `Application.ban(Resource, ...)` overload removed; all callers use the `ban(URI, ...)` form - `core.model.Application.getService()` removed to avoid covariant return type clash after `ldh.Service` dropped `RemoteService` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 106d695 commit 821fd47

37 files changed

Lines changed: 878 additions & 629 deletions

config/system.trig

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
lapp:origin <https://admin.localhost:4443> ;
2424
ldt:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
2525
ldt:service <urn:linkeddatahub:services/admin> ;
26-
ac:stylesheet <static/xsl/admin/layout.xsl> ;
27-
lapp:frontendProxy <http://varnish-frontend:6060/> .
26+
ac:stylesheet <static/xsl/admin/layout.xsl> .
2827

2928
}
3029

@@ -36,8 +35,7 @@
3635
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
3736
sd:endpoint <http://fuseki-admin:3030/ds/> ;
3837
a:graphStore <http://fuseki-admin:3030/ds/> ;
39-
a:quadStore <http://fuseki-admin:3030/ds/> ;
40-
lapp:backendProxy <http://varnish-admin/> .
38+
a:quadStore <http://fuseki-admin:3030/ds/> .
4139

4240
}
4341

@@ -52,7 +50,6 @@
5250
ldt:ontology <https://localhost:4443/ns#> ;
5351
ldt:service <urn:linkeddatahub:services/end-user> ;
5452
ac:stylesheet <static/xsl/layout.xsl> ;
55-
lapp:frontendProxy <http://varnish-frontend:6060/> ;
5653
lapp:public true .
5754

5855
}
@@ -65,8 +62,7 @@
6562
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
6663
sd:endpoint <http://fuseki-end-user:3030/ds/> ;
6764
a:graphStore <http://fuseki-end-user:3030/ds/> ;
68-
a:quadStore <http://fuseki-end-user:3030/ds/> ;
69-
lapp:backendProxy <http://varnish-end-user/> .
65+
a:quadStore <http://fuseki-end-user:3030/ds/> .
7066

7167
}
7268

@@ -79,8 +75,7 @@
7975
lapp:origin <https://admin.northwind-traders.demo.localhost:4443> ;
8076
ldt:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
8177
ldt:service <urn:linkeddatahub:services/admin> ;
82-
ac:stylesheet <static/xsl/admin/layout.xsl> ;
83-
lapp:frontendProxy <http://varnish-frontend:6060/> .
78+
ac:stylesheet <static/xsl/admin/layout.xsl> .
8479

8580
}
8681

@@ -94,7 +89,6 @@
9489
ldt:ontology <https://northwind-traders.demo.localhost:4443/ns#> ;
9590
ldt:service <urn:linkeddatahub:services/end-user> ;
9691
ac:stylesheet <static/xsl/layout.xsl> ;
97-
lapp:frontendProxy <http://varnish-frontend:6060/> ;
9892
lapp:public true .
9993

10094
}

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ services:
4545
#- CATALINA_OPTS="-Duser.timezone=Europe/Copenhagen"
4646
- PROXY_HOST=nginx
4747
- PROXY_PORT=9443
48+
- FRONTEND_PROXY=http://varnish-frontend:6060/
49+
- BACKEND_PROXY_ADMIN=http://varnish-admin/
50+
- BACKEND_PROXY_END_USER=http://varnish-end-user/
4851
- PROTOCOL=${PROTOCOL}
4952
- HOST=${HOST}
5053
- ABS_PATH=${ABS_PATH}

http-tests/config/system.trig

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
lapp:origin <https://admin.localhost:4443> ;
2424
ldt:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
2525
ldt:service <urn:linkeddatahub:services/admin> ;
26-
ac:stylesheet <static/xsl/admin/layout.xsl> ;
27-
lapp:endUserApplication <urn:linkeddatahub:apps/end-user> ;
28-
lapp:frontendProxy <http://varnish-frontend:6060/> .
26+
ac:stylesheet <static/xsl/admin/layout.xsl> .
2927
}
3028

3129
<urn:linkeddatahub:services/admin>
@@ -35,8 +33,7 @@
3533
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
3634
sd:endpoint <http://fuseki-admin:3030/ds/> ;
3735
a:graphStore <http://fuseki-admin:3030/ds/> ;
38-
a:quadStore <http://fuseki-admin:3030/ds/> ;
39-
lapp:backendProxy <http://varnish-admin/> .
36+
a:quadStore <http://fuseki-admin:3030/ds/> .
4037
}
4138

4239
# root end-user
@@ -50,8 +47,6 @@
5047
ldt:ontology <https://localhost:4443/ns#> ;
5148
ldt:service <urn:linkeddatahub:services/end-user> ;
5249
ac:stylesheet <static/xsl/layout.xsl> ;
53-
lapp:adminApplication <urn:linkeddatahub:apps/admin> ;
54-
lapp:frontendProxy <http://varnish-frontend:6060/> ;
5550
lapp:public true .
5651
}
5752

@@ -62,8 +57,7 @@
6257
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
6358
sd:endpoint <http://fuseki-end-user:3030/ds/> ;
6459
a:graphStore <http://fuseki-end-user:3030/ds/> ;
65-
a:quadStore <http://fuseki-end-user:3030/ds/> ;
66-
lapp:backendProxy <http://varnish-end-user/> .
60+
a:quadStore <http://fuseki-end-user:3030/ds/> .
6761
}
6862

6963
# test admin
@@ -75,9 +69,7 @@
7569
lapp:origin <https://admin.test.localhost:4443> ;
7670
ldt:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
7771
ldt:service <urn:linkeddatahub:services/test/admin> ;
78-
ac:stylesheet <static/xsl/admin/layout.xsl> ;
79-
lapp:endUserApplication <urn:linkeddatahub:apps/test/end-user> ;
80-
lapp:frontendProxy <http://varnish-frontend:6060/> .
72+
ac:stylesheet <static/xsl/admin/layout.xsl> .
8173
}
8274

8375
<urn:linkeddatahub:services/test/admin>
@@ -87,8 +79,7 @@
8779
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
8880
sd:endpoint <http://fuseki-admin:3030/ds/> ;
8981
a:graphStore <http://fuseki-admin:3030/ds/> ;
90-
a:quadStore <http://fuseki-admin:3030/ds/> ;
91-
lapp:backendProxy <http://varnish-admin/> .
82+
a:quadStore <http://fuseki-admin:3030/ds/> .
9283
}
9384

9485
# test end-user
@@ -101,8 +92,6 @@
10192
ldt:ontology <https://test.localhost:4443/ns#> ;
10293
ldt:service <urn:linkeddatahub:services/test/end-user> ;
10394
ac:stylesheet <static/xsl/layout.xsl> ;
104-
lapp:adminApplication <urn:linkeddatahub:apps/test/admin> ;
105-
lapp:frontendProxy <http://varnish-frontend:6060/> ;
10695
lapp:public true .
10796
}
10897

@@ -113,6 +102,5 @@
113102
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
114103
sd:endpoint <http://fuseki-end-user:3030/ds/> ;
115104
a:graphStore <http://fuseki-end-user:3030/ds/> ;
116-
a:quadStore <http://fuseki-end-user:3030/ds/> ;
117-
lapp:backendProxy <http://varnish-end-user/> .
105+
a:quadStore <http://fuseki-end-user:3030/ds/> .
118106
}

platform/context.xsl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ xmlns:orcid="&orcid;"
5252
<xsl:param name="google:clientSecret"/>
5353
<xsl:param name="orcid:clientID"/>
5454
<xsl:param name="orcid:clientSecret"/>
55+
<xsl:param name="ldhc:frontendProxy"/>
56+
<xsl:param name="ldhc:backendProxyAdmin"/>
57+
<xsl:param name="ldhc:backendProxyEndUser"/>
5558

5659
<xsl:template match="@*|node()">
5760
<xsl:copy>
@@ -168,6 +171,15 @@ xmlns:orcid="&orcid;"
168171
<xsl:if test="$orcid:clientSecret">
169172
<Parameter name="&orcid;clientSecret" value="{$orcid:clientSecret}" override="false"/>
170173
</xsl:if>
174+
<xsl:if test="$ldhc:frontendProxy">
175+
<Parameter name="&ldhc;frontendProxy" value="{$ldhc:frontendProxy}" override="false"/>
176+
</xsl:if>
177+
<xsl:if test="$ldhc:backendProxyAdmin">
178+
<Parameter name="&ldhc;backendProxyAdmin" value="{$ldhc:backendProxyAdmin}" override="false"/>
179+
</xsl:if>
180+
<xsl:if test="$ldhc:backendProxyEndUser">
181+
<Parameter name="&ldhc;backendProxyEndUser" value="{$ldhc:backendProxyEndUser}" override="false"/>
182+
</xsl:if>
171183

172184
<xsl:apply-templates select="node()"/>
173185
</xsl:copy>

platform/entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,18 @@ if [ -f "/run/secrets/orcid_client_secret" ]; then
950950
ORCID_CLIENT_SECRET_PARAM="--stringparam orcid:clientSecret '$ORCID_CLIENT_SECRET' "
951951
fi
952952

953+
if [ -n "$FRONTEND_PROXY" ]; then
954+
FRONTEND_PROXY_PARAM="--stringparam 'ldhc:frontendProxy' '$FRONTEND_PROXY' "
955+
fi
956+
957+
if [ -n "$BACKEND_PROXY_ADMIN" ]; then
958+
BACKEND_PROXY_ADMIN_PARAM="--stringparam 'ldhc:backendProxyAdmin' '$BACKEND_PROXY_ADMIN' "
959+
fi
960+
961+
if [ -n "$BACKEND_PROXY_END_USER" ]; then
962+
BACKEND_PROXY_END_USER_PARAM="--stringparam 'ldhc:backendProxyEndUser' '$BACKEND_PROXY_END_USER' "
963+
fi
964+
953965
transform="xsltproc \
954966
--output conf/Catalina/localhost/ROOT.xml \
955967
$CACHE_MODEL_LOADS_PARAM \
@@ -987,6 +999,9 @@ transform="xsltproc \
987999
$GOOGLE_CLIENT_SECRET_PARAM \
9881000
$ORCID_CLIENT_ID_PARAM \
9891001
$ORCID_CLIENT_SECRET_PARAM \
1002+
$FRONTEND_PROXY_PARAM \
1003+
$BACKEND_PROXY_ADMIN_PARAM \
1004+
$BACKEND_PROXY_END_USER_PARAM \
9901005
/var/linkeddatahub/xsl/context.xsl \
9911006
conf/Catalina/localhost/ROOT.xml"
9921007

src/main/java/com/atomgraph/linkeddatahub/Application.java

Lines changed: 93 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import com.atomgraph.core.mapper.BadGatewayExceptionMapper;
5151
import com.atomgraph.core.provider.QueryParamProvider;
5252
import com.atomgraph.linkeddatahub.writer.factory.DataManagerFactory;
53+
import com.atomgraph.server.vocabulary.LDT;
5354
import com.atomgraph.server.mapper.NotFoundExceptionMapper;
5455
import com.atomgraph.core.riot.RDFLanguages;
5556
import com.atomgraph.core.riot.lang.RDFPostReaderFactory;
@@ -300,6 +301,10 @@ public class Application extends ResourceConfig
300301
private final Properties oidcRefreshTokens;
301302
private final URI contextDatasetURI;
302303
private final Dataset contextDataset;
304+
private final URI frontendProxy;
305+
private final URI backendProxyAdmin;
306+
private final URI backendProxyEndUser;
307+
private Map<String, com.atomgraph.linkeddatahub.model.ServiceContext> serviceContextMap;
303308

304309
/**
305310
* Constructs system application and configures it using sevlet config.
@@ -358,7 +363,10 @@ public Application(@Context ServletConfig servletConfig) throws URISyntaxExcepti
358363
servletConfig.getServletContext().getInitParameter(Google.clientID.getURI()) != null ? servletConfig.getServletContext().getInitParameter(Google.clientID.getURI()) : null,
359364
servletConfig.getServletContext().getInitParameter(Google.clientSecret.getURI()) != null ? servletConfig.getServletContext().getInitParameter(Google.clientSecret.getURI()) : null,
360365
servletConfig.getServletContext().getInitParameter(ORCID.clientID.getURI()) != null ? servletConfig.getServletContext().getInitParameter(ORCID.clientID.getURI()) : null,
361-
servletConfig.getServletContext().getInitParameter(ORCID.clientSecret.getURI()) != null ? servletConfig.getServletContext().getInitParameter(ORCID.clientSecret.getURI()) : null
366+
servletConfig.getServletContext().getInitParameter(ORCID.clientSecret.getURI()) != null ? servletConfig.getServletContext().getInitParameter(ORCID.clientSecret.getURI()) : null,
367+
servletConfig.getServletContext().getInitParameter(LDHC.frontendProxy.getURI()) != null ? servletConfig.getServletContext().getInitParameter(LDHC.frontendProxy.getURI()) : null,
368+
servletConfig.getServletContext().getInitParameter(LDHC.backendProxyAdmin.getURI()) != null ? servletConfig.getServletContext().getInitParameter(LDHC.backendProxyAdmin.getURI()) : null,
369+
servletConfig.getServletContext().getInitParameter(LDHC.backendProxyEndUser.getURI()) != null ? servletConfig.getServletContext().getInitParameter(LDHC.backendProxyEndUser.getURI()) : null
362370
);
363371
}
364372

@@ -413,6 +421,9 @@ public Application(@Context ServletConfig servletConfig) throws URISyntaxExcepti
413421
* @param googleClientSecret client secret for Google's OAuth
414422
* @param orcidClientID client ID for ORCID's OAuth
415423
* @param orcidClientSecret client secret for ORCID's OAuth
424+
* @param frontendProxyString frontend (Varnish) proxy URI used for cache invalidation BAN requests, or null
425+
* @param backendProxyAdminString backend proxy URI for the admin SPARQL service (endpoint URI rewriting + cache invalidation), or null
426+
* @param backendProxyEndUserString backend proxy URI for the end-user SPARQL service (endpoint URI rewriting + cache invalidation), or null
416427
*/
417428
public Application(final ServletConfig servletConfig, final MediaTypes mediaTypes,
418429
final Integer maxGetRequestSize, final boolean cacheModelLoads, final boolean preemptiveAuth,
@@ -430,14 +441,18 @@ public Application(final ServletConfig servletConfig, final MediaTypes mediaType
430441
final String notificationAddressString, final String supportedLanguageCodes, final boolean enableWebIDSignUp, final String oidcRefreshTokensPropertiesPath,
431442
final String mailUser, final String mailPassword, final String smtpHost, final String smtpPort,
432443
final String googleClientID, final String googleClientSecret,
433-
final String orcidClientID, final String orcidClientSecret)
444+
final String orcidClientID, final String orcidClientSecret,
445+
final String frontendProxyString, final String backendProxyAdminString, final String backendProxyEndUserString)
434446
{
435447
if (contextDatasetURIString == null)
436448
{
437449
if (log.isErrorEnabled()) log.error("Context dataset URI '{}' not configured", LDHC.contextDataset.getURI());
438450
throw new ConfigurationException(LDHC.contextDataset);
439451
}
440452
this.contextDatasetURI = URI.create(contextDatasetURIString);
453+
this.frontendProxy = frontendProxyString != null ? URI.create(frontendProxyString) : null;
454+
this.backendProxyAdmin = backendProxyAdminString != null ? URI.create(backendProxyAdminString) : null;
455+
this.backendProxyEndUser = backendProxyEndUserString != null ? URI.create(backendProxyEndUserString) : null;
441456

442457
if (clientKeyStoreURIString == null)
443458
{
@@ -736,12 +751,54 @@ public Application(final ServletConfig servletConfig, final MediaTypes mediaType
736751
BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.apps.model.Application.class, new com.atomgraph.linkeddatahub.apps.model.impl.ApplicationImplementation());
737752
BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.apps.model.Dataset.class, new com.atomgraph.linkeddatahub.apps.model.impl.DatasetImplementation());
738753
BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.apps.model.Package.class, new com.atomgraph.linkeddatahub.apps.model.impl.PackageImplementation());
739-
BuiltinPersonalities.model.add(Service.class, new com.atomgraph.linkeddatahub.model.impl.ServiceImplementation(noCertClient, mediaTypes, maxGetRequestSize));
754+
BuiltinPersonalities.model.add(Service.class, new com.atomgraph.linkeddatahub.model.impl.ServiceImplementation());
740755
BuiltinPersonalities.model.add(Import.class, ImportImpl.factory);
741756
BuiltinPersonalities.model.add(RDFImport.class, RDFImportImpl.factory);
742757
BuiltinPersonalities.model.add(CSVImport.class, CSVImportImpl.factory);
743758
BuiltinPersonalities.model.add(com.atomgraph.linkeddatahub.model.File.class, FileImpl.factory);
744-
759+
760+
// Build ServiceContext map: keyed by service URI, associates each service with its client and proxy config.
761+
// Admin services get backendProxyAdmin; end-user services get backendProxyEndUser.
762+
serviceContextMap = new HashMap<>();
763+
org.apache.jena.rdf.model.Model ctxUnion = contextDataset.getUnionModel();
764+
ResIterator serviceIt = ctxUnion.listSubjectsWithProperty(org.apache.jena.vocabulary.RDF.type,
765+
com.atomgraph.core.vocabulary.SD.Service);
766+
try
767+
{
768+
while (serviceIt.hasNext())
769+
{
770+
Resource svcResource = serviceIt.next();
771+
com.atomgraph.linkeddatahub.model.Service svc = svcResource.as(com.atomgraph.linkeddatahub.model.Service.class);
772+
// Determine which proxy applies: check which type of application references this service
773+
org.apache.jena.rdf.model.ResIterator appIt = ctxUnion.listSubjectsWithProperty(
774+
LDT.service, svcResource);
775+
boolean referencedByAdmin = false;
776+
boolean referencedByEndUser = false;
777+
try
778+
{
779+
while (appIt.hasNext())
780+
{
781+
Resource app = appIt.next();
782+
if (app.hasProperty(org.apache.jena.vocabulary.RDF.type, LAPP.AdminApplication))
783+
referencedByAdmin = true;
784+
if (app.hasProperty(org.apache.jena.vocabulary.RDF.type, LAPP.EndUserApplication))
785+
referencedByEndUser = true;
786+
}
787+
}
788+
finally
789+
{
790+
appIt.close();
791+
}
792+
URI proxy = referencedByAdmin ? backendProxyAdmin : (referencedByEndUser ? backendProxyEndUser : null);
793+
serviceContextMap.put(svcResource.getURI(),
794+
new com.atomgraph.linkeddatahub.model.ServiceContext(svc, noCertClient, mediaTypes, maxGetRequestSize, proxy));
795+
}
796+
}
797+
finally
798+
{
799+
serviceIt.close();
800+
}
801+
745802
// TO-DO: config property for cacheModelLoads
746803
endUserOntModelSpecs = new HashMap<>();
747804
dataManager = new DataManagerImpl(locationMapper, new HashMap<>(), GraphStoreClient.create(client, mediaTypes), cacheModelLoads, preemptiveAuth, resolvingUncached);
@@ -1436,12 +1493,12 @@ public Map<Integer, Resource> getLengthMap(Map<URI, Resource> apps)
14361493
*/
14371494
public void submitImport(CSVImport csvImport, com.atomgraph.linkeddatahub.apps.model.Application app, Service service, Service adminService, String baseURI, GraphStoreClient gsc)
14381495
{
1439-
new ImportExecutor(importThreadPool).start(service, adminService, baseURI, gsc, csvImport);
1496+
new ImportExecutor(importThreadPool).start(service, adminService, this, baseURI, gsc, csvImport);
14401497
}
1441-
1498+
14421499
/**
14431500
* Submits RDF import for asynchronous execution.
1444-
*
1501+
*
14451502
* @param rdfImport import resource
14461503
* @param app current application
14471504
* @param service current SPARQL service
@@ -1451,7 +1508,7 @@ public void submitImport(CSVImport csvImport, com.atomgraph.linkeddatahub.apps.m
14511508
*/
14521509
public void submitImport(RDFImport rdfImport, com.atomgraph.linkeddatahub.apps.model.Application app, Service service, Service adminService, String baseURI, GraphStoreClient gsc)
14531510
{
1454-
new ImportExecutor(importThreadPool).start(service, adminService, baseURI, gsc, rdfImport);
1511+
new ImportExecutor(importThreadPool).start(service, adminService, this, baseURI, gsc, rdfImport);
14551512
}
14561513

14571514
/**
@@ -1768,15 +1825,38 @@ public Client getExternalClient()
17681825
}
17691826

17701827
/**
1771-
* Bans URL from the proxy cache.
1828+
* Returns the service context for the given service (client + proxy configuration).
1829+
* The context is keyed by the service's URI string.
1830+
*
1831+
* @param service SPARQL service
1832+
* @return service context, or {@code null} if the service is not registered
1833+
*/
1834+
public com.atomgraph.linkeddatahub.model.ServiceContext getServiceContext(com.atomgraph.linkeddatahub.model.Service service)
1835+
{
1836+
if (service == null) throw new IllegalArgumentException("Service cannot be null");
1837+
return serviceContextMap.get(service.getURI());
1838+
}
1839+
1840+
/**
1841+
* Returns the frontend proxy URI used for cache invalidation BAN requests.
1842+
*
1843+
* @return frontend proxy URI, or {@code null} if not configured
1844+
*/
1845+
public URI getFrontendProxy()
1846+
{
1847+
return frontendProxy;
1848+
}
1849+
1850+
/**
1851+
* Bans URL from the proxy cache using the given proxy URI.
17721852
*
1773-
* @param proxy proxy server resource
1853+
* @param proxyURI proxy URI
17741854
* @param url banned URL
17751855
* @param urlEncode if true, the banned URL value will be URL-encoded
1776-
* @throws IllegalArgumentException if url is null
17771856
*/
1778-
public void ban(Resource proxy, String url, boolean urlEncode)
1857+
public void ban(URI proxyURI, String url, boolean urlEncode)
17791858
{
1859+
if (proxyURI == null) throw new IllegalArgumentException("Proxy URI cannot be null");
17801860
if (url == null) throw new IllegalArgumentException("URL cannot be null");
17811861

17821862
// Extract path from URL - Varnish req.url only contains the path, not the full URL
@@ -1786,7 +1866,7 @@ public void ban(Resource proxy, String url, boolean urlEncode)
17861866

17871867
final String urlValue = urlEncode ? UriComponent.encode(path, UriComponent.Type.UNRESERVED) : path;
17881868

1789-
try (Response cr = getClient().target(proxy.getURI()).
1869+
try (Response cr = getClient().target(proxyURI).
17901870
request().
17911871
header(CacheInvalidationFilter.HEADER_NAME, urlValue).
17921872
method("BAN", Response.class))

0 commit comments

Comments
 (0)