public class APIMgtDAO extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ADD_PRODUCT_RESOURCE_MAPPING_SQL |
static String |
GET_CURRENT_API_PRODUCT_RESOURCES |
static String |
GET_URL_MAPPINGS_ID |
static String |
GET_URL_MAPPINGS_WITH_SCOPE_BY_URL_MAPPING_ID |
static String |
INSERT_SCOPE_RESOURCE_MAPPING |
static String |
INSERT_URL_MAPPINGS |
static String |
REMOVE_PRODUCT_ENTRIES_IN_AM_API_PRODUCT_MAPPING |
Modifier and Type | Method and Description |
---|---|
void |
addDataToResourceScopeMapping(List<AMAPIResourceScopeMappingDTO> resourceScopeMappingDTOS)
This method is used to insert data to AM_API_RESOURCE_SCOPE_MAPPING table
|
void |
addDefaultURLTemplatesForWSAPIs(List<Integer> wsApiIds)
This method is used to insert data to add default URL Mappings of WS APIs
|
void |
addDynamicGatewayEnvironments(List<GatewayEnvironmentDTO> environments)
This method is used to insert dynamic environments to the table AM_GATEWAY_ENVIRONMENT
and VHosts to the table AM_GW_VHOST
|
void |
addKeyManagerConfiguration(KeyManagerConfigurationDTO keyManagerConfigurationDTO) |
org.wso2.carbon.apimgt.api.model.APIRevision |
checkAPIUUIDIsARevisionUUID(String apiUUID)
Get a provided api uuid is in the revision db table
|
void |
dropLabelTable()
Drop AM_LABELS and AM_LABEL_URLS tables
|
ArrayList<APIScopeMappingDTO> |
getAMScopeData()
This mehthod is used to get data from AM_API_SCOPE
|
ArrayList<APIInfoDTO> |
getAPIData()
This mehthod is used to get data from AM_API table
|
String |
getAPIID(String context)
This method is used to get API Id using API context
|
ArrayList<APIInfoScopeMappingDTO> |
getAPIInfoScopeData()
This method is used to get data from AM_API_SCOPE, IDN_OAUTH2_SCOPE by tenant id
|
ArrayList<APIURLMappingInfoDTO> |
getAPIURLMappingData()
This method is used to get data from AM_API_URL_MAPPING table
|
static ArrayList<String> |
getAppsOfTypeJWT(int tenantId)
Get the list of consumer keys corresponding to the apps created of the type JWT
|
static APIMgtDAO |
getInstance() |
KeyManagerConfigurationDTO |
getKeyManagerConfigurationByName(String tenantDomain,
String name) |
List<LabelDTO> |
getLabels()
This method is used to read labels from the table AM_LABELS and access URLs from the table AM_LABEL_URLS
|
ArrayList<ResourceScopeInfoDTO> |
getResourceScopeData()
This mehthod is used to get data from IDN_OAUTH2_RESOURCE_SCOPE by tenant id
|
int |
getScopeId(String resourcePath)
This method is used to retrieve the scope id given the resource path
|
ScopeInfoDTO |
getScopeInfoByScopeId(int scopeId)
This method is used to retrieve the scope details given the scopeId
|
static String |
getStringFromInputStream(InputStream is)
Function converts IS to String
Used for handling blobs
|
void |
removeDuplicateScopeEntries(ArrayList<APIScopeMappingDTO> duplicateList)
This method is used to remove the duplicate data from IDN_OAUTH2_SCOPE, AM_API_SCOPE
and IDN_OAUTH2_SCOPE_BINDING tables
|
void |
removePreviousURLTemplatesForWSAPIs(List<Integer> wsApiIds)
This method is used to remove previous entries from URL Mapping table of WS APIs
|
void |
replaceKeyMappingKMNamebyUUID(org.wso2.carbon.user.api.Tenant tenant)
This method is used to fetch and update the key mapping table with the key manager ID
|
void |
replaceRegistrationKMNamebyUUID(org.wso2.carbon.user.api.Tenant tenant)
This method is used to fetch and update the app registration table with the key manager ID
|
Set<String> |
retrieveListOfEndpointCertificateAliases() |
List<Integer> |
retrieveWebSocketAPIs() |
void |
updateAPIType(List<APIInfoDTO> apiInfoDTOList,
int tenantId,
String tenantDomain)
This method is used to update the API_TYPE in AM_API in the DB using API details
|
void |
updateAppRegistration(Connection connection,
HashMap<Integer,String> registrationEntries)
This method is used to update the app registration table with the key manager ID
|
void |
updateEndpointCertificates(Map<String,String> certificateMap) |
void |
updateKeyMappings(Connection connection,
HashMap<String,String> keyMappingEntries)
This method is used to update the key mapping table with the key manager ID
|
void |
updateProductMappings()
This method is used to update the AM_API_PRODUCT_MAPPING_TABLE
|
static void |
updateScopeResource(int newScopeId,
String resourcePath,
int scopeId)
Alter the scope id in the resource scope
|
static void |
updateTokenTypeToJWT(String consumerKey)
Updates the token type of the service provider corresponding to the consumer key provided to the JWT token type
|
void |
updateUUIDAndStatus(List<APIInfoDTO> apiInfoDTOS)
This method is used to set the UUID in the DB using Api details
|
public static String GET_CURRENT_API_PRODUCT_RESOURCES
public static String GET_URL_MAPPINGS_WITH_SCOPE_BY_URL_MAPPING_ID
public static String INSERT_URL_MAPPINGS
public static String GET_URL_MAPPINGS_ID
public static String INSERT_SCOPE_RESOURCE_MAPPING
public static String ADD_PRODUCT_RESOURCE_MAPPING_SQL
public static final String REMOVE_PRODUCT_ENTRIES_IN_AM_API_PRODUCT_MAPPING
public static APIMgtDAO getInstance()
public ArrayList<ResourceScopeInfoDTO> getResourceScopeData() throws APIMigrationException
APIMigrationException
public ArrayList<APIInfoDTO> getAPIData() throws APIMigrationException
APIMigrationException
public ArrayList<APIURLMappingInfoDTO> getAPIURLMappingData() throws APIMigrationException
APIMigrationException
public ArrayList<APIInfoScopeMappingDTO> getAPIInfoScopeData() throws APIMigrationException
APIMigrationException
public static void updateScopeResource(int newScopeId, String resourcePath, int scopeId) throws APIMigrationException
scopeId
- Scope IDresourcePath
- Resource PathnewScopeId
- Scope IDAPIMigrationException
public ArrayList<APIScopeMappingDTO> getAMScopeData() throws APIMigrationException
APIMigrationException
public String getAPIID(String context) throws APIMigrationException
context
- APIMigrationException
public int getScopeId(String resourcePath) throws APIMigrationException
resourcePath
- APIMigrationException
public ScopeInfoDTO getScopeInfoByScopeId(int scopeId) throws APIMigrationException
scopeId
- APIMigrationException
public void addDataToResourceScopeMapping(List<AMAPIResourceScopeMappingDTO> resourceScopeMappingDTOS) throws APIMigrationException
resourceScopeMappingDTOS
- APIMigrationException
public void removeDuplicateScopeEntries(ArrayList<APIScopeMappingDTO> duplicateList) throws APIMigrationException
duplicateList
- APIMigrationException
public static ArrayList<String> getAppsOfTypeJWT(int tenantId) throws APIMigrationException
tenantId
- Relevant tenant ID of the service provider ownerAPIMigrationException
public static void updateTokenTypeToJWT(String consumerKey) throws APIMigrationException
consumerKey
- The consumer key of the application that needs to be alteredAPIMigrationException
public void replaceKeyMappingKMNamebyUUID(org.wso2.carbon.user.api.Tenant tenant) throws APIMigrationException
APIMigrationException
public void updateKeyMappings(Connection connection, HashMap<String,String> keyMappingEntries) throws APIMigrationException
APIMigrationException
public void replaceRegistrationKMNamebyUUID(org.wso2.carbon.user.api.Tenant tenant) throws APIMigrationException
APIMigrationException
public void updateAppRegistration(Connection connection, HashMap<Integer,String> registrationEntries) throws APIMigrationException
APIMigrationException
public void updateUUIDAndStatus(List<APIInfoDTO> apiInfoDTOS) throws APIMigrationException
apiInfoDTOS
- API Information listAPIMigrationException
public Set<String> retrieveListOfEndpointCertificateAliases() throws APIMigrationException
APIMigrationException
public void updateEndpointCertificates(Map<String,String> certificateMap) throws APIMigrationException
APIMigrationException
public void updateProductMappings() throws APIMigrationException
APIMigrationException
public static String getStringFromInputStream(InputStream is) throws APIMigrationException
is
- - The Input StreamAPIMigrationException
public List<LabelDTO> getLabels() throws APIMigrationException
APIMigrationException
- if failed to read labels from the tablepublic void addDynamicGatewayEnvironments(List<GatewayEnvironmentDTO> environments) throws APIMigrationException
environments
- List of environments to be added to the tableAPIMigrationException
- if failed to add environments and vhostspublic void dropLabelTable() throws APIMigrationException
APIMigrationException
- if failed to drop tablespublic List<Integer> retrieveWebSocketAPIs() throws APIMigrationException
APIMigrationException
public void addDefaultURLTemplatesForWSAPIs(List<Integer> wsApiIds) throws APIMigrationException
wsApiIds
- APIMigrationException
public void removePreviousURLTemplatesForWSAPIs(List<Integer> wsApiIds) throws APIMigrationException
wsApiIds
- APIMigrationException
public void addKeyManagerConfiguration(KeyManagerConfigurationDTO keyManagerConfigurationDTO) throws APIMigrationException
APIMigrationException
public KeyManagerConfigurationDTO getKeyManagerConfigurationByName(String tenantDomain, String name) throws APIMigrationException
APIMigrationException
public void updateAPIType(List<APIInfoDTO> apiInfoDTOList, int tenantId, String tenantDomain) throws APIMigrationException
apiInfoDTOList
- API Information listtenantId
- tenant IDtenantDomain
- tenant domainAPIMigrationException
- Migration Exceptionpublic org.wso2.carbon.apimgt.api.model.APIRevision checkAPIUUIDIsARevisionUUID(String apiUUID) throws APIMigrationException
APIMigrationException
- if an error occurs while checking revision tableCopyright © 2024 WSO2. All rights reserved.