public final class AppManagerUtil extends Object
| Constructor and Description |
|---|
AppManagerUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addNewRole(String roleName,
org.wso2.carbon.user.api.Permission[] permissions,
org.wso2.carbon.user.api.UserRealm userRealm)
Add permissions to the appmgt/applicationdata collection for given role.
|
static void |
applyRolePermissionToCollection(String roleName,
org.wso2.carbon.user.api.UserRealm userRealm)
Add permissions to the appmgt/applicationdata collection for given role.
|
static org.apache.axiom.om.OMElement |
buildOMElement(InputStream inputStream)
Build OMElement from inputstream
|
static boolean |
checkAccessTokenPartitioningEnabled() |
static void |
checkPermission(String username,
String permission)
Checks whether the specified user has the specified permission.
|
static boolean |
checkPermissionQuietly(String username,
String permission)
Checks whether the specified user has the specified permission without
throwing
any exceptions.
|
static boolean |
checkPermissionWrapper(String username,
String permission)
This is written as a wrapper to for the checkPermission Method
returns a boolean indicating if user is authorized or not
|
static boolean |
checkUserNameAssertionEnabled() |
static void |
copyResourcePermissions(String username,
String sourceArtifactPath,
String targetArtifactPath) |
static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact |
createAPIArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.WebApp api)
Create Governance artifact from given attributes
|
static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact |
createDocArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.APIIdentifier apiId,
org.wso2.carbon.appmgt.api.model.Documentation documentation)
This utility method used to create documentation artifact content
|
static String |
createEndpoint(String endpointUrl,
org.wso2.carbon.registry.core.Registry registry)
Create an Endpoint
|
static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact |
createMobileAppArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.MobileApp mobileApp)
Create Governance artifact from given attributes
|
static void |
createMobileAppsDirectory()
This method creates mobileapps directory if it does not exists
|
static void |
createSelfSignUpRoles(int tenantId)
Create self signup role under given tenant domain
|
static void |
createSubscriberRole(String roleName,
int tenantId,
org.wso2.carbon.user.api.Permission[] subscriberPermissions)
Create Subscriber user role
|
static String |
createSwaggerJSONContent(org.wso2.carbon.appmgt.api.model.WebApp api)
Create WebApp Definition in JSON
|
static void |
createTenantConfInRegistry(int tenantID)
Creates the tenant specific master configuration file in the tenant registry.
|
static void |
createTenantSpecificConfigurationFilesInRegistry(int tenantID)
Deprecated.
Use the method 'createTenantConfInRegistry' instead of this method.
TODO : Merge the configuration files created in this method, with the unified tenant configuration file. See the method "createTenantConfInRegistry()"
|
static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact |
createWebAppArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.WebApp webApp)
Generate WebApp GenericArtifact content from Webapp
|
static String |
createWSDL(org.wso2.carbon.registry.core.Registry registry,
org.wso2.carbon.appmgt.api.model.WebApp api)
Crate an WSDL from given wsdl url.
|
static String |
decryptToken(String token) |
static String |
encryptToken(String token) |
static String |
getAccessTokenStoreTableFromAccessToken(String apiKey) |
static String |
getAccessTokenStoreTableFromUserId(String userId) |
static Set<String> |
getActiveTenantDomains()
Get active tenant domains
|
static List<org.wso2.carbon.user.api.Tenant> |
getAllTenantsWithSuperTenant() |
static org.wso2.carbon.appmgt.api.model.WebApp |
getAPI(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact) |
static org.wso2.carbon.appmgt.api.model.WebApp |
getAPI(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact,
org.wso2.carbon.registry.core.Registry registry)
This method used to get WebApp from governance artifact
|
static org.wso2.carbon.appmgt.api.model.WebApp |
getAPI(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact,
org.wso2.carbon.registry.core.Registry registry,
org.wso2.carbon.appmgt.api.model.APIIdentifier oldId)
This method used to get WebApp from governance artifact specific to
copyAPI
|
static javax.cache.Cache |
getAPIContextCache() |
static String |
getAPIDefinitionFilePath(String apiName,
String apiVersion) |
static String |
getAPIDocContentPath(org.wso2.carbon.appmgt.api.model.APIIdentifier apiId,
String documentationName)
Utility method to get documentation content file path
|
static String |
getAPIDocPath(org.wso2.carbon.appmgt.api.model.APIIdentifier apiId)
Utility method to get documentation path
|
static String |
getAPIPath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier)
Utility method to get api path from APIIdentifier
|
static String |
getAPIProviderPath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier)
Utility method to get WebApp provider path
|
static org.wso2.carbon.appmgt.api.model.APIStatus |
getApiStatus(String status) |
static int |
getApplicationId(String appName,
String userId) |
static org.wso2.carbon.governance.api.generic.GenericArtifactManager |
getArtifactManager(org.wso2.carbon.registry.core.Registry registry,
String key)
this method used to initialized the ArtifactManager
|
static String[] |
getAvailableKeyStoreTables() |
static Map<String,String> |
getAvailableUserStoreDomainMappings() |
static String[] |
getCredentialsFromBasicAuthHeader(String basicAuthHeader)
This get the basic authentication header as a input and decode it and gives username, password in return
|
static org.apache.axiom.om.OMElement |
getCustomSequence(String sequenceName,
int tenantId,
String direction)
Get stored custom sequences from governanceSystem registry
|
static org.wso2.carbon.appmgt.api.model.SSOProvider |
getDefaultSSOProvider() |
static Map<String,Object> |
getDocument(String userName,
String resourceUrl,
String tenantDomain)
This method used to retrive the Uploaded Documents from publisher
|
static org.wso2.carbon.appmgt.api.model.Documentation |
getDocumentation(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact)
Create the Documentation from artifact
|
static org.wso2.carbon.appmgt.api.model.Documentation |
getDocumentation(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
String docCreatorName)
Create the Documentation from artifact
|
static String |
getDocumentationFilePath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier,
String fileName)
Utility method to generate the path for a file.
|
static Set<org.wso2.carbon.appmgt.api.model.AppStore> |
getExternalAPIStores() |
static Set<org.wso2.carbon.appmgt.api.model.AppStore> |
getExternalAPIStores(Set<org.wso2.carbon.appmgt.api.model.AppStore> inputStores) |
static org.wso2.carbon.appmgt.api.model.AppStore |
getExternalAppStore(String appStoreName,
int tenantId)
Get the APP store from registry configuration for given store name
|
static org.wso2.carbon.appmgt.api.model.ExternalAppStorePublisher |
getExternalStorePublisher(String className) |
static Set<org.wso2.carbon.appmgt.api.model.AppStore> |
getExternalStores(int tenantId)
Returns a set of External APP Stores as defined in the underlying governance
registry.
|
static String |
getGatewayendpoint()
Read the GateWay Endpoint from the APIConfiguration.
|
static String |
getGatewayendpoints()
Read the GateWay Endpoints (both http and https) from the
APIConfiguration.
|
static String |
getGatewayHTTPSURL()
Returns the HTTPS URL of the App Gateway
|
static String |
getGatewayHTTPURL()
Returns the HTTP URL of the App Gateway
|
static org.wso2.carbon.appmgt.api.model.WebApp |
getGenericApp(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact) |
static org.wso2.carbon.appmgt.api.model.WebApp |
getGenericApp(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact,
org.wso2.carbon.registry.core.Registry registry)
This method used to get WebApp from governance artifact
|
static String |
getGovernanceRegistryResourceContent(String tenantDomain,
String registryLocation) |
static org.apache.http.client.HttpClient |
getHttpClient(int port,
String protocol)
Return a http client instance
|
static org.apache.http.client.HttpClient |
getHttpClient(String url)
Return a http client instance.
|
static String |
getIconPath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier)
Utility method for creating storage path for an icon.
|
static String[] |
getListOfRoles(String username)
Retrieves the role list of a user
|
static String[] |
getListOfRolesQuietly(String username)
Retrieves the list of user roles without throwing any exceptions.
|
static org.wso2.carbon.core.commons.stub.loggeduserinfo.LoggedUserInfo |
getLoggedInUserInfo(String cookie,
String serviceUrl)
Gets the information of the logged in User.
|
static org.wso2.carbon.appmgt.api.model.MobileApp |
getMobileApp(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact)
Generate MobileApp Data Model from a given mobileapp GenericArtifact
|
static String |
getMountedPath(org.wso2.carbon.registry.core.config.RegistryContext registryContext,
String path)
This method will return mounted path of the path if the path
is mounted.
|
static org.wso2.carbon.appmgt.api.model.Provider |
getProvider(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact)
This method used to get Provider from provider artifact
|
static String |
getRegistryResourceHTTPPermlink(String path)
This is to get the registry resource's HTTP permlink path.
|
static String[] |
getRoleNames(String username)
Retrieves the role list of system
|
static String |
getSequenceExtensionName(org.wso2.carbon.appmgt.api.model.WebApp api)
Return the sequence extension name.
|
static int |
getTenantId(String userName)
Helper method to get tenantId from userName
|
static String |
getTierDisplayName(int tenantId,
String tierName)
Returns the tier display name for a particular tier
|
static Map<String,org.wso2.carbon.appmgt.api.model.Tier> |
getTiers()
Returns a map of WebApp availability tiers as defined in the underlying
governance
registry.
|
static Map<String,org.wso2.carbon.appmgt.api.model.Tier> |
getTiers(int tenantId)
Returns a map of WebApp availability tiers of the tenant as defined in
the underlying governance
registry.
|
static String |
getUserIdFromAccessToken(String apiKey) |
static String |
getXACMLPolicyTemplate() |
static void |
handleException(String msg,
Throwable t) |
static boolean |
isAPIGatewayKeyCacheEnabled() |
static boolean |
isAPIManagementEnabled() |
static boolean |
isAPIsPublishToExternalAPIStores() |
static boolean |
isEnterpriseSubscriptionEnable() |
static boolean |
isLoadAPIContextsAtStartup() |
static boolean |
isLoggedInUserAuthorizedToRevokeToken(String loggedInUser,
String authorizedUser)
In multi tenant environment, publishers should allow only to revoke the
tokens generated within his domain.
|
static boolean |
isProductionEndpointsExists(org.wso2.carbon.appmgt.api.model.WebApp api) |
static boolean |
isSandboxEndpointsExists(org.wso2.carbon.appmgt.api.model.WebApp api) |
static boolean |
isSelfSubscriptionEnable() |
static boolean |
isTenantActive(String tenantDomain)
Check whether given tenant is active or not.
|
static boolean |
isUIActivityDASPublishEnabled()
Check whether UIActivityPublishEnabled is set or not.
|
static boolean |
isUserAuthorized(String username,
String resourcePath) |
static void |
loadloadTenantAPIRXT(String tenant,
int tenantID)
Load the WebApp RXT to the registry for tenants
|
static void |
loadTenantAPIPolicy(String tenant,
int tenantID)
Load the throttling policy to the registry for tenants
|
static void |
loadTenantExternalStoreConfig(int tenantID)
Load the External APP Store Configuration to the super user registry, in the server startup
|
static void |
loadTenantRegistry(int tenantId) |
static void |
loadTenantSelfSignUpConfigurations(int tenantId)
Load tenant sign-up configuration into registry
|
static void |
loadTenantWorkFlowExtensions(int tenantID)
Load Workflow Configurations
|
static String |
makeSecondaryUSNameDBFriendly(String appProvider)
In the registry APP is added in the form of WSO2.com:appName
When it comes to the workflow reference saved in the APPM DB ':' charrachter
is used as a data separator, to avoid the confusion the value read from the UI/Registry
which is in this case a ':' is replaced with a DB compatible '/'
|
static String |
makeSecondaryUSNameRegFriendly(String provider)
In the registry APP is added in the form of WSO2.com:appName
When it comes to the workflow reference saved in the APPM DB ':' charrachter
is used as a data separator, to avoid the confusion the value read from the DB
which is in this case a '/' is replaced with a registry compatible ':'
|
static String |
prependTenantPrefix(String postfixUrl,
String username)
Prepends the Tenant Prefix to a registry path.
|
static String |
prependWebContextRoot(String postfixUrl)
Prepends the webcontextroot to a registry path.
|
static String |
removeAnySymbolFromUriTempate(String uriTemplate) |
static String |
replaceEmailDomain(String input)
When an input is having '@',replace it with '-AT-' [This is required to
persist WebApp data in registry,as registry paths don't allow '@' sign.]
|
static String |
replaceEmailDomainBack(String input)
When an input is having '-AT-',replace it with @ [This is required to
persist WebApp data between registry and database]
|
static String |
resolvePath(String baseDirPath,
String fileName)
Resolve file path avoiding Potential Path Traversals
|
static String |
setDomainNameToUppercase(String username)
Converting the user store domain name to uppercase.
|
static void |
setFilePermission(String filePath)
Sets permission for uploaded file resource.
|
static void |
setResourcePermissions(String username,
String visibility,
String[] roles,
String artifactPath)
This function is to set resource permissions based on its visibility
|
void |
setupSelfRegistration(AppManagerConfiguration config,
int tenantId) |
static void |
validateStoreName(Set<org.wso2.carbon.appmgt.api.model.AppStore> appStores)
Check whether given app stores have store name(id) and display name.
|
static void |
writeDefinedSequencesToTenantRegistry(int tenantID) |
public static org.wso2.carbon.appmgt.api.model.WebApp getAPI(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact,
org.wso2.carbon.registry.core.Registry registry)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - WebApp artifactregistry - Registryorg.wso2.carbon.appmgt.api.AppManagementException - if failed to get WebApp from artifactpublic static org.wso2.carbon.appmgt.api.model.MobileApp getMobileApp(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - 'mobileapp' GenericArtifactorg.wso2.carbon.appmgt.api.AppManagementExceptionpublic static org.wso2.carbon.appmgt.api.model.WebApp getGenericApp(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact)
throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static org.wso2.carbon.appmgt.api.model.WebApp getGenericApp(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact,
org.wso2.carbon.registry.core.Registry registry)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - WebApp artifactregistry - Registryorg.wso2.carbon.appmgt.api.AppManagementException - if failed to get WebApp from artifactpublic static org.wso2.carbon.appmgt.api.model.WebApp getAPI(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact)
throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static org.wso2.carbon.appmgt.api.model.Provider getProvider(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - provider artifactorg.wso2.carbon.appmgt.api.AppManagementException - if failed to get Provider from provider artifact.public static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact createAPIArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.WebApp api)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - initial governance artifactapi - WebApp object with the attributes valueorg.wso2.carbon.appmgt.api.AppManagementException - if failed to create WebApppublic static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact createMobileAppArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.MobileApp mobileApp)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - initial governance artifactmobileApp - WebApp object with the attributes valueorg.wso2.carbon.appmgt.api.AppManagementException - if failed to create WebApppublic static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact createWebAppArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.WebApp webApp)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - Webapp GenericArtifactwebApp - WebApporg.wso2.carbon.appmgt.api.AppManagementExceptionpublic static Map<String,Object> getDocument(String userName, String resourceUrl, String tenantDomain) throws org.wso2.carbon.appmgt.api.AppManagementException
userName - logged in usernameresourceUrl - resource to be downloadedtenantDomain - loggedUserTenantDomainorg.wso2.carbon.appmgt.api.AppManagementExceptionpublic static org.wso2.carbon.appmgt.api.model.Documentation getDocumentation(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - Documentation artifactorg.wso2.carbon.appmgt.api.AppManagementException - if failed to create Documentation from artifactpublic static org.wso2.carbon.appmgt.api.model.Documentation getDocumentation(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
String docCreatorName)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - Documentation artifactorg.wso2.carbon.appmgt.api.AppManagementException - if failed to create Documentation from artifactpublic static org.wso2.carbon.appmgt.api.model.APIStatus getApiStatus(String status) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String prependTenantPrefix(String postfixUrl, String username)
postfixUrl - path to be prepended.public static String prependWebContextRoot(String postfixUrl)
postfixUrl - path to be prepended.public static String getIconPath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier)
identifier - APIIdentifierpublic static String getDocumentationFilePath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier, String fileName)
identifier - APIIdentifierpublic static String getAPIDefinitionFilePath(String apiName, String apiVersion)
public static String getAPIPath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier)
identifier - APIIdentifierpublic static String makeSecondaryUSNameRegFriendly(String provider)
provider - public static String makeSecondaryUSNameDBFriendly(String appProvider)
appProvider - public static String getAPIProviderPath(org.wso2.carbon.appmgt.api.model.APIIdentifier identifier)
identifier - APIIdentifierpublic static String getAPIDocPath(org.wso2.carbon.appmgt.api.model.APIIdentifier apiId)
apiId - APIIdentifierpublic static String getAPIDocContentPath(org.wso2.carbon.appmgt.api.model.APIIdentifier apiId, String documentationName)
apiId - APIIdentifierdocumentationName - Stringpublic static org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact createDocArtifactContent(org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact artifact,
org.wso2.carbon.appmgt.api.model.APIIdentifier apiId,
org.wso2.carbon.appmgt.api.model.Documentation documentation)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - GovernanceArtifactapiId - APIIdentifierdocumentation - Documentationorg.wso2.carbon.appmgt.api.AppManagementException - if failed to get GovernanceArtifact from Documentationpublic static org.wso2.carbon.governance.api.generic.GenericArtifactManager getArtifactManager(org.wso2.carbon.registry.core.Registry registry,
String key)
throws org.wso2.carbon.appmgt.api.AppManagementException
registry - Registrykey - , key name of the keyorg.wso2.carbon.appmgt.api.AppManagementException - if failed to initialized GenericArtifactManagerpublic static String createWSDL(org.wso2.carbon.registry.core.Registry registry, org.wso2.carbon.appmgt.api.model.WebApp api) throws org.wso2.carbon.registry.core.exceptions.RegistryException, org.wso2.carbon.appmgt.api.AppManagementException
registry - - Governance Registry space to save the WSDLapi - -WebApp instanceorg.wso2.carbon.appmgt.api.AppManagementException - If an error occurs while adding the WSDLorg.wso2.carbon.registry.core.exceptions.RegistryExceptionpublic static String getGatewayendpoint()
String - Gateway URLpublic static String getGatewayendpoints()
String - Gateway URLpublic static String getGatewayHTTPURL()
public static String getGatewayHTTPSURL()
public static String createEndpoint(String endpointUrl, org.wso2.carbon.registry.core.Registry registry) throws org.wso2.carbon.appmgt.api.AppManagementException
endpointUrl - Endpoint urlregistry - Registry space to save the endpointorg.wso2.carbon.appmgt.api.AppManagementException - If an error occurs while adding the endpointpublic static Map<String,org.wso2.carbon.appmgt.api.model.Tier> getTiers() throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementException - if an error occurs when loading tiers from the registrypublic static Map<String,org.wso2.carbon.appmgt.api.model.Tier> getTiers(int tenantId) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementException - if an error occurs when loading tiers from the registrypublic static String getTierDisplayName(int tenantId, String tierName) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementException - if an error occurs when loading tiers from the registrypublic static boolean checkPermissionWrapper(String username, String permission)
username - permission - public static void checkPermission(String username, String permission) throws org.wso2.carbon.appmgt.api.AppManagementException
username - A usernamepermission - A valid Carbon permissionorg.wso2.carbon.appmgt.api.AppManagementException - If the user does not have the specified permission or if an
error occurspublic static boolean checkPermissionQuietly(String username, String permission)
username - A usernamepermission - A valid Carbon permissionpublic static org.wso2.carbon.core.commons.stub.loggeduserinfo.LoggedUserInfo getLoggedInUserInfo(String cookie, String serviceUrl) throws RemoteException, org.wso2.carbon.core.commons.stub.loggeduserinfo.ExceptionException
cookie - Cookie of the previously logged in session.serviceUrl - Url of the authentication service.RemoteExceptionorg.wso2.carbon.core.commons.stub.loggeduserinfo.ExceptionExceptionpublic static String[] getListOfRoles(String username) throws org.wso2.carbon.appmgt.api.AppManagementException
username - A usernameorg.wso2.carbon.appmgt.api.AppManagementException - If an error occurspublic static String[] getListOfRolesQuietly(String username)
username - A usernamepublic static void setFilePermission(String filePath) throws org.wso2.carbon.appmgt.api.AppManagementException
filePath - Registry path for the uploaded fileorg.wso2.carbon.appmgt.api.AppManagementExceptionpublic static org.wso2.carbon.appmgt.api.model.WebApp getAPI(org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact artifact,
org.wso2.carbon.registry.core.Registry registry,
org.wso2.carbon.appmgt.api.model.APIIdentifier oldId)
throws org.wso2.carbon.appmgt.api.AppManagementException
artifact - WebApp artifactregistry - Registryorg.wso2.carbon.appmgt.api.AppManagementException - if failed to get WebApp from artifactpublic static boolean checkAccessTokenPartitioningEnabled()
public static boolean checkUserNameAssertionEnabled()
public static String[] getAvailableKeyStoreTables() throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static Map<String,String> getAvailableUserStoreDomainMappings() throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String getAccessTokenStoreTableFromUserId(String userId) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String getAccessTokenStoreTableFromAccessToken(String apiKey) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String replaceEmailDomain(String input)
input - inputStringpublic static String replaceEmailDomainBack(String input)
input - inputStringpublic static void copyResourcePermissions(String username, String sourceArtifactPath, String targetArtifactPath) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void setResourcePermissions(String username, String visibility, String[] roles, String artifactPath) throws org.wso2.carbon.appmgt.api.AppManagementException
visibility - WebApp visibilityroles - Authorized rolesartifactPath - WebApp resource pathorg.wso2.carbon.appmgt.api.AppManagementException - Throwing exceptionpublic static void loadTenantAPIPolicy(String tenant, int tenantID) throws org.wso2.carbon.appmgt.api.AppManagementException
tenant - tenantID - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void loadTenantSelfSignUpConfigurations(int tenantId)
throws org.wso2.carbon.appmgt.api.AppManagementException
tenantId - tenant isorg.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void createSelfSignUpRoles(int tenantId)
throws org.wso2.carbon.appmgt.api.AppManagementException
tenantId - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void createSubscriberRole(String roleName, int tenantId, org.wso2.carbon.user.api.Permission[] subscriberPermissions) throws org.wso2.carbon.appmgt.api.AppManagementException
roleName - tenantId - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void loadTenantWorkFlowExtensions(int tenantID)
throws org.wso2.carbon.appmgt.api.AppManagementException
tenantID - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void addNewRole(String roleName, org.wso2.carbon.user.api.Permission[] permissions, org.wso2.carbon.user.api.UserRealm userRealm) throws org.wso2.carbon.appmgt.api.AppManagementException
roleName - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void applyRolePermissionToCollection(String roleName, org.wso2.carbon.user.api.UserRealm userRealm) throws org.wso2.carbon.appmgt.api.AppManagementException
roleName - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void writeDefinedSequencesToTenantRegistry(int tenantID)
throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void loadloadTenantAPIRXT(String tenant, int tenantID) throws org.wso2.carbon.appmgt.api.AppManagementException
tenant - tenantID - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String setDomainNameToUppercase(String username)
username - Username to be modifiedpublic void setupSelfRegistration(AppManagerConfiguration config, int tenantId) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String removeAnySymbolFromUriTempate(String uriTemplate)
public static List<org.wso2.carbon.user.api.Tenant> getAllTenantsWithSuperTenant() throws org.wso2.carbon.user.api.UserStoreException
org.wso2.carbon.user.api.UserStoreExceptionpublic static boolean isLoggedInUserAuthorizedToRevokeToken(String loggedInUser, String authorizedUser)
loggedInUser - current logged in user to publisherauthorizedUser - access token ownerpublic static int getApplicationId(String appName, String userId) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static boolean isAPIManagementEnabled()
public static boolean isLoadAPIContextsAtStartup()
public static Set<org.wso2.carbon.appmgt.api.model.AppStore> getExternalAPIStores() throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static Set<org.wso2.carbon.appmgt.api.model.AppStore> getExternalAPIStores(Set<org.wso2.carbon.appmgt.api.model.AppStore> inputStores) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static boolean isAPIsPublishToExternalAPIStores()
throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static boolean isAPIGatewayKeyCacheEnabled()
public static javax.cache.Cache getAPIContextCache()
public static Set<String> getActiveTenantDomains() throws org.wso2.carbon.user.api.UserStoreException
org.wso2.carbon.user.api.UserStoreExceptionpublic static boolean isTenantActive(String tenantDomain) throws org.wso2.carbon.user.api.UserStoreException
tenantDomain - Tenant Domainorg.wso2.carbon.user.api.UserStoreExceptionpublic static String[] getRoleNames(String username) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementException - If an error occurspublic static String createSwaggerJSONContent(org.wso2.carbon.appmgt.api.model.WebApp api) throws org.wso2.carbon.appmgt.api.AppManagementException
api - WebApporg.wso2.carbon.appmgt.api.AppManagementException - if failed to generate the content and savepublic static org.apache.axiom.om.OMElement buildOMElement(InputStream inputStream) throws Exception
inputStream - Exceptionpublic static org.apache.axiom.om.OMElement getCustomSequence(String sequenceName, int tenantId, String direction) throws org.wso2.carbon.appmgt.api.AppManagementException
sequenceName - -The sequence to be retrievedtenantId - direction - - Direction indicates in Sequence/outSequence. Values would be
"in" or "out"org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String getSequenceExtensionName(org.wso2.carbon.appmgt.api.model.WebApp api)
api - public static String decryptToken(String token) throws org.wso2.carbon.core.util.CryptoException
token - org.wso2.carbon.core.util.CryptoExceptionpublic static String encryptToken(String token) throws org.wso2.carbon.core.util.CryptoException
token - org.wso2.carbon.core.util.CryptoExceptionpublic static void loadTenantRegistry(int tenantId)
throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String getGovernanceRegistryResourceContent(String tenantDomain, String registryLocation) throws org.wso2.carbon.user.api.UserStoreException, org.wso2.carbon.registry.core.exceptions.RegistryException
org.wso2.carbon.user.api.UserStoreExceptionorg.wso2.carbon.registry.core.exceptions.RegistryExceptionpublic static String getRegistryResourceHTTPPermlink(String path)
path - - Registry resource pathString -HTTP permlinkpublic static boolean isSandboxEndpointsExists(org.wso2.carbon.appmgt.api.model.WebApp api)
public static boolean isProductionEndpointsExists(org.wso2.carbon.appmgt.api.model.WebApp api)
public static String getXACMLPolicyTemplate()
public static void createMobileAppsDirectory()
public static int getTenantId(String userName)
userName - public static boolean isUIActivityDASPublishEnabled()
public static Set<org.wso2.carbon.appmgt.api.model.AppStore> getExternalStores(int tenantId) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementException - if an error occurs when loading app stores from the registrypublic static org.wso2.carbon.appmgt.api.model.AppStore getExternalAppStore(String appStoreName, int tenantId) throws org.wso2.carbon.appmgt.api.AppManagementException
appStoreName - App Store Nameorg.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void validateStoreName(Set<org.wso2.carbon.appmgt.api.model.AppStore> appStores) throws org.wso2.carbon.appmgt.api.AppManagementException
appStores - App Storesorg.wso2.carbon.appmgt.api.AppManagementException - if name or display name is null for any appstorepublic static org.wso2.carbon.appmgt.api.model.ExternalAppStorePublisher getExternalStorePublisher(String className) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void loadTenantExternalStoreConfig(int tenantID)
throws org.wso2.carbon.appmgt.api.AppManagementException
tenantID - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static String getMountedPath(org.wso2.carbon.registry.core.config.RegistryContext registryContext, String path)
registryContext - Registry Context instance which holds path mappingspath - default path of the registrypublic static String[] getCredentialsFromBasicAuthHeader(String basicAuthHeader)
basicAuthHeader - @Deprecated public static void createTenantSpecificConfigurationFilesInRegistry(int tenantID) throws org.wso2.carbon.appmgt.api.AppManagementException
tenantID - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void createTenantConfInRegistry(int tenantID)
throws org.wso2.carbon.appmgt.api.AppManagementException
tenantID - org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static boolean isUserAuthorized(String username, String resourcePath) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static void handleException(String msg, Throwable t) throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static org.apache.http.client.HttpClient getHttpClient(int port,
String protocol)
port - - server portprotocol - - service endpoint protocol http/httpspublic static org.apache.http.client.HttpClient getHttpClient(String url)
url - - server endpointpublic static String resolvePath(String baseDirPath, String fileName)
baseDirPath - base directory file pathfileName - filenamepublic static org.wso2.carbon.appmgt.api.model.SSOProvider getDefaultSSOProvider()
public static boolean isSelfSubscriptionEnable()
throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionpublic static boolean isEnterpriseSubscriptionEnable()
throws org.wso2.carbon.appmgt.api.AppManagementException
org.wso2.carbon.appmgt.api.AppManagementExceptionCopyright © 2017 WSO2. All rights reserved.