Class TenantResolverEndpoint
java.lang.Object
com.broadleafcommerce.tenant.web.endpoint.TenantResolverEndpoint
@FrameworkRestController
@FrameworkMapping("/resolver")
@DataRouteByExample(Tenant.class)
public class TenantResolverEndpoint
extends Object
This endpoint is intended for use by apps (e.g. admins) to resolve the current matching
Tenant
or Application
.- Author:
- Nathan Moore (nathanmoore), Nick Crum (ncrum)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTenantResolverEndpoint
(TenantResolver resolver, TenantService<Tenant> tenantService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateApplicationResponse
(@NonNull Application application) Creates anTenantResolverEndpoint.ApplicationResolverResponse
for theApplication
.protected TenantResolver
protected TenantService<Tenant>
protected com.broadleafcommerce.common.extension.TypeFactory
org.springframework.http.ResponseEntity<TenantResolverEndpoint.AdminTenantResolverResponse>
resolveAdminTenant
(String url) org.springframework.http.ResponseEntity<TenantResolverEndpoint.ApplicationResolverResponse>
resolveApplication
(String url, String id, String token)
-
Field Details
-
RESOLVER_URI
- See Also:
-
-
Constructor Details
-
TenantResolverEndpoint
public TenantResolverEndpoint(TenantResolver resolver, TenantService<Tenant> tenantService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
resolveAdminTenant
@FrameworkGetMapping("/admin") public org.springframework.http.ResponseEntity<TenantResolverEndpoint.AdminTenantResolverResponse> resolveAdminTenant(@RequestParam String url) -
resolveApplication
@FrameworkGetMapping("/application") public org.springframework.http.ResponseEntity<TenantResolverEndpoint.ApplicationResolverResponse> resolveApplication(@RequestParam(required=false) String url, @RequestParam(required=false) String id, @RequestParam(required=false) String token) -
createApplicationResponse
protected TenantResolverEndpoint.ApplicationResolverResponse createApplicationResponse(@NonNull @NonNull Application application) Creates anTenantResolverEndpoint.ApplicationResolverResponse
for theApplication
. This will additionally look up the owningTenant
.- Parameters:
application
-Application
to be used in the response- Returns:
- An
TenantResolverEndpoint.ApplicationResolverResponse
forapplication
including itsTenant
-
getResolver
-
getTenantService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-