/** * Return the catalog capabilities supported by this catalog. Normally this will correspond to * the capabilities supported by the used catalog facade. * * @return catalog supported capabilities */ default CatalogCapabilities getCatalogCapabilities() { // return catalog default capabilities return new CatalogCapabilities(); } }
@Override public CatalogCapabilities getCatalogCapabilities() { CatalogCapabilities capabilities = facade.getCatalogCapabilities(); // this wrapper adds support for isolated workspaces capabilities.setIsolatedWorkspacesSupport(true); return capabilities; }
public ValidationResult validate(WorkspaceInfo workspace, boolean isNew) { if (workspace.isIsolated() && !getCatalogCapabilities().supportsIsolatedWorkspaces()) { // isolated namespaces \ workspaces are not supported by this catalog throw new IllegalArgumentException( String.format( "Workspace '%s' is isolated but isolated workspaces are not supported by this catalog.", workspace.getName())); } if (isNull(workspace.getName())) { throw new NullPointerException("workspace name must not be null"); } if (workspace.getName().equals(DEFAULT)) { throw new IllegalArgumentException( DEFAULT + " is a reserved keyword, can't be used as the workspace name"); } WorkspaceInfo existing = getWorkspaceByName(workspace.getName()); if (existing != null && !existing.getId().equals(workspace.getId())) { throw new IllegalArgumentException( "Workspace named '" + workspace.getName() + "' already exists."); } return postValidate(workspace, isNew); }
public ValidationResult validate(NamespaceInfo namespace, boolean isNew) { if (namespace.isIsolated() && !getCatalogCapabilities().supportsIsolatedWorkspaces()) {
if (!getCatalog().getCatalogCapabilities().supportsIsolatedWorkspaces()) {
/** * Return the catalog capabilities supported by this facade. * * @return catalog supported capabilities */ default CatalogCapabilities getCatalogCapabilities() { // return catalog default supported capabilities return new CatalogCapabilities(); }