diff --git a/core/org.wso2.carbon.utils/pom.xml b/core/org.wso2.carbon.utils/pom.xml index b2d1ca6d5c8..36f2e99fa88 100644 --- a/core/org.wso2.carbon.utils/pom.xml +++ b/core/org.wso2.carbon.utils/pom.xml @@ -278,7 +278,8 @@ org.wso2.carbon.keystore.persistence.model, org.wso2.carbon.utils.*, org.wso2.carbon.context, - !org.wso2.carbon.context.internal + !org.wso2.carbon.context.internal, + org.wso2.carbon.context.model org.wso2.carbon.context.internal.CarbonContextActivator diff --git a/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/OperationScopeValidationContext.java b/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/OperationScopeValidationContext.java index 75505b1eef2..6b2869a7d79 100644 --- a/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/OperationScopeValidationContext.java +++ b/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/OperationScopeValidationContext.java @@ -18,9 +18,9 @@ package org.wso2.carbon.context; +import org.wso2.carbon.context.model.OperationScopeSet; + import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** * This class holds the context for validating operation scopes. @@ -33,7 +33,7 @@ public class OperationScopeValidationContext { private String apiIdentifier; private boolean validationRequired; private List validatedScopes; - private Map operationScopeMap = new ConcurrentHashMap<>(); + private OperationScopeSet operationScopeSet; public String getApiIdentifier() { @@ -65,13 +65,13 @@ public void setValidatedScopes(List validatedScopes) { this.validatedScopes = validatedScopes; } - public Map getOperationScopeMap() { + public OperationScopeSet getOperationScopeSet() { - return operationScopeMap; + return operationScopeSet; } - public void setOperationScopeMap(Map operationScopeMap) { + public void setOperationScopeSet(OperationScopeSet operationScopeSet) { - this.operationScopeMap = operationScopeMap; + this.operationScopeSet = operationScopeSet; } } diff --git a/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/model/OperationScopeSet.java b/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/model/OperationScopeSet.java new file mode 100644 index 00000000000..3985a7e9f10 --- /dev/null +++ b/core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/model/OperationScopeSet.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.context.model; + +import java.util.Map; + +/** + * Model class to hold operation scope details. + */ +public class OperationScopeSet { + + private boolean isMandatory; + private Map operationScopeMap; + + public boolean getIsMandatory() { + + return isMandatory; + } + + public void setIsMandatory(boolean isMandatory) { + + this.isMandatory = isMandatory; + } + + public Map getOperationScopeMap() { + + return operationScopeMap; + } + + public void setOperationScopeMap(Map operationScopeMap) { + + this.operationScopeMap = operationScopeMap; + } + +}