Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change api provider #12200

Merged
merged 28 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3c17da2
ChangeApiProvider rest api added
shnrndk Nov 19, 2023
3c5bbc4
Added support to change provider by get artifacts from apiid.
shnrndk Nov 22, 2023
583cdab
Remove the api path move logic
shnrndk Nov 22, 2023
982daf1
Added the view apis rest api in admin portal and fixed bugs in the ch…
shnrndk Nov 27, 2023
d6f3a11
Added the uuid key to the get apis object in the admin rest api.
shnrndk Nov 29, 2023
bd246eb
Delete api bug fixed
shnrndk Nov 29, 2023
2e46e19
Remove msg context param
shnrndk Nov 30, 2023
7de9b63
ApiApiServiceImpl added to admin
shnrndk Dec 4, 2023
1c9b278
Api Name Space Restriction Removed.
shnrndk Nov 19, 2023
1f48063
Content Based search improved to support api name search with spaces
shnrndk Nov 19, 2023
bb2e72e
Api restore lifeCycleState bug fix
shnrndk Dec 1, 2023
e65dc33
Delete bug fixed
shnrndk Dec 5, 2023
07d101e
Admin portal get apis implement, and fix bugs in change api provider.
shnrndk Dec 11, 2023
7a4e130
Delete improved
shnrndk Dec 11, 2023
bf8d504
Added validation to remove trailing leading spaces and multiple occur…
shnrndk Dec 11, 2023
88a9538
add apim:api_provider_change to tenant-conf.json
shnrndk Dec 11, 2023
810c6dc
API Constants added
shnrndk Dec 12, 2023
b131264
add apis doc bug fixed if provider changed, and search issue fixed.
shnrndk Dec 13, 2023
433717f
Pagination issues solved.
shnrndk Dec 13, 2023
e8e96a1
Merge branch 'master' into changeApiProvider3
shnrndk Dec 13, 2023
b2cc551
Extract api provider feature added
shnrndk Dec 14, 2023
97720cf
Merge branch 'wso2:master' into changeApiProvider3
shnrndk Dec 17, 2023
a561c17
add comments
shnrndk Dec 17, 2023
40c4078
add exception codes
shnrndk Dec 19, 2023
1a89789
Merge branch 'master' into changeApiProvider3
shnrndk Jan 19, 2024
a877552
Add constants and license header
shnrndk Jan 19, 2024
c4e957a
update api provider suffix slash constant
shnrndk Feb 7, 2024
9d96651
fix deploy pizzashackapi display issue after publish
shnrndk Feb 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -484,4 +484,27 @@ boolean isScopeExists(String username, String scopeName)
Policy[] getPolicies(int tenantId, String level) throws APIManagementException;

Policy getPolicyByNameAndType(int tenantId, String level, String name) throws APIManagementException;

/**
* Update the Api Provider of a given Api Id
*
* @param apiId Api ID
* @param provider New ProviderName/Owner of the Api
* @param organisation Organisation
* @throws APIManagementException
*/
void updateApiProvider(String apiId, String provider, String organisation) throws APIManagementException;

/**
* Get/Search All Apis in admin portal
*
* @param searchQuery Api name search query
* @param organization organization
* @param start
* @param end
* @return
* @throws APIManagementException
*/
Map<String, Object> searchPaginatedApis(String searchQuery, String organization, int start, int end)
throws APIManagementException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,11 @@ public enum ExceptionCodes implements ErrorHandler {
"Revision deployment request conflicted with the current deployment state of the revision %s. Please try again later", false),
INVALID_API_ID(902006, "Invalid API ID", 404, "The provided API ID is not found %s", false),
INVALID_ENDPOINT_CONFIG(902012, "Endpoint config value(s) is(are) not valid", 400, "Endpoint config value(s) is(are) not valid"),
ARTIFACT_SYNC_HTTP_REQUEST_FAILED(903009, "Error while retrieving from remote endpoint", 500, "Error while executing HTTP request to retrieve from remote endpoint"),
KEY_MANAGER_RESTRICTED_FOR_USER(902013, "Unauthorized Access to Key Manager", 403, "Key Manager is Restricted for this user"),
ARTIFACT_SYNC_HTTP_REQUEST_FAILED(903009, "Error while retrieving from remote endpoint", 500, "Error while executing HTTP request to retrieve from remote endpoint");
// Admin portal get apis and api provider change related errors
CHANGE_API_PROVIDER_FAILED(903011, "Error while changing the API provider", 500, "Error while changing the API provider in the registry or DB"),
GET_SEARCH_APIS_IN_ADMIN_FAILED(903012, "Error while getting the apis", 500, "Error while getting/searching the apis from registry");

private final long errorCode;
private final String errorMessage;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* 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.apimgt.api.model;

/**
* This class represent the minimized view of the Application in api model for Key manager operations in admin REST API.
*/
public class ApplicationInfoKeyManager extends ApplicationInfo {

Check warning on line 23 in components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/ApplicationInfoKeyManager.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/ApplicationInfoKeyManager.java#L23

Added line #L23 was not covered by tests

private String organization;

public String getOrganization() {

return organization;

Check warning on line 29 in components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/ApplicationInfoKeyManager.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/ApplicationInfoKeyManager.java#L29

Added line #L29 was not covered by tests
}

public void setOrganization(String organization) {

this.organization = organization;
}

Check warning on line 35 in components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/ApplicationInfoKeyManager.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/ApplicationInfoKeyManager.java#L34-L35

Added lines #L34 - L35 were not covered by tests

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.everit.json.schema.Schema;
import org.everit.json.schema.ValidationException;
import org.json.JSONException;
Expand All @@ -39,11 +40,17 @@
import org.wso2.carbon.apimgt.api.APIMgtResourceNotFoundException;
import org.wso2.carbon.apimgt.api.ExceptionCodes;
import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO;
import org.wso2.carbon.apimgt.api.model.API;
import org.wso2.carbon.apimgt.api.dto.KeyManagerPermissionConfigurationDTO;
import org.wso2.carbon.apimgt.api.model.APICategory;
import org.wso2.carbon.apimgt.api.model.APIIdentifier;
import org.wso2.carbon.apimgt.api.model.APIProduct;
import org.wso2.carbon.apimgt.api.model.APIProductIdentifier;
import org.wso2.carbon.apimgt.api.model.Application;
import org.wso2.carbon.apimgt.api.model.ApplicationInfo;
import org.wso2.carbon.apimgt.api.model.ConfigurationDto;
import org.wso2.carbon.apimgt.api.model.Documentation;
import org.wso2.carbon.apimgt.api.model.DocumentationType;
import org.wso2.carbon.apimgt.api.model.Environment;
import org.wso2.carbon.apimgt.api.model.KeyManagerConfiguration;
import org.wso2.carbon.apimgt.api.model.KeyManagerConnectorConfiguration;
Expand All @@ -60,11 +67,30 @@
import org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants;
import org.wso2.carbon.apimgt.impl.dto.ThrottleProperties;
import org.wso2.carbon.apimgt.impl.dto.WorkflowProperties;
import org.wso2.carbon.apimgt.impl.factory.PersistenceFactory;
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
import org.wso2.carbon.apimgt.impl.keymgt.KeyMgtNotificationSender;
import org.wso2.carbon.apimgt.impl.monetization.DefaultMonetizationImpl;
import org.wso2.carbon.apimgt.impl.service.KeyMgtRegistrationService;
import org.wso2.carbon.apimgt.impl.utils.APINameComparator;
import org.wso2.carbon.apimgt.impl.utils.APIProductNameComparator;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import org.wso2.carbon.apimgt.impl.utils.ContentSearchResultNameComparator;
import org.wso2.carbon.apimgt.persistence.APIPersistence;
import org.wso2.carbon.apimgt.persistence.dto.AdminApiInfo;
import org.wso2.carbon.apimgt.persistence.dto.AdminApiSearchContent;
import org.wso2.carbon.apimgt.persistence.dto.AdminContentSearchResult;
import org.wso2.carbon.apimgt.persistence.dto.DocumentSearchContent;
import org.wso2.carbon.apimgt.persistence.dto.Organization;
import org.wso2.carbon.apimgt.persistence.dto.PublisherAPIInfo;
import org.wso2.carbon.apimgt.persistence.dto.PublisherAPISearchResult;
import org.wso2.carbon.apimgt.persistence.dto.PublisherContentSearchResult;
import org.wso2.carbon.apimgt.persistence.dto.PublisherSearchContent;
import org.wso2.carbon.apimgt.persistence.dto.SearchContent;
import org.wso2.carbon.apimgt.persistence.dto.UserContext;
import org.wso2.carbon.apimgt.persistence.exceptions.APIPersistenceException;
import org.wso2.carbon.apimgt.persistence.mapper.APIMapper;
import org.wso2.carbon.apimgt.persistence.utils.RegistrySearchUtil;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.core.util.CryptoException;
Expand All @@ -91,9 +117,13 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TimeZone;
import java.util.TreeSet;
import java.util.UUID;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -1327,6 +1357,76 @@
}
}

public void updateApiProvider(String apiId, String provider, String organisation) throws APIManagementException {
APIPersistence apiPersistenceInstance = PersistenceFactory.getAPIPersistenceInstance();

Check warning on line 1361 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1361

Added line #L1361 was not covered by tests
try {
ApiMgtDAO.getInstance().updateApiProvider(apiId, provider);
apiPersistenceInstance.changeApiProvider(provider, apiId, organisation);
} catch (APIPersistenceException e) {
throw new APIManagementException("Error while changing the API provider", e);
}
}

Check warning on line 1368 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1363-L1368

Added lines #L1363 - L1368 were not covered by tests

/**
* get/search paginated APIs in admin portal
*
* @param searchQuery API name search query
* @param organization organization
* @param start start index of the pagination
* @param end end index of the pagination
* @return APIs result object
* @throws APIManagementException if an error occurs when searching/getting the APIs
*/
public Map<String, Object> searchPaginatedApis(String searchQuery, String organization, int start, int end)
throws APIManagementException {
ArrayList<Object> compoundResult = new ArrayList<>();
Map<String, Object> result = new HashMap<>();
SortedSet<API> apiSet = new TreeSet<>(new APINameComparator());
String modifiedSearchQuery = buildSearchQuery(searchQuery);

Check warning on line 1385 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1382-L1385

Added lines #L1382 - L1385 were not covered by tests
try {
APIPersistence apiPersistenceInstance = PersistenceFactory.getAPIPersistenceInstance();
AdminContentSearchResult results = apiPersistenceInstance.searchContentForAdmin(organization,

Check warning on line 1388 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1387-L1388

Added lines #L1387 - L1388 were not covered by tests
modifiedSearchQuery, start, end, end);
if (results != null) {
List<SearchContent> resultList = results.getApis();

Check warning on line 1391 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1391

Added line #L1391 was not covered by tests
for (SearchContent item : resultList) {
if (APIConstants.API_IDENTIFIER_TYPE.equals(item.getType())) {
AdminApiSearchContent adminSearchApi = (AdminApiSearchContent) item;
API api = new API(new APIIdentifier(adminSearchApi.getProvider(), adminSearchApi.getName(),
adminSearchApi.getVersion()));
api.setUuid(adminSearchApi.getId());
apiSet.add(api);

Check warning on line 1398 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1394-L1398

Added lines #L1394 - L1398 were not covered by tests
}
}
compoundResult.addAll(apiSet);
compoundResult.sort(new ContentSearchResultNameComparator());
result.put(APIConstants.API_DATA_LENGTH, compoundResult.size());
result.put(APIConstants.ADMIN_API_LIST_RESPONSE_PARAMS_TOTAL, results.getApiTotal());
} else {
result.put(APIConstants.API_DATA_LENGTH, compoundResult.size());

Check warning on line 1406 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1400-L1406

Added lines #L1400 - L1406 were not covered by tests
}
} catch (APIPersistenceException e) {
throw new APIManagementException("Error while searching apis ",

Check warning on line 1409 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1408-L1409

Added lines #L1408 - L1409 were not covered by tests
ExceptionCodes.GET_SEARCH_APIS_IN_ADMIN_FAILED);
}
result.put(APIConstants.API_DATA_APIS, compoundResult);
return result;

Check warning on line 1413 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1411-L1413

Added lines #L1411 - L1413 were not covered by tests
}

/**
* If the user provided a search query then it will use that, otherwise it will use the asterix(*) symbol.
*
* @param searchQuery searchQuery that the user provided
* @return modified searchQuery
*/
private String buildSearchQuery(String searchQuery) {
if (searchQuery.equals(APIConstants.CHAR_ASTERIX)) {
return String.format(APIConstants.ADMIN_PORTAL_GET_APIS_QUERY, APIConstants.CHAR_ASTERIX);

Check warning on line 1424 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1424

Added line #L1424 was not covered by tests
} else {
return String.format(APIConstants.ADMIN_PORTAL_GET_APIS_QUERY, searchQuery);

Check warning on line 1426 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java#L1426

Added line #L1426 was not covered by tests
}
}

@Override
public String getTenantConfigSchema(String organization) {
return APIUtil.retrieveTenantConfigJsonSchema().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ public final class APIConstants {

public static final String SSL_VERIFY_CLIENT_STATUS_REQUIRE = "require";

public static final String ADMIN_PORTAL_GET_APIS_QUERY = "name=\\*\"%s\"\\* AND" +
" mediaType:application\\/vnd.wso2\\-api\\+xml AND" +
" type=(HTTP OR WS OR SOAPTOREST OR GRAPHQL OR SOAP OR SSE OR WEBSUB OR WEBHOOK OR ASYNC)";

//location for custom url domain mapings. "<tenant-id>" will be replaced by actual tenant name.
public static final String API_DOMAIN_MAPPINGS = "/customurl/api-cloud/<tenant-id>/urlMapping/<tenant-id>";
public static final String API_DOMAIN_MAPPING_TENANT_ID_IDENTIFIER = "<tenant-id>";
Expand Down Expand Up @@ -1653,6 +1657,7 @@ private ConfigParameters() {
public static final String API_DATA_DEFAULT_THUMB = "images/api-default.png";
public static final String API_DATA_APIS = "apis";
public static final String API_DATA_TOT_LENGTH = "totalLength";
public static final String ADMIN_API_LIST_RESPONSE_PARAMS_TOTAL = "totalLength";
public static final String API_DATA_LENGTH = "length";
public static final String API_DATA_ISMORE = "isMore";
public static final String API_DATA_PRODUCTION_ENDPOINTS = "production_endpoints";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18630,6 +18630,31 @@
}
}

/**
* Update the API provider of a given API
*
* @param apiUUID API id of the API that needs to update the provider
* @param providerName New API provider
* @throws APIManagementException if an error occurs when changing the API provider
*/
public void updateApiProvider(String apiUUID, String providerName)

Check warning on line 18640 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java#L18637-L18640

Added lines #L18637 - L18640 were not covered by tests
throws APIManagementException {
try (Connection connection = APIMgtDBUtil.getConnection()) {
connection.setAutoCommit(false);

Check warning on line 18643 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java#L18643

Added line #L18643 was not covered by tests
try (PreparedStatement statement = connection.prepareStatement(SQLConstants.UPDATE_API_PROVIDER_SQL)) {
statement.setString(1, providerName);
statement.setString(2, apiUUID);
statement.executeUpdate();
connection.commit();

Check warning on line 18648 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java#L18645-L18648

Added lines #L18645 - L18648 were not covered by tests
} catch (SQLException e) {
connection.rollback();
throw e;
}
} catch (SQLException e) {
handleException("Error while updating the API provider of " + apiUUID, e);
}
}

private void updateLatestRevisionNumber(Connection connection, String apiUUID, int revisionId) throws SQLException {

try (PreparedStatement preparedStatement =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public class SQLConstants {
" MD5 = ? " +
" WHERE API_ID = ?";

public static final String UPDATE_API_PROVIDER_SQL = "UPDATE AM_API SET API_PROVIDER = ? WHERE API_UUID = ?";

public static final String GET_MD5_VALUE_OF_SERVICE_BY_API_ID_SQL = "SELECT " +
" AM_SERVICE_CATALOG.MD5 AS SERVICE_MD5, " +
" AM_SERVICE_CATALOG.SERVICE_NAME, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@
"Name": "apim:admin_tier_view",
"Roles": "admin"
},
{
"Name": "apim:api_provider_change",
"Roles": "admin"
},
{
"Name": "apim:gateway_policy_manage",
"Roles": "admin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,15 @@
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.UUID;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.ArrayList;

import java.util.UUID;
import javax.cache.Caching;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLInputFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public static class Monetization {
public static final String TAG_COLON_SEARCH_TYPE_PREFIX = "tag:";
public static final String NAME_TYPE_PREFIX = "name";
private static final String PROVIDER_SEARCH_TYPE_PREFIX = "provider";
public static final String API_PROVIDER_SUFFIX_SLASH = PROVIDER_SEARCH_TYPE_PREFIX + "/";
private static final String VERSION_SEARCH_TYPE_PREFIX = "version";
private static final String CONTEXT_SEARCH_TYPE_PREFIX = "context";
public static final String CONTENT_SEARCH_TYPE_PREFIX = "content";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package org.wso2.carbon.apimgt.persistence;

import org.wso2.carbon.apimgt.api.APIManagementException;
import org.wso2.carbon.apimgt.api.model.Tag;
import org.wso2.carbon.apimgt.persistence.dto.AdminContentSearchResult;
import org.wso2.carbon.apimgt.persistence.dto.DevPortalAPI;
import org.wso2.carbon.apimgt.persistence.dto.DevPortalAPISearchResult;
import org.wso2.carbon.apimgt.persistence.dto.DevPortalContentSearchResult;
Expand Down Expand Up @@ -508,4 +510,9 @@ PublisherAPIProductSearchResult searchAPIProductsForPublisher(Organization org,
*/
Set<Tag> getAllTags(Organization org, UserContext ctx) throws APIPersistenceException;

void changeApiProvider(String providerName, String apiId, String org) throws APIManagementException,
APIPersistenceException;

AdminContentSearchResult searchContentForAdmin(String org, String searchQuery, int start, int count,
int limit) throws APIPersistenceException;
}
Loading
Loading