Package org.wso2.carbon.apimgt.impl.dao
Class ApiMgtDAO
- java.lang.Object
-
- org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO
-
public class ApiMgtDAO extends Object
This class represent the ApiMgtDAO.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAlertTypesConfigInfo(String userName, String emailList, String alertTypesIDList, String stakeHolder)
int
addAPI(org.wso2.carbon.apimgt.api.model.API api, int tenantId, String organization)
Add API metadata.org.wso2.carbon.apimgt.api.model.policy.APIPolicy
addAPIPolicy(org.wso2.carbon.apimgt.api.model.policy.APIPolicy policy)
Wrapper method foraddAPIPolicy(APIPolicy, Connection)
to add API Policy without managing the database connection manually.void
addAPIProduct(org.wso2.carbon.apimgt.api.model.APIProduct apiProduct, String organization)
void
addAPIProductResourceMappings(List<org.wso2.carbon.apimgt.api.model.APIProductResource> productResources, String organization, Connection connection)
Add api product url mappings to DB - url templeates to product mappings (resource bundling) - AM_API_PRODUCT_MAPPINGvoid
addAPIProductRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision)
Adds an API Product revision record to the databasevoid
addAPIRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision)
Adds an API revision record to the databasevoid
addAPIRevisionDeployment(String apiRevisionId, List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> apiRevisionDeployments)
Adds an API revision Deployment mapping record to the databaseString
addAPISpecificOperationPolicy(String apiUUID, String revisionUUID, org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData)
Add a new API specific operation policy to the databaseint
addApplication(org.wso2.carbon.apimgt.api.model.Application application, String userId, String organization)
int
addApplication(org.wso2.carbon.apimgt.api.model.Application application, String userId, Connection conn, String organization)
void
addApplicationAttributes(Map<String,String> applicationAttributes, int applicationId, int tenantId)
Add new attributes against an Application in API Storevoid
addApplicationPolicy(org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy policy)
Add a Application level throttling policy to databasevoid
addAuditApiMapping(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String uuid, String organization)
Add new Audit API IDorg.wso2.carbon.apimgt.api.model.BlockConditionsDTO
addBlockConditions(org.wso2.carbon.apimgt.api.model.BlockConditionsDTO blockConditionsDTO)
Add a block conditionvoid
addBotDetectionAlertSubscription(String email)
Add a bot detection alert subscriptionorg.wso2.carbon.apimgt.api.model.APICategory
addCategory(org.wso2.carbon.apimgt.api.model.APICategory category, String organization)
Adds an API categoryString
addComment(String uuid, org.wso2.carbon.apimgt.api.model.Comment comment, String user)
Adds a comment for an APIint
addComment(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String commentText, String user)
Deprecated.This method needs to be removed once the Jaggery web apps are removed.String
addCommonOperationPolicy(org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData)
Add a new common operation policy to the database.void
addComplexityDetails(String apiUuid, org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo graphqlComplexityInfo)
Add custom complexity details for a particular APIvoid
addDeployedAPIRevision(String apiRevisionId, List<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision> deployedAPIRevisionList)
Adds an deployed API revision to the databaseorg.wso2.carbon.apimgt.api.model.Environment
addEnvironment(String tenantDomain, org.wso2.carbon.apimgt.api.model.Environment environment)
Add an Environmentboolean
addExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet)
Store external APIStore details to which APIs successfully publishedvoid
addGlobalPolicy(org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy policy)
Add a Global level throttling policy to databasevoid
addKeyManagerConfiguration(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO keyManagerConfigurationDTO)
void
addMonetizationUsagePublishInfo(org.wso2.carbon.apimgt.api.model.MonetizationUsagePublishInfo monetizationUsagePublishInfo)
Add info about monetization usage publish jobvoid
addOperationPolicyMapping(Set<org.wso2.carbon.apimgt.api.model.URITemplate> uriTemplates)
void
addOrUpdateComplexityDetails(String uuid, org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo graphqlComplexityInfo)
Add or Update complexity detailsvoid
addOrUpdateRating(String uuid, int rating, String userId, Connection conn)
void
addRating(String id, int rating, String user)
void
addRevokedJWTSignature(String eventId, String jwtSignature, String type, Long expiryTime, int tenantId)
Persist revoked jwt signatures to database.String
addSharedScope(org.wso2.carbon.apimgt.api.model.Scope scope, String tenantDomain)
Add shared scope.void
addSubscriber(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId)
int
addSubscription(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, org.wso2.carbon.apimgt.api.model.Application application, String status, String subscriber)
void
addSubscriptionPolicy(org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy policy)
Add a Subscription level throttling policy to databasevoid
addTenantTheme(int tenantId, InputStream themeContent)
Adds a tenant theme to the databasevoid
addUpdateAPIAsDefaultVersion(org.wso2.carbon.apimgt.api.model.API api, Connection connection)
void
addURITemplates(int apiId, org.wso2.carbon.apimgt.api.model.API api, int tenantId)
Add URI Templates to database with resource scope mappings.String
addUserID(String userID, String userName)
void
addWorkflowEntry(WorkflowDTO workflow)
Persists WorkflowDTO to Databaseorg.wso2.carbon.apimgt.api.model.APIRevision
checkAPIUUIDIsARevisionUUID(String apiUUID)
Get a provided api uuid is in the revision db tableboolean
cloneAPISpecificPoliciesForVersioning(String previousAPIVersionUUID, String newAPIVersionUUID, String organization, List<org.wso2.carbon.apimgt.api.dto.ClonePolicyMetadataDTO> clonePolicyMetadata)
A clone of API specific will be taken and cloned when a new version is created.void
convertNullThrottlingTiers()
Converts all null values for THROTTLING_TIER in AM_API_URL_MAPPING table, to Unlimited.void
createApplicationKeyTypeMappingForManualClients(String keyType, int applicationId, String clientId, String keyManagerId, String keyMappingId)
This method will create a new client at key-manager side.further it will add new record to the AM_APPLICATION_KEY_MAPPING tablevoid
createApplicationRegistrationEntry(ApplicationRegistrationWorkflowDTO dto, boolean onlyKeyMappingEntry)
Persist the details of the token generation request (allowed domains & validity period) to be used back when approval has been granted.org.wso2.carbon.apimgt.api.dto.ConditionGroupDTO
createConditionGroupDTO(int conditionGroup)
Converts anPipeline
object into aConditionGroupDTO
.ConditionGroupDTO
class tries to contain the same information held byPipeline
, but in a much lightweight fashion.void
deleteAPI(String uuid)
void
deleteAPIProduct(org.wso2.carbon.apimgt.api.model.APIProductIdentifier productIdentifier)
Delete API product and its related scopesvoid
deleteAPIProductRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision)
Delete API Product revision database recordsvoid
deleteAPIRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision)
Restore API revision database records as the Current API of an APIvoid
deleteApplication(org.wso2.carbon.apimgt.api.model.Application application)
Deletes an Application along with subscriptions, keys and registration datavoid
deleteApplicationAttributes(String attributeKey, int applicationId)
Delete certain attribute stored against an Applicationvoid
deleteApplicationKeyMappingByApplicationIdAndType(int applicationId, String tokenType)
This method will delete a record from AM_APPLICATION_REGISTRATIONvoid
deleteApplicationKeyMappingByConsumerKey(String consumerKey)
void
deleteApplicationKeyMappingByMappingId(String keyMappingId)
void
deleteApplicationMappingByConsumerKey(String consumerKey)
Delete a record from AM_APPLICATION_KEY_MAPPING tablevoid
deleteApplicationRegistration(int applicationId, String tokenType, String keyManagerName)
Delete a record from AM_APPLICATION_REGISTRATION table by application ID and token type.boolean
deleteBlockCondition(int conditionId)
Delete the block condition given the idboolean
deleteBlockConditionByUUID(String uuid)
Delete the block condition given the idvoid
deleteBotDetectionAlertSubscription(String uuid)
Delete a bot detection alert subscriptionvoid
deleteCategory(String categoryID)
void
deleteComment(String uuid, String commentId)
Delete a commentboolean
deleteComment(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String commentId)
Delete a commentvoid
deleteEnvironment(String uuid)
Delete an Environmentboolean
deleteExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet)
Delete the records of external APIStore details.void
deleteKeyManagerConfigurationById(String id, String organization)
void
deleteOperationPolicyByPolicyId(String policyId)
Delete an operation policy by providing the policy UUIDvoid
deleteSharedScope(String scopeName, String tenantDomain)
Delete shared scope.void
deleteTenantTheme(int tenantId)
Deletes a tenant theme from the databasevoid
deleteThrottlingPermissions(String tierName, int tenantId)
void
deleteWorkflowRequest(String workflowExtRef)
Remove the Pending workflow Requests using ExternalWorkflowReferenceboolean
editComment(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String commentId, org.wso2.carbon.apimgt.api.model.Comment comment)
Edit a commentPreparedStatement
fillQueryParams(Connection conn, String query, String[] params, int startingParamIndex)
Returns a Prepared statement after setting all the dynamic parameters.HashMap<Integer,String>
getAllAlertTypesByStakeHolder(String stakeHolder)
This method will fetch all alerts type that is available in AM_ALERT_TYPES.org.wso2.carbon.apimgt.api.dto.UserApplicationAPIUsage[]
getAllAPIProductUsageByProvider(String providerName)
org.wso2.carbon.apimgt.api.dto.UserApplicationAPIUsage[]
getAllAPIUsageByProvider(String providerName)
org.wso2.carbon.apimgt.api.dto.UserApplicationAPIUsage[]
getAllAPIUsageByProviderAndApiId(String uuid, String organization)
List<org.wso2.carbon.apimgt.api.model.API>
getAllAPIVersions(String apiName, String apiProvider)
Return ids of the versions for the given name for the given providerint
getAllApplicationCount(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId, String search)
org.wso2.carbon.apimgt.api.model.Application[]
getAllApplicationsOfTenantForMigration(String appTenantDomain)
List<String>
getAllAvailableContexts()
List<org.wso2.carbon.apimgt.api.model.APICategory>
getAllCategories(String organization)
Get all available API categories of the organizationList<org.wso2.carbon.apimgt.api.model.Environment>
getAllEnvironments(String tenantDomain)
Returns the Environments List for the TenantId.Set<String>
getAllLocalScopeKeysForAPI(String uuid, int tenantId)
Get the local scope keys set of the API.Set<String>
getAllSharedScopeKeys(String tenantDomain)
Get all shared scope keys for tenant.List<org.wso2.carbon.apimgt.api.model.Scope>
getAllSharedScopes(String tenantDomain)
Get all shared scopes for tenant.ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate>
getAllURITemplates(String apiContext, String version)
returns all URL templates define for all active(PUBLISHED) APIs.ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate>
getAllURITemplatesAdvancedThrottle(String apiContext, String version)
ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate>
getAllURITemplatesOldThrottle(String apiContext, String version)
org.wso2.carbon.apimgt.api.model.APICategory
getAPICategoryByID(String apiCategoryID)
String
getAPIContext(String uuid)
Get API Context using a new DB connection.String
getAPIContext(String uuid, Connection connection)
Get API Context by passing an existing DB connection.int
getAPIID(String uuid)
int
getAPIID(String uuid, Connection connection)
org.wso2.carbon.apimgt.api.model.APIIdentifier
getAPIIdentifierFromUUID(String uuid)
Get API Identifier by the the API's UUID.org.wso2.carbon.apimgt.api.model.APIInfo
getAPIInfoByUUID(String apiId)
Retrieve basic information about the given API by the UUID quering only from AM_APIString
getAPILevelTier(int id)
String
getAPILevelTier(String apiUUID, String revisionUUID)
List<String>
getAPINamesMatchingContext(String contextTemplate)
retrieve list of API names which matches given contextorg.wso2.carbon.apimgt.api.model.policy.APIPolicy[]
getAPIPolicies(int tenantID)
Get API level policies.org.wso2.carbon.apimgt.api.model.policy.APIPolicy
getAPIPolicy(String policyName, int tenantId)
RetrievesAPIPolicy
with namepolicyName
and tenant IdtenantNId
org.wso2.carbon.apimgt.api.model.policy.APIPolicy
getAPIPolicyByUUID(String uuid)
RetrievesAPIPolicy
with nameuuid
int
getAPIProductId(org.wso2.carbon.apimgt.api.model.APIProductIdentifier identifier)
org.wso2.carbon.apimgt.api.model.APIProductIdentifier
getAPIProductIdentifierFromUUID(String uuid)
Get API Product Identifier by the product's UUID.List<org.wso2.carbon.apimgt.api.model.APIProductResource>
getAPIProductResourceMappings(org.wso2.carbon.apimgt.api.model.APIProductIdentifier productIdentifier)
get resource mapping of the api product TODO://Get resource scopes from AM_API_RESOURCE_SCOPE table and retrieve scope meta data and bindings from KM.ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate>
getAPIProductURITemplates(String apiContext, String version)
ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate>
getAPIProductURITemplatesAdvancedThrottle(String apiContext, String version)
String
getAPIProviderByNameAndVersion(String apiName, String apiVersion, String tenant)
This method is used to get the API provider by giving API name, API version and tenant domainorg.json.simple.JSONArray
getAPIRatings(String apiId)
List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment>
getAPIRevisionDeploymentByApiUUID(String apiUUID)
Get APIRevisionDeployment details by providing API uuidorg.wso2.carbon.apimgt.api.model.APIRevisionDeployment
getAPIRevisionDeploymentByNameAndRevsionID(String name, String revisionId)
Get APIRevisionDeployment details by providing deployment name and revision uuidList<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment>
getAPIRevisionDeploymentByRevisionUUID(String revisionUUID)
Get APIRevisionDeployment details by providing revision uuidList<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment>
getAPIRevisionDeploymentsByApiUUID(String apiUUID)
Get APIRevisionDeployment details by providing ApiUUIDSet<String>
getAPIScopeKeys(String uuid)
Get Scope keys attached to the given API.org.wso2.carbon.apimgt.api.model.OperationPolicyData
getAPISpecificOperationPolicyByPolicyID(String policyId, String apiUUID, String organization, boolean isWithPolicyDefinition)
Get the API specific operation policy from the policy ID if exists.org.wso2.carbon.apimgt.api.model.OperationPolicyData
getAPISpecificOperationPolicyByPolicyName(String policyName, String policyVersion, String apiUUID, String revisionUUID, String organization, boolean isWithPolicyDefinition)
Retrieve an API Specific operation policy by providing the policy name.String
getAPIStatusFromAPIUUID(String uuid)
long
getAPISubscriptionCountByAPI(org.wso2.carbon.apimgt.api.model.Identifier identifier)
Set<org.wso2.carbon.apimgt.api.model.webhooks.Topic>
getAPITopics(String apiId)
Retrieves the Topic for a specified async API.String
getAPITypeFromUUID(String uuid)
Get API TYPE by the uuid.Set<String>
getAPIVersions(String apiName, String apiProvider, String organization)
Return the existing versions for the given api name for the providerList<String>
getAPIVersionsMatchingApiNameAndOrganization(String apiName, String username, String organization)
Returns whether a given API Name already existsMap<String,String>
getApplicationAttributes(Connection conn, int applicationId)
Get all attributes stored against an Applicationorg.wso2.carbon.apimgt.api.model.Application
getApplicationByClientId(String clientId)
org.wso2.carbon.apimgt.api.model.Application
getApplicationById(int applicationId)
org.wso2.carbon.apimgt.api.model.Application
getApplicationById(int applicationId, String userId, String groupId)
org.wso2.carbon.apimgt.api.model.Application
getApplicationByName(String applicationName, String userId, String groupId)
Fetches an Application by name.org.wso2.carbon.apimgt.api.model.Application
getApplicationBySubscriberIdAndName(int subscriberId, String applicationName)
Retrieves the Application which is corresponding to the given UUID Stringorg.wso2.carbon.apimgt.api.model.Application
getApplicationByUUID(String uuid)
Retrieves the Application which is corresponding to the given UUID Stringint
getApplicationId(String appName, String username)
int
getApplicationIdForAppRegistration(String workflowReference)
String
getApplicationNameFromId(int applicationId)
Find the name of the application by Idorg.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy[]
getApplicationPolicies(int tenantID)
Get application level policesorg.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy
getApplicationPolicy(String policyName, int tenantId)
RetrievesApplicationPolicy
with namepolicyName
and tenant IdtenantNId
org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy
getApplicationPolicyByUUID(String uuid)
RetrievesApplicationPolicy
with nameuuid
org.wso2.carbon.apimgt.api.model.Application[]
getApplicationsByTier(String tier)
Get all applications associated with given tierint
getApplicationsCount(int tenantId, String searchOwner, String searchApplication)
String
getApplicationStatus(String appName, String userId)
get the status of the Application creation processString
getApplicationStatusById(int applicationId)
get the status of the Application creation process given the application Idorg.wso2.carbon.apimgt.api.model.Application[]
getApplicationsWithPagination(String user, String owner, int tenantId, int limit, int offset, String sortBy, String sortOrder, String appName)
Retrieve the applications by user/application nameorg.wso2.carbon.apimgt.api.model.Application[]
getApplicationsWithPagination(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId, int start, int offset, String search, String sortColumn, String sortOrder, String organization)
#TODO later we might need to use only this method.String
getApplicationUUID(String appName, String username)
String
getAuditApiId(String uuid)
Get Audit API IDfloat
getAverageRating(int apiId)
float
getAverageRating(String apiId)
float
getAverageRating(String uuid, Connection conn)
org.wso2.carbon.apimgt.api.model.BlockConditionsDTO
getBlockCondition(int conditionId)
Get details of a block condition by Idorg.wso2.carbon.apimgt.api.model.BlockConditionsDTO
getBlockConditionByUUID(String uuid)
Get details of a block condition by UUIDList<org.wso2.carbon.apimgt.api.model.BlockConditionsDTO>
getBlockConditions(String tenantDomain)
org.wso2.carbon.apimgt.api.model.botDataAPI.BotDetectionData
getBotDetectionAlertSubscription(String field, String value)
Retrieve a bot detection alert subscription by querying a particular field (uuid or email)List<org.wso2.carbon.apimgt.api.model.botDataAPI.BotDetectionData>
getBotDetectionAlertSubscriptions()
Retrieve all bot detection alert subscriptionsorg.wso2.carbon.apimgt.api.model.Comment
getComment(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String commentId, Integer replyLimit, Integer replyOffset)
Returns a specific comment of an APIorg.wso2.carbon.apimgt.api.model.Comment[]
getComments(String uuid, String parentCommentID)
Returns all the Comments on an APIorg.wso2.carbon.apimgt.api.model.CommentList
getComments(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String parentCommentID, Integer limit, Integer offset)
Returns all the Comments on an APIorg.wso2.carbon.apimgt.api.model.OperationPolicyData
getCommonOperationPolicyByPolicyID(String policyId, String organization, boolean isWithPolicyDefinition)
Get the common operation policy from the policy ID if exists.org.wso2.carbon.apimgt.api.model.OperationPolicyData
getCommonOperationPolicyByPolicyName(String policyName, String policyVersion, String organization, boolean isWithPolicyDefinition)
Retrieve a common operation policy by providing the policy name and organizationSet<String>
getCommonOperationPolicyNames(String organization)
org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo
getComplexityDetails(String uuid)
Get custom complexity details for a particular APIMap<String,String>
getConsumerkeyByApplicationIdAndKeyType(int applicationId, String keyType)
String
getConsumerKeyByApplicationIdKeyTypeKeyManager(int applicationId, String keyType, String keyManager)
String[]
getConsumerKeys(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String organization)
Returns all the consumerkeys of application which are subscribed for the given apiMap<String,org.apache.commons.lang3.tuple.Pair<String,String>>
getConsumerKeysForApplication(int appId)
Retrieves the consumer keys and keymanager in a given applicationSet<String>
getConsumerKeysOfApplication(int applicationId)
Gets ConsumerKeys when given the Application ID.org.wso2.carbon.apimgt.api.model.APIKey[]
getConsumerKeysWithMode(int appId, String mode)
String
getDefaultVersion(org.wso2.carbon.apimgt.api.model.APIIdentifier apiId)
List<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision>
getDeployedAPIRevisionByApiUUID(String apiUUID)
Get DeployedAPIRevision details by providing ApiUUIDString
getEarliestRevision(String apiUUID)
Get the earliest revision UUID from the revision list for a given APIorg.wso2.carbon.apimgt.api.model.Environment
getEnvironment(String tenantDomain, String uuid)
Returns the Environment for the uuid in the tenant domain.Set<org.wso2.carbon.apimgt.api.model.APIStore>
getExternalAPIStoresDetails(String uuid)
Return external APIStore details on successfully APIs publishedSet<org.wso2.carbon.apimgt.api.model.APIStore>
getExternalAPIStoresDetails(String uuid, Connection conn)
Get external APIStores details which are stored in databaseString
getExternalWorkflowRefByInternalRefWorkflowType(int internalRef, String workflowType)
Get external workflow reference by internal workflow reference and workflow typeString
getExternalWorkflowReferenceByApplicationID(int appID)
Retries the WorkflowExternalReference for a application.String
getExternalWorkflowReferenceForSubscription(int subscriptionId)
Retries the WorkflowExternalReference for a subscription.String
getExternalWorkflowReferenceForSubscription(org.wso2.carbon.apimgt.api.model.Identifier identifier, int appID, String organization)
Retries the WorkflowExternalReference for a subscription.String
getExternalWorkflowReferenceForSubscriptionAndWFType(int subscriptionId, String wfType)
String
getExternalWorkflowReferenceForUserSignup(String usernameWithDomain)
Retries the WorkflowExternalReference for an user signup by DOMAIN/username.String
getGatewayVendorByAPIUUID(String apiId)
Retrieve the gateway vendor of an API by providing the UUIDorg.wso2.carbon.apimgt.api.model.policy.GlobalPolicy[]
getGlobalPolicies(int tenantID)
Get all Global level policeis belongs to specific tenantorg.wso2.carbon.apimgt.api.model.policy.GlobalPolicy
getGlobalPolicy(String policyName)
Get a particular Global level policy.org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy
getGlobalPolicyByUUID(String uuid)
Get a particular Global level policy given UUID.List<String>
getGlobalPolicyKeyTemplates(int tenantID)
Retrieves global policy key templates for the given tenantIDString
getGroupId(int applicationId)
static ApiMgtDAO
getInstance()
Method to get the instance of the ApiMgtDAO.org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO
getKeyManagerConfigurationByID(String organization, String id)
org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO
getKeyManagerConfigurationByName(String organization, String name)
org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO
getKeyManagerConfigurationByUUID(String uuid)
List<org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO>
getKeyManagerConfigurations()
List<org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO>
getKeyManagerConfigurationsByOrganization(String organization)
org.wso2.carbon.apimgt.api.model.APIKey
getKeyMappingFromApplicationIdAndKeyMappingId(int applicationId, String keyMappingId)
String
getKeyMappingIdFromApplicationIdKeyTypeAndKeyManager(int applicationId, String tokenType, String keyManagerName)
Set<org.wso2.carbon.apimgt.api.model.APIKey>
getKeyMappingsFromApplicationId(int applicationId)
String
getLastPublishedAPIVersionFromAPIStore(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String storeName)
Get external APIStores details which are stored in databaseString
getLatestRevisionUUID(String apiUUID)
Get the latest revision UUID from the revision list for a given APIList<org.wso2.carbon.apimgt.api.model.LifeCycleEvent>
getLifeCycleEvents(String uuid)
org.wso2.carbon.apimgt.api.model.API
getLightWeightAPIInfoByAPIIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String organization)
org.wso2.carbon.apimgt.api.model.ApplicationInfo
getLightweightApplicationByConsumerKey(String consumerKey)
org.wso2.carbon.apimgt.api.model.Application[]
getLightWeightApplications(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId)
Returns all the applications associated with given subscriber and group id, without their keys.List<org.wso2.carbon.apimgt.api.model.OperationPolicyData>
getLightWeightVersionOfAllOperationPolicies(String apiUUID, String organization)
Get the list of all operation policies.org.wso2.carbon.apimgt.api.model.MonetizationUsagePublishInfo
getMonetizationUsagePublishInfo()
Derives info about monetization usage publish jobint
getMostRecentRevisionId(String apiUUID)
Get most recent revision id of the revisions created for a particular API.List<String>
getNamesOfTierWithBandwidthQuotaType(int tenantId)
Get names of the tiers which has bandwidth as the quota typeString
getOrganizationByAPIUUID(String apiId)
Set<org.wso2.carbon.apimgt.api.model.SubscribedAPI>
getPaginatedSubscribedAPIsByApplication(org.wso2.carbon.apimgt.api.model.Application application, Integer offset, Integer limit, String organization)
Set<Integer>
getPendingSubscriptionsByAPIId(String uuid)
Retrieves the IDs of pending subscriptions of a given APIMap<String,Set<Integer>>
getPendingSubscriptionsByAppId(int applicationId)
Set<Integer>
getPendingSubscriptionsByApplicationId(int applicationId)
Retrieves IDs of pending subscriptions for a given applicationString[]
getPolicyNames(String policyLevel, String username)
Retrieves list of available policy names underpolicyLevel
and userusername
's tenantList<org.wso2.carbon.apimgt.api.model.APIProductResource>
getProductMappingsForAPI(org.wso2.carbon.apimgt.api.model.API api)
String
getPublishedDefaultVersion(org.wso2.carbon.apimgt.api.model.APIIdentifier apiId)
Map<String,String>
getRegistrationApprovalState(int appId, String keyType)
String
getRegistrationWFReference(int applicationId, String keyType, String keyManagerName)
Retrieves registration workflow reference for applicationId and key typeList<org.wso2.carbon.apimgt.api.model.ResourcePath>
getResourcePathsOfAPI(org.wso2.carbon.apimgt.api.model.APIIdentifier apiId)
HashMap<Integer,Set<String>>
getResourceToScopeMapping(String uuid)
Get resource (URI Template) to scope mappings of the given API.org.wso2.carbon.apimgt.api.model.APIRevision
getRevisionByRevisionUUID(String revisionUUID)
Get revision details by providing revision UUIDint
getRevisionCountByAPI(String apiUUID)
Get count of the revisions created for a particular API.List<org.wso2.carbon.apimgt.api.model.APIRevision>
getRevisionsListByAPIUUID(String apiUUID)
Get revision details by providing revision UUIDString
getRevisionUUID(String revisionNum, String apiUUID)
Get revision UUID providing revision numberString
getRevisionUUIDByOrganization(String revisionNum, String apiUUID, String organization)
Get revision UUID providing revision number and organizationList<Integer>
getSavedAlertTypesIdsByUserNameAndStakeHolder(String userName, String stakeHolder)
Set<String>
getScopesBySubscribedAPIs(List<String> identifiers)
Set<String>
getScopesForApplicationSubscription(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, int applicationId)
String
getSharedScopeKeyByUUID(String uuid)
Get shared scope key by uuid.org.wso2.carbon.apimgt.api.model.SharedScopeUsage
getSharedScopeUsage(String uuid, int tenantId)
Get the API and URI usages of the given shared scopeSet<org.wso2.carbon.apimgt.api.model.SubscribedAPI>
getSubscribedAPIs(String organization, org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId)
This method returns the set of APIs for given subscriberSet<org.wso2.carbon.apimgt.api.model.SubscribedAPI>
getSubscribedAPIs(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String applicationName, String groupingId)
This method returns the set of APIs for given subscriber, subscribed under the specified application.Set<org.wso2.carbon.apimgt.api.model.SubscribedAPI>
getSubscribedAPIsByApplication(org.wso2.carbon.apimgt.api.model.Application application)
APISubscriptionInfoDTO[]
getSubscribedAPIsForAnApp(String userId, int applicationID)
Get Subscribed APIs for an App.APIKeyInfoDTO[]
getSubscribedUsersForAPI(APIInfoDTO apiInfoDTO)
Get API key information for given APIorg.wso2.carbon.apimgt.api.model.Subscriber
getSubscriber(int subscriberId)
org.wso2.carbon.apimgt.api.model.Subscriber
getSubscriber(String subscriberName)
This method used tot get Subscriber from subscriberId.String
getSubscriberName(String subscriptionId)
Get subscriber name using subscription IDSet<org.wso2.carbon.apimgt.api.model.Subscriber>
getSubscribersOfAPI(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier)
Set<org.wso2.carbon.apimgt.api.model.Subscriber>
getSubscribersOfAPIWithoutDuplicates(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, Map<Integer,Integer> subscriberMap)
Function returns the set of Subscribers by eliminating replicated subscribersSet<org.wso2.carbon.apimgt.api.model.Subscriber>
getSubscribersOfProvider(String providerName)
Deprecated.org.wso2.carbon.apimgt.api.model.BlockConditionsDTO
getSubscriptionBlockCondition(String conditionValue, String tenantDomain)
Get details of the subscription block condition by condition value and tenant domainorg.wso2.carbon.apimgt.api.model.SubscribedAPI
getSubscriptionById(int subscriptionId)
returns the SubscribedAPI object which is related to the subscriptionIdorg.wso2.carbon.apimgt.api.model.SubscribedAPI
getSubscriptionByUUID(String uuid)
returns the SubscribedAPI object which is related to the UUIDInteger
getSubscriptionCount(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String applicationName, String groupingId)
Integer
getSubscriptionCountByApplicationId(org.wso2.carbon.apimgt.api.model.Application application, String organization)
String
getSubscriptionCreaeteStatus(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, int applicationId, String organization, Connection connection)
Retrieve subscription create state for APIIdentifier and applicationIDString
getSubscriptionId(String uuid, int applicationId)
Retrieves subscription Id for APIIdentifier and applicationIdorg.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy[]
getSubscriptionPolicies(int tenantID)
Get all subscription level policeis belongs to specific tenantorg.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy[]
getSubscriptionPolicies(String[] subscriptionTiers, int tenantID)
Get subscription level policies specified by tier names belonging to a specific tenantorg.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy
getSubscriptionPolicy(String policyName, int tenantId)
RetrievesSubscriptionPolicy
with namepolicyName
and tenant IdtenantNId
org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy
getSubscriptionPolicyByUUID(String uuid)
RetrievesSubscriptionPolicy
with nameuuid
List<org.wso2.carbon.apimgt.api.model.SubscribedAPI>
getSubscriptionsOfAPI(String apiName, String apiVersion, String provider)
String
getSubscriptionStatus(String uuid, int applicationId)
Retrives subscription status for APIIdentifier and applicationIdString
getSubscriptionStatusById(int subscriptionId)
InputStream
getTenantTheme(int tenantId)
Retrieves a tenant theme from the databaseTierPermissionDTO
getThrottleTierPermission(String tierName, int tenantId)
Set<TierPermissionDTO>
getThrottleTierPermissions(int tenantId)
TierPermissionDTO
getTierPermission(String tierName, int tenantId)
Set<TierPermissionDTO>
getTierPermissions(int tenantId)
Set<org.wso2.carbon.apimgt.api.model.webhooks.Subscription>
getTopicSubscriptions(String applicationId)
Retrieves set of web hook topic subscriptions for a application.Set<org.wso2.carbon.apimgt.api.model.webhooks.Subscription>
getTopicSubscriptionsByApiUUID(String applicationId, String apiId)
Retrieves the web hook topc subscriptions from an application to a given api.Set<String>
getUnversionedLocalScopeKeysForAPI(String uuid, int tenantId)
Get the unversioned local scope keys set of the API.Map<String,org.wso2.carbon.apimgt.api.model.URITemplate>
getURITemplatesForAPI(org.wso2.carbon.apimgt.api.model.API api)
Retrieve URI Templates for the given APISet<org.wso2.carbon.apimgt.api.model.URITemplate>
getURITemplatesOfAPI(String uuid)
Map<Integer,org.wso2.carbon.apimgt.api.model.URITemplate>
getURITemplatesOfAPIWithProductMapping(String uuid)
HashMap<String,String>
getURITemplatesPerAPIAsString(String uuid)
Set<org.wso2.carbon.apimgt.api.model.URITemplate>
getURITemplatesWithOperationPolicies(String apiUUID)
Get the set of URI templates that have Operation policiesString
getUserID(String userName)
int
getUserRating(String uuid, String user)
int
getUserRating(String uuid, String userId, Connection conn)
org.json.simple.JSONObject
getUserRatingInfo(String uuid, String user)
String
getUUIDFromIdentifier(String provider, String apiName, String version)
Get API UUID by passed parameters.String
getUUIDFromIdentifier(String provider, String apiName, String version, String organization)
Get API UUID by passed parameters.String
getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier)
Get API UUID by the API Identifier.String
getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String organization)
Get API UUID by the API Identifier.String
getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIProductIdentifier identifier)
Get API Product UUID by the API Product Identifier.String
getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIProductIdentifier identifier, String organization)
Get API Product UUID by the API Product Identifier and organization.String
getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.Identifier apiIdentifier, String organization)
Set<String>
getVersionedLocalScopeKeysForAPI(String uuid, int tenantId)
Get the versioned local scope keys set of the API.String
getWorkflowReference(String applicationName, String userId)
Fetches WorkflowReference when given Application Name and UserId.String
getWorkflowReferenceByApplicationId(int applicationId, String userId)
Fetches WorkflowReference when given Application Name and UserId.org.wso2.carbon.apimgt.api.model.Workflow
getworkflowReferenceByExternalWorkflowReference(String externalWorkflowRef)
Get the Pending workflow Request using ExternalWorkflowReferenceorg.wso2.carbon.apimgt.api.model.Workflow
getworkflowReferenceByExternalWorkflowReferenceID(String externelWorkflowRef, String status, String tenantDomain)
Get the Pending workflow Request using ExternalWorkflowReference for a particular tenantorg.wso2.carbon.apimgt.api.model.Workflow[]
getworkflows(String workflowType, String status, String tenantDomain)
Get the Pending workflow Requests using WorkflowType for a particular tenantboolean
hasAPIPolicyAttached(String policyName, String organization)
boolean
hasApplicationPolicyAttachedToApplication(String policyName, String organization)
boolean
hasSubscriptionPolicyAttached(String policyName, String organization)
boolean
isAPICategoryNameExists(String categoryName, String uuid, String organization)
Checks whether the given category name is already available under given tenant domain with any UUID other than the given UUIDboolean
isApiNameExist(String apiName, String tenantDomain, String organization)
Check the given api name is already available in the api table under given tenant domainboolean
isApiNameWithDifferentCaseExist(String apiName, String tenantDomain, String organization)
Check whether another API with a different letter case of the given api name is already available in the api table under the given tenant domainboolean
isAppAllowed(int applicationID, String userId, String groupId)
Checks whether application is accessible to the specified userboolean
isApplicationExist(String appName, String username, String groupId, String organization)
Check whether given application name is available under current subscriber or groupboolean
isApplicationGroupCombinationExists(String applicationName, String username, String groupId)
boolean
isApplicationOwnedBySubscriber(String appName, String username, String organization)
Check whether the new user has an applicationboolean
isContextExist(String context, String organization)
boolean
isDuplicateContextTemplateMatchesOrganization(String contextTemplate, String organization)
Returns whether a given API Context already existsboolean
isGrpIdMappingTableExist()
Returns True if AM_APPLICATION_GROUP_MAPPING table exist in AM DBboolean
isIDPExistInOrg(String organization, String resourceId)
boolean
isKeyManagerConfigurationExistById(String organization, String id)
boolean
isKeyManagerConfigurationExistByName(String name, String organization)
boolean
isKeyMappingExistsForApplication(int applicationId, String keyManagerName, String keyManagerId, String keyType)
Check if key mappings already exists for app ID, key manager name or ID and key type.boolean
isKeyMappingExistsForConsumerKeyOrApplication(int applicationId, String keyManagerName, String keyManagerId, String keyType, String consumerKey)
Check if key mapping exists for (app ID, key type and key manager) or (consumer key and key manager) values.boolean
isKeyTemplatesExist(org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy policy)
Returns true if the key template exist in DBboolean
isPolicyDeployed(String policyType, int tenantId, String policyName)
boolean
isPolicyExist(String policyType, int tenantId, String policyName)
boolean
isPolicyExist(Connection connection, String policyType, int tenantId, String policyName)
boolean
isScopeKeyAssigned(String scopeKey, int tenantId)
Check the given scopeKey assigned to any API resource in the given tenant.boolean
isScopeKeyAssignedLocally(String apiName, String scopeKey, int tenantId, String organization)
Check whether the given scope key is already assigned locally to another API which are different from the given API or its versioned APIs under given tenant.boolean
isSharedScopeExists(String scopeName, int tenantId)
Checks whether the given shared scope name is already available under given tenant domain.boolean
isSubscribed(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String userId)
boolean
isSubscribedToApp(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String userId, int applicationId)
boolean
isTenantThemeExist(int tenantId)
Checks whether a tenant theme exist for a particular tenantList<org.wso2.carbon.apimgt.api.model.SubscribedAPI>
makeKeysForwardCompatible(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, List<org.wso2.carbon.apimgt.api.model.API> oldAPIVersions)
void
populateAppRegistrationWorkflowDTO(ApplicationRegistrationWorkflowDTO workflowDTO)
void
populatePolicyDefinitions(Connection connection, String policyId, org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData)
void
recordAPILifeCycleEvent(int apiId, String oldStatus, String newStatus, String userId, int tenantId)
void
recordAPILifeCycleEvent(String uuid, String oldStatus, String newStatus, String userId, int tenantId)
void
removeAllSubscriptions(String uuid)
void
removeAPIRating(String uuid, String user)
void
removeAPIRating(String uuid, String userId, Connection conn)
void
removeAPIRevisionDeployment(String apiRevisionId, List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> apiRevisionDeployments)
Remove an API revision Deployment mapping record to the databasevoid
removeAPIRevisionDeployment(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> deployments)
Remove an API revision Deployment mapping record to the databasevoid
removeDeployedAPIRevision(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision> deployments)
Remove an deployed API revision in the databasevoid
removeExpiredJWTs()
Removes expired JWTs from revoke table.void
removeSubscription(org.wso2.carbon.apimgt.api.model.Identifier identifier, int applicationId)
Removes the subscription entry from AM_SUBSCRIPTIONS for identifier.void
removeSubscription(org.wso2.carbon.apimgt.api.model.SubscribedAPI subscription, Connection conn)
Removes a subscription specified by SubscribedAPI objectvoid
removeSubscriptionById(int subscription_id)
Removes a subscription by id by force without considering the subscription blocking state of the uservoid
removeThrottlePolicy(String policyLevel, String policyName, int tenantId)
Removes a throttling policy from the databasevoid
removeWorkflowEntry(String workflowReference, String workflowType)
Remove workflow entryvoid
restoreAPIProductRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision)
Restore API Product revision database records as the Current API Product of an API Productvoid
restoreAPIRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision)
Restore API revision database records as the Current API of an APIList<String>
retrieveSavedEmailList(String userName, String stakeHolder)
This method will retrieve saved emails list by user name and stakeholder.String
retrieveServiceKeyByApiId(int apiId, int tenantId)
Retrieve the Unique Identifier of the Service used in APIWorkflowDTO
retrieveWorkflow(String workflowReference)
Returns a workflow object for a given external workflow reference.WorkflowDTO
retrieveWorkflowFromInternalReference(String workflowReference, String workflowType)
Returns a workflow object for a given internal workflow reference and the workflow type.void
setAPIProductFromDB(org.wso2.carbon.apimgt.api.model.APIProduct product)
Get product Id from the product name and the provider.void
setDefaultVersion(org.wso2.carbon.apimgt.api.model.API api)
void
setPolicyDeploymentStatus(String policyLevel, String policyName, int tenantId, boolean isDeployed)
Sets deployment status vaule of a policy in database.void
setServiceStatusInfoToAPI(org.wso2.carbon.apimgt.api.model.API api, int apiId)
Retrieve Service Info and Set it to APIvoid
setUnDeployedAPIRevision(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision> deployments)
Set the deployed time of the un-deployed revision entry as NULLvoid
unSubscribeAlerts(String userName, String agent)
This method will delete all email alert subscriptions details from tablesvoid
updateAPI(org.wso2.carbon.apimgt.api.model.API api)
void
updateAPI(org.wso2.carbon.apimgt.api.model.API api, String username)
org.wso2.carbon.apimgt.api.model.policy.APIPolicy
updateAPIPolicy(org.wso2.carbon.apimgt.api.model.policy.APIPolicy policy)
Update a API level throttling policy to database.void
updateAPIProduct(org.wso2.carbon.apimgt.api.model.APIProduct product, String username)
void
updateAPIProductResourceMappings(org.wso2.carbon.apimgt.api.model.APIProduct apiProduct, int productId, Connection connection)
Update Product scope and resource mappingsvoid
updateAPIRevisionDeployment(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> deployments)
Update API revision Deployment mapping recordvoid
updateApplication(org.wso2.carbon.apimgt.api.model.Application application)
void
updateApplicationKeyTypeMapping(org.wso2.carbon.apimgt.api.model.Application application, String keyType, String keyManagerId)
Update the consumer key and application status for the given key type and application.void
updateApplicationKeyTypeMetaData(int applicationId, String keyType, String keyManagerName, org.wso2.carbon.apimgt.api.model.OAuthApplicationInfo updatedAppInfo)
This method used to update Application metadata according to oauth app infoboolean
updateApplicationOwner(String userName, org.wso2.carbon.apimgt.api.model.Application application)
Returns all applications created by given user Idvoid
updateApplicationPolicy(org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy policy)
Updates Application level policy.void
updateApplicationRegistration(String state, String keyType, int appId, String keyManager)
Updates the state of the Application Registration.void
updateApplicationStatus(int applicationId, String status)
Update the status of the Application creation processboolean
updateBlockConditionState(int conditionId, String state)
Update the block condition state true (Enabled) /false (Disabled) given the UUIDboolean
updateBlockConditionStateByUUID(String uuid, String state)
Update the block condition state true (Enabled) /false (Disabled) given the UUIDvoid
updateCategory(org.wso2.carbon.apimgt.api.model.APICategory apiCategory)
Update API Categoryvoid
updateComplexityDetails(String uuid, org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo graphqlComplexityInfo)
Update custom complexity details for a particular APIvoid
updateDefaultAPIPublishedVersion(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier)
org.wso2.carbon.apimgt.api.model.Environment
updateEnvironment(org.wso2.carbon.apimgt.api.model.Environment environment)
Update Gateway Environmentvoid
updateExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet)
void
updateExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet, Connection conn)
Updateexternal APIStores details to which APIs publishedvoid
updateGlobalPolicy(org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy policy)
Updates global throttle policy in databasevoid
updateKeyManagerConfiguration(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO keyManagerConfigurationDTO)
void
updateOperationPolicy(String policyId, org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData)
Update an existing operation policyvoid
updateSubscriber(org.wso2.carbon.apimgt.api.model.Subscriber subscriber)
void
updateSubscription(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String subStatus, int applicationId, String organization)
This method is used to update the subscriptionint
updateSubscription(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String inputSubscriptionUUId, String status, String requestedThrottlingTier)
void
updateSubscription(org.wso2.carbon.apimgt.api.model.SubscribedAPI subscribedAPI)
This method is used to update the subscriptionvoid
updateSubscriptionPolicy(org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy policy)
Updates Subscription level policy.void
updateSubscriptionStatus(int subscriptionId, String status)
void
updateSubscriptionStatusAndTier(int subscriptionId, String status)
void
updateTenantTheme(int tenantId, InputStream themeContent)
Updates an existing tenant theme in the databasevoid
updateThrottleTierPermissions(String tierName, String permissionType, String roles, int tenantId)
void
updateTierPermissions(String tierName, String permissionType, String roles, int tenantId)
void
updateURITemplates(org.wso2.carbon.apimgt.api.model.API api, int tenantId)
Update URI templates define for an API.void
updateUsagePublishInfo(org.wso2.carbon.apimgt.api.model.MonetizationUsagePublishInfo monetizationUsagePublishInfo)
Updates info about monetization usage publish jobvoid
updateWorkflowStatus(WorkflowDTO workflowDTO)
-
-
-
Method Detail
-
getInstance
public static ApiMgtDAO getInstance()
Method to get the instance of the ApiMgtDAO.- Returns:
ApiMgtDAO
instance
-
createApplicationRegistrationEntry
public void createApplicationRegistrationEntry(ApplicationRegistrationWorkflowDTO dto, boolean onlyKeyMappingEntry) throws org.wso2.carbon.apimgt.api.APIManagementException
Persist the details of the token generation request (allowed domains & validity period) to be used back when approval has been granted.- Parameters:
dto
- DTO related to Application Registration.onlyKeyMappingEntry
- When this flag is enabled, only AM_APPLICATION_KEY_MAPPING will get affected.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to create entries in AM_APPLICATION_REGISTRATION and AM_APPLICATION_KEY_MAPPING tables.
-
getSubscribedUsersForAPI
public APIKeyInfoDTO[] getSubscribedUsersForAPI(APIInfoDTO apiInfoDTO) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API key information for given API- Parameters:
apiInfoDTO
- API info- Returns:
- APIKeyInfoDTO[]
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get key info for given API
-
addSubscriber
public void addSubscriber(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriberName
public String getSubscriberName(String subscriptionId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get subscriber name using subscription ID- Parameters:
subscriptionId
-- Returns:
- subscriber name
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getMonetizationUsagePublishInfo
public org.wso2.carbon.apimgt.api.model.MonetizationUsagePublishInfo getMonetizationUsagePublishInfo() throws org.wso2.carbon.apimgt.api.APIManagementException
Derives info about monetization usage publish job- Returns:
- ifno about the monetization usage publish job
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addMonetizationUsagePublishInfo
public void addMonetizationUsagePublishInfo(org.wso2.carbon.apimgt.api.model.MonetizationUsagePublishInfo monetizationUsagePublishInfo) throws org.wso2.carbon.apimgt.api.APIManagementException
Add info about monetization usage publish job- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateUsagePublishInfo
public void updateUsagePublishInfo(org.wso2.carbon.apimgt.api.model.MonetizationUsagePublishInfo monetizationUsagePublishInfo) throws org.wso2.carbon.apimgt.api.APIManagementException
Updates info about monetization usage publish job- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateSubscriber
public void updateSubscriber(org.wso2.carbon.apimgt.api.model.Subscriber subscriber) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriber
public org.wso2.carbon.apimgt.api.model.Subscriber getSubscriber(int subscriberId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addSubscription
public int addSubscription(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, org.wso2.carbon.apimgt.api.model.Application application, String status, String subscriber) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateSubscription
public int updateSubscription(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String inputSubscriptionUUId, String status, String requestedThrottlingTier) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
removeSubscription
public void removeSubscription(org.wso2.carbon.apimgt.api.model.Identifier identifier, int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Removes the subscription entry from AM_SUBSCRIPTIONS for identifier.- Parameters:
identifier
- IdentifierapplicationId
- ID of the application which has the subscription- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
removeSubscription
public void removeSubscription(org.wso2.carbon.apimgt.api.model.SubscribedAPI subscription, Connection conn) throws org.wso2.carbon.apimgt.api.APIManagementException
Removes a subscription specified by SubscribedAPI object- Parameters:
subscription
- SubscribedAPI objectconn
- database connection object- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
removeSubscriptionById
public void removeSubscriptionById(int subscription_id) throws org.wso2.carbon.apimgt.api.APIManagementException
Removes a subscription by id by force without considering the subscription blocking state of the user- Parameters:
subscription_id
- id of subscription- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
removeAllSubscriptions
public void removeAllSubscriptions(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionStatusById
public String getSubscriptionStatusById(int subscriptionId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionById
public org.wso2.carbon.apimgt.api.model.SubscribedAPI getSubscriptionById(int subscriptionId) throws org.wso2.carbon.apimgt.api.APIManagementException
returns the SubscribedAPI object which is related to the subscriptionId- Parameters:
subscriptionId
- subscription id- Returns:
SubscribedAPI
Object which contains the subscribed API information.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionByUUID
public org.wso2.carbon.apimgt.api.model.SubscribedAPI getSubscriptionByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
returns the SubscribedAPI object which is related to the UUID- Parameters:
uuid
- UUID of Application- Returns:
SubscribedAPI
Object which contains the subscribed API information.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriber
public org.wso2.carbon.apimgt.api.model.Subscriber getSubscriber(String subscriberName) throws org.wso2.carbon.apimgt.api.APIManagementException
This method used tot get Subscriber from subscriberId.- Parameters:
subscriberName
- id- Returns:
- Subscriber
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get Subscriber from subscriber id
-
getAPITopics
public Set<org.wso2.carbon.apimgt.api.model.webhooks.Topic> getAPITopics(String apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves the Topic for a specified async API.- Parameters:
apiId
- API UUID- Returns:
- Set of Topic objects
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to retrieve topics of the web hook API
-
getTopicSubscriptions
public Set<org.wso2.carbon.apimgt.api.model.webhooks.Subscription> getTopicSubscriptions(String applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves set of web hook topic subscriptions for a application.- Parameters:
applicationId
- application UUID- Returns:
- set of web hook subscriptions.
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to retrieve web hook topc subscriptions
-
getTopicSubscriptionsByApiUUID
public Set<org.wso2.carbon.apimgt.api.model.webhooks.Subscription> getTopicSubscriptionsByApiUUID(String applicationId, String apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves the web hook topc subscriptions from an application to a given api.- Parameters:
applicationId
- application uuidapiId
- api uuid- Returns:
- set of web hook topic subscriptions
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscribedAPIs
public Set<org.wso2.carbon.apimgt.api.model.SubscribedAPI> getSubscribedAPIs(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String applicationName, String groupingId) throws org.wso2.carbon.apimgt.api.APIManagementException
This method returns the set of APIs for given subscriber, subscribed under the specified application.- Parameters:
subscriber
- subscriberapplicationName
- Application Name- Returns:
- Set
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get SubscribedAPIs
-
getScopesForApplicationSubscription
public Set<String> getScopesForApplicationSubscription(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionCount
public Integer getSubscriptionCount(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String applicationName, String groupingId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionCountByApplicationId
public Integer getSubscriptionCountByApplicationId(org.wso2.carbon.apimgt.api.model.Application application, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscribedAPIs
public Set<org.wso2.carbon.apimgt.api.model.SubscribedAPI> getSubscribedAPIs(String organization, org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId) throws org.wso2.carbon.apimgt.api.APIManagementException
This method returns the set of APIs for given subscriber- Parameters:
organization
- identifier of the organizationsubscriber
- subscriber- Returns:
- Set
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get SubscribedAPIs
-
getConsumerKeysOfApplication
public Set<String> getConsumerKeysOfApplication(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Gets ConsumerKeys when given the Application ID.- Parameters:
applicationId
-- Returns:
Set
containing ConsumerKeys- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateTierPermissions
public void updateTierPermissions(String tierName, String permissionType, String roles, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getTierPermissions
public Set<TierPermissionDTO> getTierPermissions(int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getTierPermission
public TierPermissionDTO getTierPermission(String tierName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getThrottleTierPermission
public TierPermissionDTO getThrottleTierPermission(String tierName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateThrottleTierPermissions
public void updateThrottleTierPermissions(String tierName, String permissionType, String roles, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteThrottlingPermissions
public void deleteThrottlingPermissions(String tierName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getThrottleTierPermissions
public Set<TierPermissionDTO> getThrottleTierPermissions(int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscribersOfProvider
@Deprecated public Set<org.wso2.carbon.apimgt.api.model.Subscriber> getSubscribersOfProvider(String providerName) throws org.wso2.carbon.apimgt.api.APIManagementException
Deprecated.This method returns the set of Subscribers for given provider- Parameters:
providerName
- name of the provider- Returns:
- Set
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get subscribers for given provider
-
getSubscribersOfAPI
public Set<org.wso2.carbon.apimgt.api.model.Subscriber> getSubscribersOfAPI(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscribersOfAPIWithoutDuplicates
public Set<org.wso2.carbon.apimgt.api.model.Subscriber> getSubscribersOfAPIWithoutDuplicates(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, Map<Integer,Integer> subscriberMap) throws org.wso2.carbon.apimgt.api.APIManagementException
Function returns the set of Subscribers by eliminating replicated subscribers- Parameters:
identifier
- API IdentifiersubscriberMap
- Map of subscriber id and an integer value- Returns:
- Set of subscribers
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get subscribers for given provider
-
getAPISubscriptionCountByAPI
public long getAPISubscriptionCountByAPI(org.wso2.carbon.apimgt.api.model.Identifier identifier) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateSubscription
public void updateSubscription(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String subStatus, int applicationId, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
This method is used to update the subscription- Parameters:
identifier
- APIIdentifiersubStatus
- Subscription Status[BLOCKED/UNBLOCKED]applicationId
- Application idorganization
- Organization- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to update subscriber
-
updateSubscription
public void updateSubscription(org.wso2.carbon.apimgt.api.model.SubscribedAPI subscribedAPI) throws org.wso2.carbon.apimgt.api.APIManagementException
This method is used to update the subscription- Parameters:
subscribedAPI
- subscribedAPI object that represents the new subscription detals- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to update subscription
-
updateSubscriptionStatus
public void updateSubscriptionStatus(int subscriptionId, String status) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateSubscriptionStatusAndTier
public void updateSubscriptionStatusAndTier(int subscriptionId, String status) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getRegistrationApprovalState
public Map<String,String> getRegistrationApprovalState(int appId, String keyType) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateApplicationKeyTypeMapping
public void updateApplicationKeyTypeMapping(org.wso2.carbon.apimgt.api.model.Application application, String keyType, String keyManagerId) throws org.wso2.carbon.apimgt.api.APIManagementException
Update the consumer key and application status for the given key type and application.- Parameters:
application
-keyType
-keyManagerId
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
createApplicationKeyTypeMappingForManualClients
public void createApplicationKeyTypeMappingForManualClients(String keyType, int applicationId, String clientId, String keyManagerId, String keyMappingId) throws org.wso2.carbon.apimgt.api.APIManagementException
This method will create a new client at key-manager side.further it will add new record to the AM_APPLICATION_KEY_MAPPING table- Parameters:
keyType
- key type.applicationId
- apim application id.clientId
- consumer key.keyMappingId
- key mapping id.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while creation key mappings.
-
updateApplicationRegistration
public void updateApplicationRegistration(String state, String keyType, int appId, String keyManager) throws org.wso2.carbon.apimgt.api.APIManagementException
Updates the state of the Application Registration.- Parameters:
state
- State of the registration.keyType
- PRODUCTION | SANDBOXappId
- ID of the Application.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if updating fails.
-
isSubscribed
public boolean isSubscribed(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String userId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
apiIdentifier
- APIIdentifieruserId
- User Id- Returns:
- true if user subscribed for given APIIdentifier
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to check subscribed or not
-
isSubscribedToApp
public boolean isSubscribedToApp(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String userId, int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
apiIdentifier
-userId
-applicationId
-- Returns:
- true if user app subscribed for given APIIdentifier
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to check subscribed or not
-
getAllAPIUsageByProvider
public org.wso2.carbon.apimgt.api.dto.UserApplicationAPIUsage[] getAllAPIUsageByProvider(String providerName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
providerName
- Name of the provider- Returns:
- UserApplicationAPIUsage of given provider
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get UserApplicationAPIUsage for given provider
-
getAllAPIUsageByProviderAndApiId
public org.wso2.carbon.apimgt.api.dto.UserApplicationAPIUsage[] getAllAPIUsageByProviderAndApiId(String uuid, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
uuid
- API uuidorganization
- Organization of the API- Returns:
- UserApplicationAPIUsage of given provider
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get UserApplicationAPIUsage for given provider
-
getAllAPIProductUsageByProvider
public org.wso2.carbon.apimgt.api.dto.UserApplicationAPIUsage[] getAllAPIProductUsageByProvider(String providerName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
providerName
- Name of the provider- Returns:
- UserApplicationAPIUsage of given provider
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get UserApplicationAPIUsage for given provider
-
getSubscriptionsOfAPI
public List<org.wso2.carbon.apimgt.api.model.SubscribedAPI> getSubscriptionsOfAPI(String apiName, String apiVersion, String provider) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
apiName
- Name of the APIapiVersion
- Version of the APIprovider
- Name of API creator- Returns:
- All subscriptions of a given API
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addApplication
public int addApplication(org.wso2.carbon.apimgt.api.model.Application application, String userId, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addRating
public void addRating(String id, int rating, String user) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addOrUpdateRating
public void addOrUpdateRating(String uuid, int rating, String userId, Connection conn) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
- Parameters:
uuid
- API uuidrating
- RatinguserId
- User Id- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to add RatingSQLException
-
removeAPIRating
public void removeAPIRating(String uuid, String user) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
removeAPIRating
public void removeAPIRating(String uuid, String userId, Connection conn) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
- Parameters:
uuid
- API uuiduserId
- User Id- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to remove API user RatingSQLException
-
getUserRating
public int getUserRating(String uuid, String user) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getUserRating
public int getUserRating(String uuid, String userId, Connection conn) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
- Parameters:
uuid
- API uuiduserId
- User Id- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get User API RatingSQLException
-
getUserRatingInfo
public org.json.simple.JSONObject getUserRatingInfo(String uuid, String user) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
uuid
- API uuiduser
- User name- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get user API Ratings
-
getAPIRatings
public org.json.simple.JSONArray getAPIRatings(String apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
apiId
- API uuid- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get API Ratings
-
getAverageRating
public float getAverageRating(String apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAverageRating
public float getAverageRating(int apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAverageRating
public float getAverageRating(String uuid, Connection conn) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
- Parameters:
uuid
- API uuid- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to add ApplicationSQLException
-
getSubscriptionBlockCondition
public org.wso2.carbon.apimgt.api.model.BlockConditionsDTO getSubscriptionBlockCondition(String conditionValue, String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Get details of the subscription block condition by condition value and tenant domain- Parameters:
conditionValue
- condition value of the block conditiontenantDomain
- tenant domain of the block condition- Returns:
- Block condition
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addApplication
public int addApplication(org.wso2.carbon.apimgt.api.model.Application application, String userId, Connection conn, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
- Parameters:
application
- ApplicationuserId
- User Idorganization
- Identifier of an organization- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to add ApplicationSQLException
-
updateApplication
public void updateApplication(org.wso2.carbon.apimgt.api.model.Application application) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateApplicationStatus
public void updateApplicationStatus(int applicationId, String status) throws org.wso2.carbon.apimgt.api.APIManagementException
Update the status of the Application creation process- Parameters:
applicationId
-status
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationStatus
public String getApplicationStatus(String appName, String userId) throws org.wso2.carbon.apimgt.api.APIManagementException
get the status of the Application creation process- Parameters:
appName
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationStatusById
public String getApplicationStatusById(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
get the status of the Application creation process given the application Id- Parameters:
applicationId
- Id of the Application- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isApplicationExist
public boolean isApplicationExist(String appName, String username, String groupId, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Check whether given application name is available under current subscriber or group- Parameters:
appName
- application nameusername
- subscribergroupId
- group of the subscriberorganization
- identifier of the organization- Returns:
- true if application is available for the subscriber
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get applications for given subscriber
-
isApplicationGroupCombinationExists
public boolean isApplicationGroupCombinationExists(String applicationName, String username, String groupId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
applicationName
- application nameusername
- usernamegroupId
- group id- Returns:
- whether a certain application group combination exists or not
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to assess whether a certain application group combination exists or not
-
isApplicationOwnedBySubscriber
public boolean isApplicationOwnedBySubscriber(String appName, String username, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Check whether the new user has an application- Parameters:
appName
- application nameusername
- subscriber- Returns:
- true if application is available for the subscriber
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get applications for given subscriber
-
getApplicationId
public int getApplicationId(String appName, String username) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
username
- Subscriber- Returns:
- ApplicationId for given appname.
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get Applications for given subscriber.
-
getApplicationUUID
public String getApplicationUUID(String appName, String username) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationNameFromId
public String getApplicationNameFromId(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Find the name of the application by Id- Parameters:
applicationId
- - applicatoin id- Returns:
- - application name
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAllApplicationCount
public int getAllApplicationCount(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId, String search) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateApplicationOwner
public boolean updateApplicationOwner(String userName, org.wso2.carbon.apimgt.api.model.Application application) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns all applications created by given user Id- Parameters:
userName
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationsWithPagination
public org.wso2.carbon.apimgt.api.model.Application[] getApplicationsWithPagination(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId, int start, int offset, String search, String sortColumn, String sortOrder, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
#TODO later we might need to use only this method.- Parameters:
subscriber
- The subscriber.groupingId
- The groupId to which the applications must belong.start
- The start index.offset
- The offset.search
- The search string.sortOrder
- The sort order.sortColumn
- The sort column.organization
- Identifier of an organization- Returns:
- Application[] The array of applications.
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getLightWeightApplications
public org.wso2.carbon.apimgt.api.model.Application[] getLightWeightApplications(org.wso2.carbon.apimgt.api.model.Subscriber subscriber, String groupingId) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns all the applications associated with given subscriber and group id, without their keys.- Parameters:
subscriber
- The subscriber.groupingId
- The groupId to which the applications must belong.- Returns:
- Application[] Array of applications.
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationsWithPagination
public org.wso2.carbon.apimgt.api.model.Application[] getApplicationsWithPagination(String user, String owner, int tenantId, int limit, int offset, String sortBy, String sortOrder, String appName) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve the applications by user/application name- Parameters:
user
-owner
-tenantId
-limit
-offset
-sortBy
-sortOrder
-appName
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationsCount
public int getApplicationsCount(int tenantId, String searchOwner, String searchApplication) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAllApplicationsOfTenantForMigration
public org.wso2.carbon.apimgt.api.model.Application[] getAllApplicationsOfTenantForMigration(String appTenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getConsumerKeys
public String[] getConsumerKeys(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns all the consumerkeys of application which are subscribed for the given api- Parameters:
identifier
- APIIdentifierorganization
- Organization- Returns:
- Consumerkeys
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get Applications for given subscriber.
-
deleteApplication
public void deleteApplication(org.wso2.carbon.apimgt.api.model.Application application) throws org.wso2.carbon.apimgt.api.APIManagementException
Deletes an Application along with subscriptions, keys and registration data- Parameters:
application
- Application object to be deleted from the database which has the application Id- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getConsumerKeysForApplication
public Map<String,org.apache.commons.lang3.tuple.Pair<String,String>> getConsumerKeysForApplication(int appId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves the consumer keys and keymanager in a given application- Parameters:
appId
- application id- Returns:
- Map
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getConsumerKeysWithMode
public org.wso2.carbon.apimgt.api.model.APIKey[] getConsumerKeysWithMode(int appId, String mode) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getConsumerKeyByApplicationIdKeyTypeKeyManager
public String getConsumerKeyByApplicationIdKeyTypeKeyManager(int applicationId, String keyType, String keyManager) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteApplicationKeyMappingByConsumerKey
public void deleteApplicationKeyMappingByConsumerKey(String consumerKey) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteApplicationKeyMappingByApplicationIdAndType
public void deleteApplicationKeyMappingByApplicationIdAndType(int applicationId, String tokenType) throws org.wso2.carbon.apimgt.api.APIManagementException
This method will delete a record from AM_APPLICATION_REGISTRATION- Parameters:
applicationId
-tokenType
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteApplicationRegistration
public void deleteApplicationRegistration(int applicationId, String tokenType, String keyManagerName) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete a record from AM_APPLICATION_REGISTRATION table by application ID and token type.- Parameters:
applicationId
- APIM application ID.tokenType
- Token type (PRODUCTION || SANDBOX)keyManagerName
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to delete the record.
-
recordAPILifeCycleEvent
public void recordAPILifeCycleEvent(String uuid, String oldStatus, String newStatus, String userId, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
recordAPILifeCycleEvent
public void recordAPILifeCycleEvent(int apiId, String oldStatus, String newStatus, String userId, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateDefaultAPIPublishedVersion
public void updateDefaultAPIPublishedVersion(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getLifeCycleEvents
public List<org.wso2.carbon.apimgt.api.model.LifeCycleEvent> getLifeCycleEvents(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
makeKeysForwardCompatible
public List<org.wso2.carbon.apimgt.api.model.SubscribedAPI> makeKeysForwardCompatible(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, List<org.wso2.carbon.apimgt.api.model.API> oldAPIVersions) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIVersionsMatchingApiNameAndOrganization
public List<String> getAPIVersionsMatchingApiNameAndOrganization(String apiName, String username, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns whether a given API Name already exists- Parameters:
apiName
- Name of the APIusername
- Usernameorganization
- Identifier of an Organization- Returns:
- true/false
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get API Names
-
isDuplicateContextTemplateMatchesOrganization
public boolean isDuplicateContextTemplateMatchesOrganization(String contextTemplate, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns whether a given API Context already exists- Parameters:
contextTemplate
- Requested context templateorganization
- Identifier of an Organization- Returns:
- true/false
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get API Contexts
-
addAPI
public int addAPI(org.wso2.carbon.apimgt.api.model.API api, int tenantId, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Add API metadata.- Parameters:
api
- API to addtenantId
- tenant idorganization
- identifier of the organization- Returns:
- API Id of the successfully added API
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if fails to add API
-
getDefaultVersion
public String getDefaultVersion(org.wso2.carbon.apimgt.api.model.APIIdentifier apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addWorkflowEntry
public void addWorkflowEntry(WorkflowDTO workflow) throws org.wso2.carbon.apimgt.api.APIManagementException
Persists WorkflowDTO to Database- Parameters:
workflow
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateWorkflowStatus
public void updateWorkflowStatus(WorkflowDTO workflowDTO) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
retrieveWorkflow
public WorkflowDTO retrieveWorkflow(String workflowReference) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns a workflow object for a given external workflow reference.- Parameters:
workflowReference
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
retrieveWorkflowFromInternalReference
public WorkflowDTO retrieveWorkflowFromInternalReference(String workflowReference, String workflowType) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns a workflow object for a given internal workflow reference and the workflow type.- Parameters:
workflowReference
-workflowType
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getPublishedDefaultVersion
public String getPublishedDefaultVersion(org.wso2.carbon.apimgt.api.model.APIIdentifier apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addUpdateAPIAsDefaultVersion
public void addUpdateAPIAsDefaultVersion(org.wso2.carbon.apimgt.api.model.API api, Connection connection) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addURITemplates
public void addURITemplates(int apiId, org.wso2.carbon.apimgt.api.model.API api, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Add URI Templates to database with resource scope mappings.- Parameters:
apiId
- API Idapi
- API to add URI templates oftenantId
- Tenant ID- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- If an error occurs while adding URI templates.
-
isAppAllowed
public boolean isAppAllowed(int applicationID, String userId, String groupId) throws org.wso2.carbon.apimgt.api.APIManagementException
Checks whether application is accessible to the specified user- Parameters:
applicationID
- ID of the ApplicationuserId
- Name of the User.groupId
- Group IDs- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationByName
public org.wso2.carbon.apimgt.api.model.Application getApplicationByName(String applicationName, String userId, String groupId) throws org.wso2.carbon.apimgt.api.APIManagementException
Fetches an Application by name.- Parameters:
applicationName
- Name of the ApplicationuserId
- Name of the User.groupId
- Group ID- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationById
public org.wso2.carbon.apimgt.api.model.Application getApplicationById(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationById
public org.wso2.carbon.apimgt.api.model.Application getApplicationById(int applicationId, String userId, String groupId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationByUUID
public org.wso2.carbon.apimgt.api.model.Application getApplicationByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves the Application which is corresponding to the given UUID String- Parameters:
uuid
- UUID of Application- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateURITemplates
public void updateURITemplates(org.wso2.carbon.apimgt.api.model.API api, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Update URI templates define for an API.- Parameters:
api
- API to updatetenantId
- tenant Id- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if fails to update URI template of the API.
-
getResourceToScopeMapping
public HashMap<Integer,Set<String>> getResourceToScopeMapping(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get resource (URI Template) to scope mappings of the given API.- Parameters:
uuid
- API uuid- Returns:
- Map of URI template ID to Scope Keys
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while getting resource to scope mapping of the API
-
getAllURITemplates
public ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate> getAllURITemplates(String apiContext, String version) throws org.wso2.carbon.apimgt.api.APIManagementException
returns all URL templates define for all active(PUBLISHED) APIs.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIProductURITemplates
public ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate> getAPIProductURITemplates(String apiContext, String version) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAllURITemplatesOldThrottle
public ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate> getAllURITemplatesOldThrottle(String apiContext, String version) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAllURITemplatesAdvancedThrottle
public ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate> getAllURITemplatesAdvancedThrottle(String apiContext, String version) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIProductURITemplatesAdvancedThrottle
public ArrayList<org.wso2.carbon.apimgt.api.model.URITemplate> getAPIProductURITemplatesAdvancedThrottle(String apiContext, String version) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIProviderByNameAndVersion
public String getAPIProviderByNameAndVersion(String apiName, String apiVersion, String tenant) throws org.wso2.carbon.apimgt.api.APIManagementException
This method is used to get the API provider by giving API name, API version and tenant domain- Parameters:
apiName
- API nameapiVersion
- API versiontenant
- tenant domain- Returns:
- API provider
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get the API provider by giving API name, API version, tenant domain
-
createConditionGroupDTO
public org.wso2.carbon.apimgt.api.dto.ConditionGroupDTO createConditionGroupDTO(int conditionGroup) throws org.wso2.carbon.apimgt.api.APIManagementException
Converts anPipeline
object into aConditionGroupDTO
.ConditionGroupDTO
class tries to contain the same information held byPipeline
, but in a much lightweight fashion.- Parameters:
conditionGroup
- Id of the condition group (Pipeline
) to be converted- Returns:
- An object of
ConditionGroupDTO
type. - Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateAPI
public void updateAPI(org.wso2.carbon.apimgt.api.model.API api) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateAPI
public void updateAPI(org.wso2.carbon.apimgt.api.model.API api, String username) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIID
public int getAPIID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIID
public int getAPIID(String uuid, Connection connection) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
SQLException
-
setAPIProductFromDB
public void setAPIProductFromDB(org.wso2.carbon.apimgt.api.model.APIProduct product) throws org.wso2.carbon.apimgt.api.APIManagementException
Get product Id from the product name and the provider.- Parameters:
product
- product identifier- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- exception
-
deleteApplicationMappingByConsumerKey
public void deleteApplicationMappingByConsumerKey(String consumerKey) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete a record from AM_APPLICATION_KEY_MAPPING table- Parameters:
consumerKey
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteAPI
public void deleteAPI(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationsByTier
public org.wso2.carbon.apimgt.api.model.Application[] getApplicationsByTier(String tier) throws org.wso2.carbon.apimgt.api.APIManagementException
Get all applications associated with given tier- Parameters:
tier
- String tier name- Returns:
- Application object array associated with tier
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- on error in getting applications array
-
getURITemplatesPerAPIAsString
public HashMap<String,String> getURITemplatesPerAPIAsString(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getURITemplatesOfAPI
public Set<org.wso2.carbon.apimgt.api.model.URITemplate> getURITemplatesOfAPI(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getURITemplatesOfAPIWithProductMapping
public Map<Integer,org.wso2.carbon.apimgt.api.model.URITemplate> getURITemplatesOfAPIWithProductMapping(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addComment
public int addComment(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String commentText, String user) throws org.wso2.carbon.apimgt.api.APIManagementException
Deprecated.This method needs to be removed once the Jaggery web apps are removed.Adds a comment for an API- Parameters:
identifier
- API IdentifiercommentText
- Commented Textuser
- User who did the comment- Returns:
- Comment ID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addComment
public String addComment(String uuid, org.wso2.carbon.apimgt.api.model.Comment comment, String user) throws org.wso2.carbon.apimgt.api.APIManagementException
Adds a comment for an API- Parameters:
uuid
- API uuidcomment
- Commented Textuser
- User who did the comment- Returns:
- Comment ID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getComment
public org.wso2.carbon.apimgt.api.model.Comment getComment(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String commentId, Integer replyLimit, Integer replyOffset) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns a specific comment of an API- Parameters:
commentId
- Comment IDapiTypeWrapper
- Api Type Wrapper- Returns:
- Comment Array
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getComments
public org.wso2.carbon.apimgt.api.model.CommentList getComments(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String parentCommentID, Integer limit, Integer offset) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns all the Comments on an API- Parameters:
apiTypeWrapper
- API type WrapperparentCommentID
- Parent Comment ID- Returns:
- Comment Array
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getComments
public org.wso2.carbon.apimgt.api.model.Comment[] getComments(String uuid, String parentCommentID) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns all the Comments on an API- Parameters:
uuid
- API uuidparentCommentID
- Parent Comment ID- Returns:
- Comment Array
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
editComment
public boolean editComment(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String commentId, org.wso2.carbon.apimgt.api.model.Comment comment) throws org.wso2.carbon.apimgt.api.APIManagementException
Edit a comment- Parameters:
apiTypeWrapper
- API Type WrappercommentId
- Comment IDcomment
- Comment object- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteComment
public boolean deleteComment(org.wso2.carbon.apimgt.api.model.ApiTypeWrapper apiTypeWrapper, String commentId) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete a comment- Parameters:
apiTypeWrapper
- API Type WrappercommentId
- Comment ID- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteComment
public void deleteComment(String uuid, String commentId) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete a comment- Parameters:
uuid
- API uuidcommentId
- Comment ID- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIContext
public String getAPIContext(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API Context using a new DB connection.- Parameters:
uuid
- API uuid- Returns:
- API Context
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getAPIContext
public String getAPIContext(String uuid, Connection connection) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API Context by passing an existing DB connection.- Parameters:
uuid
- API uuidconnection
- DB Connection- Returns:
- API Context
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getAPIIdentifierFromUUID
public org.wso2.carbon.apimgt.api.model.APIIdentifier getAPIIdentifierFromUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API Identifier by the the API's UUID.- Parameters:
uuid
- uuid of the API- Returns:
- API Identifier
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getAPIProductIdentifierFromUUID
public org.wso2.carbon.apimgt.api.model.APIProductIdentifier getAPIProductIdentifierFromUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API Product Identifier by the product's UUID.- Parameters:
uuid
- uuid of the API- Returns:
- API Identifier
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getOrganizationByAPIUUID
public String getOrganizationByAPIUUID(String apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
apiId
- UUID of the API- Returns:
- organization of the API
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getGatewayVendorByAPIUUID
public String getGatewayVendorByAPIUUID(String apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve the gateway vendor of an API by providing the UUID- Parameters:
apiId
- UUID of the API- Returns:
- gatewayVendor of the API
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getUUIDFromIdentifier
public String getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.Identifier apiIdentifier, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getUUIDFromIdentifier
public String getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API UUID by the API Identifier.- Parameters:
identifier
- API Identifier- Returns:
- String UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getUUIDFromIdentifier
public String getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIProductIdentifier identifier) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API Product UUID by the API Product Identifier.- Parameters:
identifier
- API Product Identifier- Returns:
- String UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getUUIDFromIdentifier
public String getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API UUID by the API Identifier.- Parameters:
identifier
- API Identifierorganization
- identifier of the organization- Returns:
- String UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getUUIDFromIdentifier
public String getUUIDFromIdentifier(String provider, String apiName, String version, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API UUID by passed parameters.- Parameters:
provider
- Provider of the APIapiName
- Name of the APIversion
- Version of the APIorganization
- identifier of the organization- Returns:
- String UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getUUIDFromIdentifier
public String getUUIDFromIdentifier(org.wso2.carbon.apimgt.api.model.APIProductIdentifier identifier, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API Product UUID by the API Product Identifier and organization.- Parameters:
identifier
- API Product Identifierorganization
-- Returns:
- String UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getUUIDFromIdentifier
public String getUUIDFromIdentifier(String provider, String apiName, String version) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API UUID by passed parameters.- Parameters:
provider
- Provider of the APIapiName
- Name of the APIversion
- Version of the API- Returns:
- String UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
getAPITypeFromUUID
public String getAPITypeFromUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API TYPE by the uuid.- Parameters:
uuid
- UUID of API- Returns:
- String API Type
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
populateAppRegistrationWorkflowDTO
public void populateAppRegistrationWorkflowDTO(ApplicationRegistrationWorkflowDTO workflowDTO) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationIdForAppRegistration
public int getApplicationIdForAppRegistration(String workflowReference) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getWorkflowReference
public String getWorkflowReference(String applicationName, String userId) throws org.wso2.carbon.apimgt.api.APIManagementException
Fetches WorkflowReference when given Application Name and UserId.- Parameters:
applicationName
-userId
-- Returns:
- WorkflowReference
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getWorkflowReferenceByApplicationId
public String getWorkflowReferenceByApplicationId(int applicationId, String userId) throws org.wso2.carbon.apimgt.api.APIManagementException
Fetches WorkflowReference when given Application Name and UserId.- Parameters:
applicationId
-userId
-- Returns:
- WorkflowReference
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getExternalWorkflowReferenceByApplicationID
public String getExternalWorkflowReferenceByApplicationID(int appID) throws org.wso2.carbon.apimgt.api.APIManagementException
Retries the WorkflowExternalReference for a application.- Parameters:
appID
- ID of the application- Returns:
- External workflow reference for the application identified
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getExternalWorkflowRefByInternalRefWorkflowType
public String getExternalWorkflowRefByInternalRefWorkflowType(int internalRef, String workflowType) throws org.wso2.carbon.apimgt.api.APIManagementException
Get external workflow reference by internal workflow reference and workflow type- Parameters:
internalRef
- Internal reference of the workflowworkflowType
- Workflow type of the workflow- Returns:
- External workflow reference for the given internal reference and workflow type if present. Null otherwise
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- If an SQL exception occurs in database interactions
-
removeWorkflowEntry
public void removeWorkflowEntry(String workflowReference, String workflowType) throws org.wso2.carbon.apimgt.api.APIManagementException
Remove workflow entry- Parameters:
workflowReference
-workflowType
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getExternalWorkflowReferenceForSubscription
public String getExternalWorkflowReferenceForSubscription(org.wso2.carbon.apimgt.api.model.Identifier identifier, int appID, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Retries the WorkflowExternalReference for a subscription.- Parameters:
identifier
- Identifier to find the subscribed apiappID
- ID of the application which has the subscriptionorganization
- organization- Returns:
- External workflow reference for the subscription identified
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getExternalWorkflowReferenceForSubscription
public String getExternalWorkflowReferenceForSubscription(int subscriptionId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retries the WorkflowExternalReference for a subscription.- Parameters:
subscriptionId
- ID of the subscription- Returns:
- External workflow reference for the subscription
subscriptionId
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getExternalWorkflowReferenceForSubscriptionAndWFType
public String getExternalWorkflowReferenceForSubscriptionAndWFType(int subscriptionId, String wfType) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getExternalWorkflowReferenceForUserSignup
public String getExternalWorkflowReferenceForUserSignup(String usernameWithDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Retries the WorkflowExternalReference for an user signup by DOMAIN/username.- Parameters:
usernameWithDomain
- username of the signed up user inthe format of DOMAIN/username- Returns:
- External workflow reference for the signup workflow entry
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getPendingSubscriptionsByApplicationId
public Set<Integer> getPendingSubscriptionsByApplicationId(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves IDs of pending subscriptions for a given application- Parameters:
applicationId
- application id of the application- Returns:
- Set containing subscription id list
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getPendingSubscriptionsByAppId
public Map<String,Set<Integer>> getPendingSubscriptionsByAppId(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getPendingSubscriptionsByAPIId
public Set<Integer> getPendingSubscriptionsByAPIId(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves the IDs of pending subscriptions of a given API- Parameters:
uuid
- API uuid- Returns:
- set of subscriptions ids
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getRegistrationWFReference
public String getRegistrationWFReference(int applicationId, String keyType, String keyManagerName) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves registration workflow reference for applicationId and key type- Parameters:
applicationId
- id of the application with registrationkeyType
- key type of the registrationkeyManagerName
-- Returns:
- workflow reference of the registration
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionStatus
public String getSubscriptionStatus(String uuid, int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrives subscription status for APIIdentifier and applicationId- Parameters:
uuid
- API subscribedapplicationId
- application with subscription- Returns:
- subscription status
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionId
public String getSubscriptionId(String uuid, int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves subscription Id for APIIdentifier and applicationId- Parameters:
uuid
- API subscribedapplicationId
- application with subscription- Returns:
- subscription id
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionCreaeteStatus
public String getSubscriptionCreaeteStatus(org.wso2.carbon.apimgt.api.model.APIIdentifier identifier, int applicationId, String organization, Connection connection) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve subscription create state for APIIdentifier and applicationID- Parameters:
identifier
- - api identifier which is subscribedapplicationId
- - application used to subscribedorganization
- identifier of the organizationconnection
-- Returns:
- subscription create status
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyManagerConfigurationsByOrganization
public List<org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO> getKeyManagerConfigurationsByOrganization(String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyManagerConfigurationByID
public org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO getKeyManagerConfigurationByID(String organization, String id) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isIDPExistInOrg
public boolean isIDPExistInOrg(String organization, String resourceId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyManagerConfigurationByName
public org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO getKeyManagerConfigurationByName(String organization, String name) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyManagerConfigurationByUUID
public org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO getKeyManagerConfigurationByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addKeyManagerConfiguration
public void addKeyManagerConfiguration(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO keyManagerConfigurationDTO) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isKeyManagerConfigurationExistById
public boolean isKeyManagerConfigurationExistById(String organization, String id) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateKeyManagerConfiguration
public void updateKeyManagerConfiguration(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO keyManagerConfigurationDTO) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteKeyManagerConfigurationById
public void deleteKeyManagerConfigurationById(String id, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyManagerConfigurations
public List<org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO> getKeyManagerConfigurations() throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isKeyManagerConfigurationExistByName
public boolean isKeyManagerConfigurationExistByName(String name, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyMappingsFromApplicationId
public Set<org.wso2.carbon.apimgt.api.model.APIKey> getKeyMappingsFromApplicationId(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyMappingFromApplicationIdAndKeyMappingId
public org.wso2.carbon.apimgt.api.model.APIKey getKeyMappingFromApplicationIdAndKeyMappingId(int applicationId, String keyMappingId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteApplicationKeyMappingByMappingId
public void deleteApplicationKeyMappingByMappingId(String keyMappingId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getKeyMappingIdFromApplicationIdKeyTypeAndKeyManager
public String getKeyMappingIdFromApplicationIdKeyTypeAndKeyManager(int applicationId, String tokenType, String keyManagerName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateApplicationKeyTypeMetaData
public void updateApplicationKeyTypeMetaData(int applicationId, String keyType, String keyManagerName, org.wso2.carbon.apimgt.api.model.OAuthApplicationInfo updatedAppInfo) throws org.wso2.carbon.apimgt.api.APIManagementException
This method used to update Application metadata according to oauth app info- Parameters:
applicationId
-keyType
-keyManagerName
-updatedAppInfo
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIInfoByUUID
public org.wso2.carbon.apimgt.api.model.APIInfo getAPIInfoByUUID(String apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve basic information about the given API by the UUID quering only from AM_API- Parameters:
apiId
- UUID of the API- Returns:
- basic information about the API
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- error while getting the API information from AM_API
-
getAPIStatusFromAPIUUID
public String getAPIStatusFromAPIUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
setDefaultVersion
public void setDefaultVersion(org.wso2.carbon.apimgt.api.model.API api) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getLightWeightAPIInfoByAPIIdentifier
public org.wso2.carbon.apimgt.api.model.API getLightWeightAPIInfoByAPIIdentifier(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addExternalAPIStoresDetails
public boolean addExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet) throws org.wso2.carbon.apimgt.api.APIManagementException
Store external APIStore details to which APIs successfully published- Parameters:
uuid
- API uuidapiStoreSet
- APIStores set- Returns:
- added/failed
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteExternalAPIStoresDetails
public boolean deleteExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete the records of external APIStore details.- Parameters:
uuid
- API uuidapiStoreSet
- APIStores set- Returns:
- added/failed
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateExternalAPIStoresDetails
public void updateExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateExternalAPIStoresDetails
public void updateExternalAPIStoresDetails(String uuid, Set<org.wso2.carbon.apimgt.api.model.APIStore> apiStoreSet, Connection conn) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
Updateexternal APIStores details to which APIs published- Parameters:
uuid
- API uuid- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to add ApplicationSQLException
-
getExternalAPIStoresDetails
public Set<org.wso2.carbon.apimgt.api.model.APIStore> getExternalAPIStoresDetails(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Return external APIStore details on successfully APIs published- Parameters:
uuid
- API uuid- Returns:
- Set of APIStore
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getExternalAPIStoresDetails
public Set<org.wso2.carbon.apimgt.api.model.APIStore> getExternalAPIStoresDetails(String uuid, Connection conn) throws org.wso2.carbon.apimgt.api.APIManagementException, SQLException
Get external APIStores details which are stored in database- Parameters:
uuid
- API uuid- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get external APIStoresSQLException
-
getAPIScopeKeys
public Set<String> getAPIScopeKeys(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get Scope keys attached to the given API.- Parameters:
uuid
- API uuid- Returns:
- set of scope key attached to the API
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if fails get API scope keys
-
getScopesBySubscribedAPIs
public Set<String> getScopesBySubscribedAPIs(List<String> identifiers) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getUnversionedLocalScopeKeysForAPI
public Set<String> getUnversionedLocalScopeKeysForAPI(String uuid, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the unversioned local scope keys set of the API.- Parameters:
uuid
- API uuidtenantId
- Tenant Id- Returns:
- Local Scope keys set
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if fails to get local scope keys for API
-
getVersionedLocalScopeKeysForAPI
public Set<String> getVersionedLocalScopeKeysForAPI(String uuid, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the versioned local scope keys set of the API.- Parameters:
uuid
- API uuidtenantId
- Tenant Id- Returns:
- Local Scope keys set
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if fails to get local scope keys for API
-
getAllLocalScopeKeysForAPI
public Set<String> getAllLocalScopeKeysForAPI(String uuid, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the local scope keys set of the API.- Parameters:
uuid
- API uuidtenantId
- Tenant Id- Returns:
- Local Scope keys set
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if fails to get local scope keys for API
-
isApiNameExist
public boolean isApiNameExist(String apiName, String tenantDomain, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Check the given api name is already available in the api table under given tenant domain- Parameters:
apiName
- candidate api nametenantDomain
- tenant domain name- Returns:
- true if the name is already available
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isApiNameWithDifferentCaseExist
public boolean isApiNameWithDifferentCaseExist(String apiName, String tenantDomain, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Check whether another API with a different letter case of the given api name is already available in the api table under the given tenant domain- Parameters:
apiName
- candidate api nametenantDomain
- tenant domain name- Returns:
- true if a different letter case name is already available
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- If failed to check different letter case api name availability
-
isScopeKeyAssignedLocally
public boolean isScopeKeyAssignedLocally(String apiName, String scopeKey, int tenantId, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Check whether the given scope key is already assigned locally to another API which are different from the given API or its versioned APIs under given tenant.- Parameters:
apiName
- API NamescopeKey
- candidate scope keytenantId
- tenant idorganization
- identifier of the organization- Returns:
- true if the scope key is already available
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to check the context availability
-
isScopeKeyAssigned
public boolean isScopeKeyAssigned(String scopeKey, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Check the given scopeKey assigned to any API resource in the given tenant.- Parameters:
scopeKey
- Scope KeytenantId
- Tenant Id- Returns:
- Whether scope assigned or not
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- If an error occurs while checking scope assignment
-
getAPINamesMatchingContext
public List<String> getAPINamesMatchingContext(String contextTemplate) throws org.wso2.carbon.apimgt.api.APIManagementException
retrieve list of API names which matches given context- Parameters:
contextTemplate
- context template- Returns:
- list of API names
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isKeyMappingExistsForApplication
public boolean isKeyMappingExistsForApplication(int applicationId, String keyManagerName, String keyManagerId, String keyType) throws org.wso2.carbon.apimgt.api.APIManagementException
Check if key mappings already exists for app ID, key manager name or ID and key type.- Parameters:
applicationId
- app IDkeyManagerName
- key manager namekeyManagerId
- key manager IDkeyType
- key type- Returns:
- true if key mapping exists
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs
-
isKeyMappingExistsForConsumerKeyOrApplication
public boolean isKeyMappingExistsForConsumerKeyOrApplication(int applicationId, String keyManagerName, String keyManagerId, String keyType, String consumerKey) throws org.wso2.carbon.apimgt.api.APIManagementException
Check if key mapping exists for (app ID, key type and key manager) or (consumer key and key manager) values.- Parameters:
applicationId
- AppIDkeyManagerName
- KeyManager NamekeyManagerId
- KeyManager IdkeyType
- KeyTypeconsumerKey
- Consumer Key- Returns:
- true if key mapping exists
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs.
-
getConsumerkeyByApplicationIdAndKeyType
public Map<String,String> getConsumerkeyByApplicationIdAndKeyType(int applicationId, String keyType) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
applicationId
-keyType
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getLastPublishedAPIVersionFromAPIStore
public String getLastPublishedAPIVersionFromAPIStore(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String storeName) throws org.wso2.carbon.apimgt.api.APIManagementException
Get external APIStores details which are stored in database- Parameters:
apiIdentifier
- API Identifier- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get external APIStores
-
getAllAlertTypesByStakeHolder
public HashMap<Integer,String> getAllAlertTypesByStakeHolder(String stakeHolder) throws org.wso2.carbon.apimgt.api.APIManagementException
This method will fetch all alerts type that is available in AM_ALERT_TYPES.- Parameters:
stakeHolder
- the name of the stakeholder. whether its "subscriber", "publisher" or "admin-dashboard"- Returns:
- List of alert types
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSavedAlertTypesIdsByUserNameAndStakeHolder
public List<Integer> getSavedAlertTypesIdsByUserNameAndStakeHolder(String userName, String stakeHolder) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
userName
- user name with tenant domain ex: [email protected]stakeHolder
- value "p" for publisher value "s" for subscriber value "a" for admin- Returns:
- map of saved values of alert types.
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
retrieveSavedEmailList
public List<String> retrieveSavedEmailList(String userName, String stakeHolder) throws org.wso2.carbon.apimgt.api.APIManagementException
This method will retrieve saved emails list by user name and stakeholder.- Parameters:
userName
- user name.stakeHolder
- "publisher" , "subscriber" or "admin-dashboard"- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
unSubscribeAlerts
public void unSubscribeAlerts(String userName, String agent) throws org.wso2.carbon.apimgt.api.APIManagementException
This method will delete all email alert subscriptions details from tables- Parameters:
userName
-agent
- whether its publisher or store or admin dash board.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addAlertTypesConfigInfo
public void addAlertTypesConfigInfo(String userName, String emailList, String alertTypesIDList, String stakeHolder) throws org.wso2.carbon.apimgt.api.APIManagementException
- Parameters:
userName
- User name.emailList
- Comma separated email list.alertTypesIDList
- Comma separated alert types list.stakeHolder
- if pram value = p we assume those changes from publisher if param value = s those data belongs to subscriber.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
SQLException
-
addApplicationPolicy
public void addApplicationPolicy(org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Add a Application level throttling policy to database- Parameters:
policy
- policy object defining the throttle policy- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addSubscriptionPolicy
public void addSubscriptionPolicy(org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Add a Subscription level throttling policy to database- Parameters:
policy
- policy object defining the throttle policy- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addAPIPolicy
public org.wso2.carbon.apimgt.api.model.policy.APIPolicy addAPIPolicy(org.wso2.carbon.apimgt.api.model.policy.APIPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Wrapper method foraddAPIPolicy(APIPolicy, Connection)
to add API Policy without managing the database connection manually.- Parameters:
policy
- policy object to add- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateAPIPolicy
public org.wso2.carbon.apimgt.api.model.policy.APIPolicy updateAPIPolicy(org.wso2.carbon.apimgt.api.model.policy.APIPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Update a API level throttling policy to database.If condition group already exists for the policy, that condition Group will be deleted and condition Group will be inserted to the database with old POLICY_ID.
- Parameters:
policy
- policy object defining the throttle policy- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addGlobalPolicy
public void addGlobalPolicy(org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Add a Global level throttling policy to database- Parameters:
policy
- Global Policy- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getGlobalPolicyKeyTemplates
public List<String> getGlobalPolicyKeyTemplates(int tenantID) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves global policy key templates for the given tenantID- Parameters:
tenantID
- tenant id- Returns:
- list of KeyTemplates
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isKeyTemplatesExist
public boolean isKeyTemplatesExist(org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns true if the key template exist in DB- Parameters:
policy
- Global Policy- Returns:
- true if key template already exists
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
removeThrottlePolicy
public void removeThrottlePolicy(String policyLevel, String policyName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Removes a throttling policy from the database- Parameters:
policyLevel
- level of the policy to be deletedpolicyName
- name of the policytenantId
- used to get the tenant id- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIPolicies
public org.wso2.carbon.apimgt.api.model.policy.APIPolicy[] getAPIPolicies(int tenantID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get API level policies. Result only contains basic details of the policy, it doesn't contain pipeline information.- Parameters:
tenantID
- policies are selected using tenantID- Returns:
- APIPolicy ArrayList
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationPolicies
public org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy[] getApplicationPolicies(int tenantID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get application level polices- Parameters:
tenantID
- polices are selected only belong to specific tenantID- Returns:
- AppilicationPolicy array list
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionPolicies
public org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy[] getSubscriptionPolicies(int tenantID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get all subscription level policeis belongs to specific tenant- Parameters:
tenantID
- tenantID filters the polices belongs to specific tenant- Returns:
- subscriptionPolicy array list
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionPolicies
public org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy[] getSubscriptionPolicies(String[] subscriptionTiers, int tenantID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get subscription level policies specified by tier names belonging to a specific tenant- Parameters:
subscriptionTiers
- subscription tierstenantID
- tenantID filters the polices belongs to specific tenant- Returns:
- subscriptionPolicy array list
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getGlobalPolicies
public org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy[] getGlobalPolicies(int tenantID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get all Global level policeis belongs to specific tenant- Parameters:
tenantID
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getGlobalPolicy
public org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy getGlobalPolicy(String policyName) throws org.wso2.carbon.apimgt.api.APIManagementException
Get a particular Global level policy.- Parameters:
policyName
- name of the global polixy- Returns:
GlobalPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getGlobalPolicyByUUID
public org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy getGlobalPolicyByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get a particular Global level policy given UUID.- Parameters:
uuid
- name of the global polixy- Returns:
GlobalPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIPolicy
public org.wso2.carbon.apimgt.api.model.policy.APIPolicy getAPIPolicy(String policyName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
RetrievesAPIPolicy
with namepolicyName
and tenant IdtenantNId
This will retrieve complete details about the APIPolicy with all pipelins and conditions.
- Parameters:
policyName
- name of the policy to retrieve from the databasetenantId
- tenantId of the policy- Returns:
APIPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIPolicyByUUID
public org.wso2.carbon.apimgt.api.model.policy.APIPolicy getAPIPolicyByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
RetrievesAPIPolicy
with nameuuid
This will retrieve complete details about the APIPolicy with all pipelines and conditions.
- Parameters:
uuid
- uuid of the policy to retrieve from the database- Returns:
APIPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationPolicy
public org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy getApplicationPolicy(String policyName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
RetrievesApplicationPolicy
with namepolicyName
and tenant IdtenantNId
- Parameters:
policyName
- name of the policy to retrieve from the databasetenantId
- tenantId of the policy- Returns:
ApplicationPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationPolicyByUUID
public org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy getApplicationPolicyByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
RetrievesApplicationPolicy
with nameuuid
- Parameters:
uuid
- uuid of the policy to retrieve from the database- Returns:
ApplicationPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionPolicy
public org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy getSubscriptionPolicy(String policyName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
RetrievesSubscriptionPolicy
with namepolicyName
and tenant IdtenantNId
- Parameters:
policyName
- name of the policy to retrieve from the databasetenantId
- tenantId of the policy- Returns:
SubscriptionPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscriptionPolicyByUUID
public org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy getSubscriptionPolicyByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
RetrievesSubscriptionPolicy
with nameuuid
- Parameters:
uuid
- name of the policy to retrieve from the database- Returns:
SubscriptionPolicy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateApplicationPolicy
public void updateApplicationPolicy(org.wso2.carbon.apimgt.api.model.policy.ApplicationPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Updates Application level policy.policy name and tenant id should be specified in
policy
- Parameters:
policy
- updated policy object- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateSubscriptionPolicy
public void updateSubscriptionPolicy(org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Updates Subscription level policy.policy name and tenant id should be specified in
policy
- Parameters:
policy
- updated policy object- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateGlobalPolicy
public void updateGlobalPolicy(org.wso2.carbon.apimgt.api.model.policy.GlobalPolicy policy) throws org.wso2.carbon.apimgt.api.APIManagementException
Updates global throttle policy in database- Parameters:
policy
- updated policy obejct- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getPolicyNames
public String[] getPolicyNames(String policyLevel, String username) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves list of available policy names underpolicyLevel
and userusername
's tenant- Parameters:
policyLevel
- policY level to filter policiesusername
- username will be used to get the tenant- Returns:
- array of policy names
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
setPolicyDeploymentStatus
public void setPolicyDeploymentStatus(String policyLevel, String policyName, int tenantId, boolean isDeployed) throws org.wso2.carbon.apimgt.api.APIManagementException
Sets deployment status vaule of a policy in database.- Parameters:
policyLevel
- policy levelpolicyName
- name of the policytenantId
- tenant id of the policyisDeployed
- deployment status.true
if deployment successful,false
if not- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isPolicyExist
public boolean isPolicyExist(String policyType, int tenantId, String policyName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isPolicyExist
public boolean isPolicyExist(Connection connection, String policyType, int tenantId, String policyName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isPolicyDeployed
public boolean isPolicyDeployed(String policyType, int tenantId, String policyName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addBlockConditions
public org.wso2.carbon.apimgt.api.model.BlockConditionsDTO addBlockConditions(org.wso2.carbon.apimgt.api.model.BlockConditionsDTO blockConditionsDTO) throws org.wso2.carbon.apimgt.api.APIManagementException
Add a block condition- Returns:
- uuid of the block condition if successfully added
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getBlockCondition
public org.wso2.carbon.apimgt.api.model.BlockConditionsDTO getBlockCondition(int conditionId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get details of a block condition by Id- Parameters:
conditionId
- id of the condition- Returns:
- Block conditoin represented by the UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getBlockConditionByUUID
public org.wso2.carbon.apimgt.api.model.BlockConditionsDTO getBlockConditionByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get details of a block condition by UUID- Parameters:
uuid
- uuid of the block condition- Returns:
- Block condition represented by the UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getBlockConditions
public List<org.wso2.carbon.apimgt.api.model.BlockConditionsDTO> getBlockConditions(String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateBlockConditionState
public boolean updateBlockConditionState(int conditionId, String state) throws org.wso2.carbon.apimgt.api.APIManagementException
Update the block condition state true (Enabled) /false (Disabled) given the UUID- Parameters:
conditionId
- id of the block conditionstate
- blocking state- Returns:
- true if the operation was success
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateBlockConditionStateByUUID
public boolean updateBlockConditionStateByUUID(String uuid, String state) throws org.wso2.carbon.apimgt.api.APIManagementException
Update the block condition state true (Enabled) /false (Disabled) given the UUID- Parameters:
uuid
- UUID of the block conditionstate
- blocking state- Returns:
- true if the operation was success
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteBlockCondition
public boolean deleteBlockCondition(int conditionId) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete the block condition given the id- Parameters:
conditionId
- id of the condition- Returns:
- true if successfully deleted
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteBlockConditionByUUID
public boolean deleteBlockConditionByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete the block condition given the id- Parameters:
uuid
- UUID of the block condition- Returns:
- true if successfully deleted
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPILevelTier
public String getAPILevelTier(int id) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPILevelTier
public String getAPILevelTier(String apiUUID, String revisionUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
fillQueryParams
public PreparedStatement fillQueryParams(Connection conn, String query, String[] params, int startingParamIndex) throws SQLException
Returns a Prepared statement after setting all the dynamic parameters. Dynamic parameters will be added in the place of $params in query string- Parameters:
conn
- connection which will be used to create a prepared statementquery
- dynamic query string which will be modified.params
- list of parametersstartingParamIndex
- index from which the parameter numbering will start.- Returns:
- Throws:
SQLException
-
isGrpIdMappingTableExist
public boolean isGrpIdMappingTableExist()
Returns True if AM_APPLICATION_GROUP_MAPPING table exist in AM DB- Returns:
-
getGroupId
public String getGroupId(int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscribedAPIsForAnApp
public APISubscriptionInfoDTO[] getSubscribedAPIsForAnApp(String userId, int applicationID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get Subscribed APIs for an App.- Parameters:
applicationID
- id of the application name- Returns:
- APISubscriptionInfoDTO[]
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to get Subscribed APIs
-
getApplicationByClientId
public org.wso2.carbon.apimgt.api.model.Application getApplicationByClientId(String clientId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAllEnvironments
public List<org.wso2.carbon.apimgt.api.model.Environment> getAllEnvironments(String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns the Environments List for the TenantId.- Parameters:
tenantDomain
- The tenant domain.- Returns:
- List of Environments.
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getEnvironment
public org.wso2.carbon.apimgt.api.model.Environment getEnvironment(String tenantDomain, String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Returns the Environment for the uuid in the tenant domain.- Parameters:
tenantDomain
- the tenant domain to look environmentuuid
- UUID of the environment- Returns:
- Gateway environment with given UUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addEnvironment
public org.wso2.carbon.apimgt.api.model.Environment addEnvironment(String tenantDomain, org.wso2.carbon.apimgt.api.model.Environment environment) throws org.wso2.carbon.apimgt.api.APIManagementException
Add an Environment- Parameters:
tenantDomain
- tenant domainenvironment
- Environment- Returns:
- added Environment
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to add environment
-
deleteEnvironment
public void deleteEnvironment(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete an Environment- Parameters:
uuid
- UUID of the environment- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to delete environment
-
updateEnvironment
public org.wso2.carbon.apimgt.api.model.Environment updateEnvironment(org.wso2.carbon.apimgt.api.model.Environment environment) throws org.wso2.carbon.apimgt.api.APIManagementException
Update Gateway Environment- Parameters:
environment
- Environment to be updated- Returns:
- Updated Environment
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to updated Environment
-
getApplicationAttributes
public Map<String,String> getApplicationAttributes(Connection conn, int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get all attributes stored against an Application- Parameters:
conn
- Database connectionapplicationId
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteApplicationAttributes
public void deleteApplicationAttributes(String attributeKey, int applicationId) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete certain attribute stored against an Application- Parameters:
attributeKey
- User defined key of attributeapplicationId
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addApplicationAttributes
public void addApplicationAttributes(Map<String,String> applicationAttributes, int applicationId, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Add new attributes against an Application in API Store- Parameters:
applicationAttributes
- Map of key, value pair of attributesapplicationId
- Id of Application against which attributes are getting storedtenantId
- Id of tenant- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
convertNullThrottlingTiers
public void convertNullThrottlingTiers() throws org.wso2.carbon.apimgt.api.APIManagementException
Converts all null values for THROTTLING_TIER in AM_API_URL_MAPPING table, to Unlimited. This will be executed only during startup of the server.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getApplicationBySubscriberIdAndName
public org.wso2.carbon.apimgt.api.model.Application getApplicationBySubscriberIdAndName(int subscriberId, String applicationName) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves the Application which is corresponding to the given UUID String- Parameters:
subscriberId
- subscriberId of the ApplicationapplicationName
- name of the Application- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getURITemplatesForAPI
public Map<String,org.wso2.carbon.apimgt.api.model.URITemplate> getURITemplatesForAPI(org.wso2.carbon.apimgt.api.model.API api) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve URI Templates for the given API- Parameters:
api
- API- Returns:
- Map of URITemplate with key as Method:resourcepath
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- exception
-
getResourcePathsOfAPI
public List<org.wso2.carbon.apimgt.api.model.ResourcePath> getResourcePathsOfAPI(org.wso2.carbon.apimgt.api.model.APIIdentifier apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addAPIProduct
public void addAPIProduct(org.wso2.carbon.apimgt.api.model.APIProduct apiProduct, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addAPIProductResourceMappings
public void addAPIProductResourceMappings(List<org.wso2.carbon.apimgt.api.model.APIProductResource> productResources, String organization, Connection connection) throws org.wso2.carbon.apimgt.api.APIManagementException
Add api product url mappings to DB - url templeates to product mappings (resource bundling) - AM_API_PRODUCT_MAPPING- Parameters:
productResources
-organization
-connection
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateAPIProductResourceMappings
public void updateAPIProductResourceMappings(org.wso2.carbon.apimgt.api.model.APIProduct apiProduct, int productId, Connection connection) throws org.wso2.carbon.apimgt.api.APIManagementException
Update Product scope and resource mappings- Parameters:
apiProduct
-productId
-connection
-- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteAPIProduct
public void deleteAPIProduct(org.wso2.carbon.apimgt.api.model.APIProductIdentifier productIdentifier) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete API product and its related scopes- Parameters:
productIdentifier
- product ID- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getProductMappingsForAPI
public List<org.wso2.carbon.apimgt.api.model.APIProductResource> getProductMappingsForAPI(org.wso2.carbon.apimgt.api.model.API api) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIProductId
public int getAPIProductId(org.wso2.carbon.apimgt.api.model.APIProductIdentifier identifier) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateAPIProduct
public void updateAPIProduct(org.wso2.carbon.apimgt.api.model.APIProduct product, String username) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPIProductResourceMappings
public List<org.wso2.carbon.apimgt.api.model.APIProductResource> getAPIProductResourceMappings(org.wso2.carbon.apimgt.api.model.APIProductIdentifier productIdentifier) throws org.wso2.carbon.apimgt.api.APIManagementException
get resource mapping of the api product TODO://Get resource scopes from AM_API_RESOURCE_SCOPE table and retrieve scope meta data and bindings from KM.- Parameters:
productIdentifier
- api product identifier- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addAuditApiMapping
public void addAuditApiMapping(org.wso2.carbon.apimgt.api.model.APIIdentifier apiIdentifier, String uuid, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Add new Audit API ID- Parameters:
apiIdentifier
- APIIdentifier object to retrieve API IDuuid
- Audit API IDorganization
- Organization- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAuditApiId
public String getAuditApiId(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get Audit API ID- Parameters:
uuid
- API uuid to retrieve API ID- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addComplexityDetails
public void addComplexityDetails(String apiUuid, org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo graphqlComplexityInfo) throws org.wso2.carbon.apimgt.api.APIManagementException
Add custom complexity details for a particular API- Parameters:
apiUuid
- API uuid to retrieve API IDgraphqlComplexityInfo
- GraphqlComplexityInfo object- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateComplexityDetails
public void updateComplexityDetails(String uuid, org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo graphqlComplexityInfo) throws org.wso2.carbon.apimgt.api.APIManagementException
Update custom complexity details for a particular API- Parameters:
uuid
- API uuid object to retrieve API IDgraphqlComplexityInfo
- GraphqlComplexityInfo object- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addOrUpdateComplexityDetails
public void addOrUpdateComplexityDetails(String uuid, org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo graphqlComplexityInfo) throws org.wso2.carbon.apimgt.api.APIManagementException
Add or Update complexity details- Parameters:
uuid
- API uuid to retrieve API IDgraphqlComplexityInfo
- GraphqlComplexityDetails object- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getComplexityDetails
public org.wso2.carbon.apimgt.api.model.graphql.queryanalysis.GraphqlComplexityInfo getComplexityDetails(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get custom complexity details for a particular API- Parameters:
uuid
- API UUID to retrieve API ID- Returns:
- info about the complexity details
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addBotDetectionAlertSubscription
public void addBotDetectionAlertSubscription(String email) throws org.wso2.carbon.apimgt.api.APIManagementException
Add a bot detection alert subscription- Parameters:
email
- email to be registered for the subscription- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a bot detection alert subscription
-
getBotDetectionAlertSubscriptions
public List<org.wso2.carbon.apimgt.api.model.botDataAPI.BotDetectionData> getBotDetectionAlertSubscriptions() throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve all bot detection alert subscriptions- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when retrieving bot detection alert subscriptions
-
deleteBotDetectionAlertSubscription
public void deleteBotDetectionAlertSubscription(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete a bot detection alert subscription- Parameters:
uuid
- uuid of the subscription- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when deleting a bot detection alert subscription
-
getBotDetectionAlertSubscription
public org.wso2.carbon.apimgt.api.model.botDataAPI.BotDetectionData getBotDetectionAlertSubscription(String field, String value) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve a bot detection alert subscription by querying a particular field (uuid or email)- Parameters:
field
- field to be queried to obtain the bot detection alert subscription. Can be uuid or emailvalue
- value corresponding to the field (uuid or email value)- Returns:
- if subscription exist, returns the bot detection alert subscription, else returns a null object
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when retrieving a bot detection alert subscription
-
addRevokedJWTSignature
public void addRevokedJWTSignature(String eventId, String jwtSignature, String type, Long expiryTime, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Persist revoked jwt signatures to database.- Parameters:
eventId
-jwtSignature
- signature of jwt token.expiryTime
- expiry time of the token.tenantId
- tenant id of the jwt subject.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
removeExpiredJWTs
public void removeExpiredJWTs() throws org.wso2.carbon.apimgt.api.APIManagementException
Removes expired JWTs from revoke table.- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addCategory
public org.wso2.carbon.apimgt.api.model.APICategory addCategory(org.wso2.carbon.apimgt.api.model.APICategory category, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Adds an API category- Parameters:
category
- Categoryorganization
- Organization- Returns:
- Category
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateCategory
public void updateCategory(org.wso2.carbon.apimgt.api.model.APICategory apiCategory) throws org.wso2.carbon.apimgt.api.APIManagementException
Update API Category- Parameters:
apiCategory
- API category object with updated details- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAllCategories
public List<org.wso2.carbon.apimgt.api.model.APICategory> getAllCategories(String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Get all available API categories of the organization- Parameters:
organization
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
isAPICategoryNameExists
public boolean isAPICategoryNameExists(String categoryName, String uuid, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Checks whether the given category name is already available under given tenant domain with any UUID other than the given UUID- Parameters:
categoryName
-uuid
-organization
-- Returns:
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPICategoryByID
public org.wso2.carbon.apimgt.api.model.APICategory getAPICategoryByID(String apiCategoryID) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteCategory
public void deleteCategory(String categoryID) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addUserID
public String addUserID(String userID, String userName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getUserID
public String getUserID(String userName) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getNamesOfTierWithBandwidthQuotaType
public List<String> getNamesOfTierWithBandwidthQuotaType(int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get names of the tiers which has bandwidth as the quota type- Parameters:
tenantId
- id of the tenant- Returns:
- list of names
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteWorkflowRequest
public void deleteWorkflowRequest(String workflowExtRef) throws org.wso2.carbon.apimgt.api.APIManagementException
Remove the Pending workflow Requests using ExternalWorkflowReference- Parameters:
workflowExtRef
- External Workflow Reference of Workflow Pending Request- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getworkflowReferenceByExternalWorkflowReference
public org.wso2.carbon.apimgt.api.model.Workflow getworkflowReferenceByExternalWorkflowReference(String externalWorkflowRef) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the Pending workflow Request using ExternalWorkflowReference- Parameters:
externalWorkflowRef
-- Returns:
- workflow pending request
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getworkflows
public org.wso2.carbon.apimgt.api.model.Workflow[] getworkflows(String workflowType, String status, String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the Pending workflow Requests using WorkflowType for a particular tenant- Parameters:
workflowType
- Type of the workflow pending requeststatus
- workflow status of workflow pending requesttenantDomain
- tenantDomain of the user- Returns:
- List of workflow pending request
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getworkflowReferenceByExternalWorkflowReferenceID
public org.wso2.carbon.apimgt.api.model.Workflow getworkflowReferenceByExternalWorkflowReferenceID(String externelWorkflowRef, String status, String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the Pending workflow Request using ExternalWorkflowReference for a particular tenant- Parameters:
externelWorkflowRef
- of pending workflow requeststatus
- workflow status of workflow pending processtenantDomain
- tenant domain of user- Returns:
- workflow pending request
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addSharedScope
public String addSharedScope(org.wso2.carbon.apimgt.api.model.Scope scope, String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Add shared scope.- Parameters:
scope
- Scope Object to addtenantDomain
- Tenant domain- Returns:
- UUID of the shared scope
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while adding shared scope
-
deleteSharedScope
public void deleteSharedScope(String scopeName, String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete shared scope.- Parameters:
scopeName
- shared scope nametenantDomain
- tenant domain- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while removing shared scope
-
getSharedScopeKeyByUUID
public String getSharedScopeKeyByUUID(String uuid) throws org.wso2.carbon.apimgt.api.APIManagementException
Get shared scope key by uuid.- Parameters:
uuid
- UUID of shared scope- Returns:
- Shared scope key
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while getting shared scope
-
getSharedScopeUsage
public org.wso2.carbon.apimgt.api.model.SharedScopeUsage getSharedScopeUsage(String uuid, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the API and URI usages of the given shared scope- Parameters:
uuid
- Id of the shared scopetenantId
- tenant Id- Returns:
- usgaes ofr the shaerd scope
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- If an error occurs while getting the usage details
-
isSharedScopeExists
public boolean isSharedScopeExists(String scopeName, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Checks whether the given shared scope name is already available under given tenant domain.- Parameters:
scopeName
- Scope NametenantId
- Tenant ID- Returns:
- scope name availability
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- If an error occurs while checking the availability
-
getAllSharedScopeKeys
public Set<String> getAllSharedScopeKeys(String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Get all shared scope keys for tenant.- Parameters:
tenantDomain
- Tenant Domain- Returns:
- shared scope list
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while getting all shared scopes for tenant
-
getAllSharedScopes
public List<org.wso2.carbon.apimgt.api.model.Scope> getAllSharedScopes(String tenantDomain) throws org.wso2.carbon.apimgt.api.APIManagementException
Get all shared scopes for tenant.- Parameters:
tenantDomain
- Tenant Domain- Returns:
- shared scope list
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while getting all shared scopes for tenant
-
addTenantTheme
public void addTenantTheme(int tenantId, InputStream themeContent) throws org.wso2.carbon.apimgt.api.APIManagementException
Adds a tenant theme to the database- Parameters:
tenantId
- tenant ID of userthemeContent
- content of the tenant theme- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a tenant theme to the database
-
updateTenantTheme
public void updateTenantTheme(int tenantId, InputStream themeContent) throws org.wso2.carbon.apimgt.api.APIManagementException
Updates an existing tenant theme in the database- Parameters:
tenantId
- tenant ID of userthemeContent
- content of the tenant theme- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when updating an existing tenant theme in the database
-
getTenantTheme
public InputStream getTenantTheme(int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieves a tenant theme from the database- Parameters:
tenantId
- tenant ID of user- Returns:
- content of the tenant theme
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when retrieving a tenant theme from the database
-
isTenantThemeExist
public boolean isTenantThemeExist(int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Checks whether a tenant theme exist for a particular tenant- Parameters:
tenantId
- tenant ID of user- Returns:
- true if a tenant theme exist for a particular tenant ID, false otherwise
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when determining whether a tenant theme exists for a given tenant ID
-
deleteTenantTheme
public void deleteTenantTheme(int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Deletes a tenant theme from the database- Parameters:
tenantId
- tenant ID of user- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when deleting a tenant theme from the database
-
getAPIVersions
public Set<String> getAPIVersions(String apiName, String apiProvider, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Return the existing versions for the given api name for the provider- Parameters:
apiName
- api nameapiProvider
- providerorganization
- identifier of the organization- Returns:
- set version
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAllAPIVersions
public List<org.wso2.carbon.apimgt.api.model.API> getAllAPIVersions(String apiName, String apiProvider) throws org.wso2.carbon.apimgt.api.APIManagementException
Return ids of the versions for the given name for the given provider- Parameters:
apiName
- api nameapiProvider
- provider- Returns:
- set ids
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getRevisionCountByAPI
public int getRevisionCountByAPI(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get count of the revisions created for a particular API.- Returns:
- revision count
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision count
-
getMostRecentRevisionId
public int getMostRecentRevisionId(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get most recent revision id of the revisions created for a particular API.- Returns:
- revision id
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision id
-
getLatestRevisionUUID
public String getLatestRevisionUUID(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the latest revision UUID from the revision list for a given API- Parameters:
apiUUID
- UUID of the API- Returns:
- UUID of the revision
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision details
-
addAPIRevision
public void addAPIRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision) throws org.wso2.carbon.apimgt.api.APIManagementException
Adds an API revision record to the database- Parameters:
apiRevision
- content of the revision- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
getRevisionByRevisionUUID
public org.wso2.carbon.apimgt.api.model.APIRevision getRevisionByRevisionUUID(String revisionUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get revision details by providing revision UUID- Returns:
- revision object
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision details
-
getRevisionUUID
public String getRevisionUUID(String revisionNum, String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get revision UUID providing revision number- Parameters:
revisionNum
- Revision numberapiUUID
- UUID of the API- Returns:
- UUID of the revision
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision details
-
getRevisionUUIDByOrganization
public String getRevisionUUIDByOrganization(String revisionNum, String apiUUID, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Get revision UUID providing revision number and organization- Parameters:
revisionNum
- Revision numberapiUUID
- UUID of the APIorganization
- organization ID of the API- Returns:
- UUID of the revision
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision details
-
getEarliestRevision
public String getEarliestRevision(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the earliest revision UUID from the revision list for a given API- Parameters:
apiUUID
- UUID of the API- Returns:
- UUID of the revision
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision details
-
getRevisionsListByAPIUUID
public List<org.wso2.carbon.apimgt.api.model.APIRevision> getRevisionsListByAPIUUID(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get revision details by providing revision UUID- Returns:
- revisions List object
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision details
-
checkAPIUUIDIsARevisionUUID
public org.wso2.carbon.apimgt.api.model.APIRevision checkAPIUUIDIsARevisionUUID(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get a provided api uuid is in the revision db table- Returns:
- String apiUUID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while checking revision table
-
addAPIRevisionDeployment
public void addAPIRevisionDeployment(String apiRevisionId, List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> apiRevisionDeployments) throws org.wso2.carbon.apimgt.api.APIManagementException
Adds an API revision Deployment mapping record to the database- Parameters:
apiRevisionId
- uuid of the revisionapiRevisionDeployments
- content of the revision deployment mapping objects- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
addDeployedAPIRevision
public void addDeployedAPIRevision(String apiRevisionId, List<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision> deployedAPIRevisionList) throws org.wso2.carbon.apimgt.api.APIManagementException
Adds an deployed API revision to the database- Parameters:
deployedAPIRevisionList
- content of the revision deployment mapping objects- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
getAPIRevisionDeploymentByNameAndRevsionID
public org.wso2.carbon.apimgt.api.model.APIRevisionDeployment getAPIRevisionDeploymentByNameAndRevsionID(String name, String revisionId) throws org.wso2.carbon.apimgt.api.APIManagementException
Get APIRevisionDeployment details by providing deployment name and revision uuid- Returns:
- APIRevisionDeployment object
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision details
-
getAPIRevisionDeploymentByRevisionUUID
public List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> getAPIRevisionDeploymentByRevisionUUID(String revisionUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get APIRevisionDeployment details by providing revision uuid- Returns:
- List
object - Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision deployment mapping details
-
getAPIRevisionDeploymentByApiUUID
public List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> getAPIRevisionDeploymentByApiUUID(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get APIRevisionDeployment details by providing API uuid- Returns:
- List
object - Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision deployment mapping details
-
getAPIRevisionDeploymentsByApiUUID
public List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> getAPIRevisionDeploymentsByApiUUID(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get APIRevisionDeployment details by providing ApiUUID- Returns:
- List
object - Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision deployment mapping details
-
getDeployedAPIRevisionByApiUUID
public List<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision> getDeployedAPIRevisionByApiUUID(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get DeployedAPIRevision details by providing ApiUUID- Returns:
- List
object - Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs while retrieving revision deployment mapping details
-
removeAPIRevisionDeployment
public void removeAPIRevisionDeployment(String apiRevisionId, List<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> apiRevisionDeployments) throws org.wso2.carbon.apimgt.api.APIManagementException
Remove an API revision Deployment mapping record to the database- Parameters:
apiRevisionId
- uuid of the revisionapiRevisionDeployments
- content of the revision deployment mapping objects- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
removeAPIRevisionDeployment
public void removeAPIRevisionDeployment(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> deployments) throws org.wso2.carbon.apimgt.api.APIManagementException
Remove an API revision Deployment mapping record to the database- Parameters:
apiUUID
- uuid of the revisiondeployments
- content of the revision deployment mapping objects- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
removeDeployedAPIRevision
public void removeDeployedAPIRevision(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision> deployments) throws org.wso2.carbon.apimgt.api.APIManagementException
Remove an deployed API revision in the database- Parameters:
apiUUID
- uuid of the revisiondeployments
- content of the revision deployment mapping objects- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
setUnDeployedAPIRevision
public void setUnDeployedAPIRevision(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.DeployedAPIRevision> deployments) throws org.wso2.carbon.apimgt.api.APIManagementException
Set the deployed time of the un-deployed revision entry as NULL- Parameters:
apiUUID
- uuid of the revisiondeployments
- content of the revision deployment mapping objects- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
updateAPIRevisionDeployment
public void updateAPIRevisionDeployment(String apiUUID, Set<org.wso2.carbon.apimgt.api.model.APIRevisionDeployment> deployments) throws org.wso2.carbon.apimgt.api.APIManagementException
Update API revision Deployment mapping record- Parameters:
apiUUID
- API UUIDdeployments
- content of the revision deployment mapping objects- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
restoreAPIRevision
public void restoreAPIRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision) throws org.wso2.carbon.apimgt.api.APIManagementException
Restore API revision database records as the Current API of an API- Parameters:
apiRevision
- content of the revision- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when restoring an API revision
-
deleteAPIRevision
public void deleteAPIRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision) throws org.wso2.carbon.apimgt.api.APIManagementException
Restore API revision database records as the Current API of an API- Parameters:
apiRevision
- content of the revision- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when restoring an API revision
-
addAPIProductRevision
public void addAPIProductRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision) throws org.wso2.carbon.apimgt.api.APIManagementException
Adds an API Product revision record to the database- Parameters:
apiRevision
- content of the revision- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when adding a new API revision
-
restoreAPIProductRevision
public void restoreAPIProductRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision) throws org.wso2.carbon.apimgt.api.APIManagementException
Restore API Product revision database records as the Current API Product of an API Product- Parameters:
apiRevision
- content of the revision- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when restoring an API revision
-
deleteAPIProductRevision
public void deleteAPIProductRevision(org.wso2.carbon.apimgt.api.model.APIRevision apiRevision) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete API Product revision database records- Parameters:
apiRevision
- content of the revision- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if an error occurs when restoring an API revision
-
setServiceStatusInfoToAPI
public void setServiceStatusInfoToAPI(org.wso2.carbon.apimgt.api.model.API api, int apiId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve Service Info and Set it to API- Parameters:
api
- API ObjectapiId
- Internal Unique API Id- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
retrieveServiceKeyByApiId
public String retrieveServiceKeyByApiId(int apiId, int tenantId) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve the Unique Identifier of the Service used in API- Parameters:
apiId
- Unique Identifier of APItenantId
- Tenant ID- Returns:
- Service Key
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getLightweightApplicationByConsumerKey
public org.wso2.carbon.apimgt.api.model.ApplicationInfo getLightweightApplicationByConsumerKey(String consumerKey) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getSubscribedAPIsByApplication
public Set<org.wso2.carbon.apimgt.api.model.SubscribedAPI> getSubscribedAPIsByApplication(org.wso2.carbon.apimgt.api.model.Application application) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getPaginatedSubscribedAPIsByApplication
public Set<org.wso2.carbon.apimgt.api.model.SubscribedAPI> getPaginatedSubscribedAPIsByApplication(org.wso2.carbon.apimgt.api.model.Application application, Integer offset, Integer limit, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addOperationPolicyMapping
public void addOperationPolicyMapping(Set<org.wso2.carbon.apimgt.api.model.URITemplate> uriTemplates) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
hasApplicationPolicyAttachedToApplication
public boolean hasApplicationPolicyAttachedToApplication(String policyName, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
hasSubscriptionPolicyAttached
public boolean hasSubscriptionPolicyAttached(String policyName, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
hasAPIPolicyAttached
public boolean hasAPIPolicyAttached(String policyName, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addCommonOperationPolicy
public String addCommonOperationPolicy(org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData) throws org.wso2.carbon.apimgt.api.APIManagementException
Add a new common operation policy to the database. This will first add the operation policy content to the AM_OPERATION_POLICY table and another entry to AM_COMMON_OPERATION_POLICY table.- Parameters:
policyData
- Operation policy data.- Returns:
- UUID of the newly created shared policy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
addAPISpecificOperationPolicy
public String addAPISpecificOperationPolicy(String apiUUID, String revisionUUID, org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData) throws org.wso2.carbon.apimgt.api.APIManagementException
Add a new API specific operation policy to the database- Parameters:
apiUUID
- Unique Identifier of APIrevisionUUID
- Unique Identifier of API revisionpolicyData
- Unique Identifier of API- Returns:
- UUID of the newly created shared policy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
updateOperationPolicy
public void updateOperationPolicy(String policyId, org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData) throws org.wso2.carbon.apimgt.api.APIManagementException
Update an existing operation policy- Parameters:
policyId
- Shared policy UUIDpolicyData
- Updated policy definition- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
deleteOperationPolicyByPolicyId
public void deleteOperationPolicyByPolicyId(String policyId) throws org.wso2.carbon.apimgt.api.APIManagementException
Delete an operation policy by providing the policy UUID- Parameters:
policyId
- UUID of the policy to be deleted- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getURITemplatesWithOperationPolicies
public Set<org.wso2.carbon.apimgt.api.model.URITemplate> getURITemplatesWithOperationPolicies(String apiUUID) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the set of URI templates that have Operation policies- Parameters:
apiUUID
- Unique Identifier of API- Returns:
- URITemplate set
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
cloneAPISpecificPoliciesForVersioning
public boolean cloneAPISpecificPoliciesForVersioning(String previousAPIVersionUUID, String newAPIVersionUUID, String organization, List<org.wso2.carbon.apimgt.api.dto.ClonePolicyMetadataDTO> clonePolicyMetadata) throws org.wso2.carbon.apimgt.api.APIManagementException
A clone of API specific will be taken and cloned when a new version is created.- Parameters:
previousAPIVersionUUID
- The UUID of the original APInewAPIVersionUUID
- The UUID of the newly created API versionorganization
- The API uuid which the cloned policy will be assigned to- Returns:
- cloned policyID
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
SQLException
-
getAPISpecificOperationPolicyByPolicyID
public org.wso2.carbon.apimgt.api.model.OperationPolicyData getAPISpecificOperationPolicyByPolicyID(String policyId, String apiUUID, String organization, boolean isWithPolicyDefinition) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the API specific operation policy from the policy ID if exists. This method will take the intersection of AM_OPERATION_POLICY table and AM_API_OPERATION_POLICY table from API UUID. Policy id might be available, but if it is not referenced in the APIS table, this will return null. The returned policy data can be either an API only policy, cloned common policy to API or a revisioned API specific policy- Parameters:
policyId
- Policy UUIDapiUUID
- UUID of the APIorganization
- Organization nameisWithPolicyDefinition
- Include the policy definition to the output or not- Returns:
- operation policy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
populatePolicyDefinitions
public void populatePolicyDefinitions(Connection connection, String policyId, org.wso2.carbon.apimgt.api.model.OperationPolicyData policyData) throws SQLException
- Throws:
SQLException
-
getCommonOperationPolicyByPolicyID
public org.wso2.carbon.apimgt.api.model.OperationPolicyData getCommonOperationPolicyByPolicyID(String policyId, String organization, boolean isWithPolicyDefinition) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the common operation policy from the policy ID if exists. This method will take the intersection of AM_OPERATION_POLICY table and AM_COMMON_OPERATION_POLICY table. Policy id might be available, but if it is not referenced in the common policies table, this will return null.- Parameters:
policyId
- Policy UUIDorganization
- Organization nameisWithPolicyDefinition
- Include the policy definition to the output or not- Returns:
- operation policy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getCommonOperationPolicyByPolicyName
public org.wso2.carbon.apimgt.api.model.OperationPolicyData getCommonOperationPolicyByPolicyName(String policyName, String policyVersion, String organization, boolean isWithPolicyDefinition) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve a common operation policy by providing the policy name and organization- Parameters:
policyName
- Policy namepolicyVersion
- Policy versionorganization
- Organization nameisWithPolicyDefinition
- Include the policy definition to the output or not- Returns:
- operation policy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getAPISpecificOperationPolicyByPolicyName
public org.wso2.carbon.apimgt.api.model.OperationPolicyData getAPISpecificOperationPolicyByPolicyName(String policyName, String policyVersion, String apiUUID, String revisionUUID, String organization, boolean isWithPolicyDefinition) throws org.wso2.carbon.apimgt.api.APIManagementException
Retrieve an API Specific operation policy by providing the policy name. In order to narrow down the specific policy this needs policy name, apiUUID, api revision UUID (if exists) and organization. If revision UUID is not provided, that means the policy is not a revisioned policy.- Parameters:
policyName
- Policy nameapiUUID
- UUID of APIrevisionUUID
- UUID of API revisionorganization
- Organization nameisWithPolicyDefinition
- Include the policy definition to the output or not- Returns:
- operation policy
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
getLightWeightVersionOfAllOperationPolicies
public List<org.wso2.carbon.apimgt.api.model.OperationPolicyData> getLightWeightVersionOfAllOperationPolicies(String apiUUID, String organization) throws org.wso2.carbon.apimgt.api.APIManagementException
Get the list of all operation policies. If the API UUID is provided, this will return all the operation policies for that API. If not, it will return the common operation policies which are not bound to any API. This list will include policy specification of each policy and policy ID. It will not contain the policy definition as it is not useful for the operation.- Parameters:
apiUUID
- UUID of the API if exists. Null for common operation policiesorganization
- Organization name- Returns:
- List of Operation Policies
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
-
-