Package org.wso2.carbon.rest.api.service
Class RestApiAdminService
java.lang.Object
org.wso2.carbon.rest.api.service.RestApiAdminService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an API with the metadata passed in.booleanaddApiForTenant(String apiData, String tenantDomain) Sets the tenant domain when a publisher publishes his API in MT mode.booleanaddApiForTenant(APIData apiData, String tenantDomain) Adds an API with the metadata passed in.booleanaddApiFromString(String apiData) Adds an API with the configuration passed in, as a string.booleanDeletes an API that carries the name that is passed in.booleandeleteApiForTenant(String apiName, String tenantDomain) Deletes an API that exists in the space of a given tenant, carrying the name passed in.getApiByName(String apiName) Retrieves API configuration mapped into the name passed in.getApiForTenant(String apiName, String tenantDomain) Sets the tenant domain when a publisher tries to retrieve API his API in MT mode.protected LockgetLock()booleanupdateApiForTenant(String apiName, String apiData, String tenantDomain) Set the tenant domain when a publisher updates his API in MT mode.booleanupdateApiFromString(String apiName, String apiData) Updates a given API configuration passed in as a string.
-
Constructor Details
-
RestApiAdminService
public RestApiAdminService()
-
-
Method Details
-
addApi
Adds an API with the metadata passed in.- Parameters:
apiData- Object model of the API to be added- Returns:
- Status of the execution of adding the API
- Throws:
APIException- Is thrown if an anomaly is encountered while adding the given API
-
addApiForTenant
Adds an API with the metadata passed in.- Parameters:
apiData- Object model of the API to be addedtenantDomain- Domain name of the tenant to which the API should be added- Returns:
- Status of the execution of adding the API
- Throws:
APIException- Is thrown if an anomaly is encountered while adding the given API
-
addApiFromString
Adds an API with the configuration passed in, as a string.- Parameters:
apiData- API configuration to be added, as a string- Returns:
- Status of the execution of adding the API
- Throws:
APIException- Is thrown if an anomaly is encountered while adding the given API
-
addApiForTenant
Sets the tenant domain when a publisher publishes his API in MT mode. When publisher publishes the API, we login the gateway as super tenant. But we need to publish the API in the particular tenant domain.- Parameters:
apiData- API configuration as a stringtenantDomain- Target tenant domain- Returns:
- A boolean with the status of adding the API
- Throws:
APIException
-
getApiForTenant
Sets the tenant domain when a publisher tries to retrieve API his API in MT mode. When publisher gets the API, we login the gateway as super tenant. But we need to get the API,which is in the particular tenant domain.- Parameters:
apiName- Name of the API to be retrievedtenantDomain- Target tenant domain- Returns:
- Retrieved API configuration as an object model
- Throws:
APIException
-
getApiByName
Retrieves API configuration mapped into the name passed in.- Parameters:
apiName- Name of the API to be retrieved- Returns:
- An Instance of APIData containing the metadata related to the underlying API configuration
- Throws:
APIException- Is thrown if an error encountered while retrieving the synapse configuration
-
updateApiFromString
Updates a given API configuration passed in as a string.- Parameters:
apiName- Name of the API to be updatedapiData- API configuration to be updated, as a string- Returns:
- Status of the execution of updating the given API configuration
- Throws:
APIException- Is thrown if an anomaly is encountered while updating the given API
-
updateApiForTenant
public boolean updateApiForTenant(String apiName, String apiData, String tenantDomain) throws APIException Set the tenant domain when a publisher updates his API in MT mode. When publisher updates the API, we login the gateway as super tenant. But we need to update the API,which is in the particular tenant domain.- Parameters:
apiName- Name of the APIapiData- API configuration to be updated as a string- Returns:
- A boolean indicating if the update is successful
- Throws:
APIException
-
deleteApi
Deletes an API that carries the name that is passed in.- Parameters:
apiName- Name of the API to be deleted- Returns:
- Status of the execution of deleting the given API
- Throws:
APIException- Is thrown if an anomaly is encountered while deleting the given API
-
deleteApiForTenant
Deletes an API that exists in the space of a given tenant, carrying the name passed in.- Parameters:
apiName- Name of the API to be deletedtenantDomain- Domain name of the tenant which the API belongs to- Returns:
- Status of the execution of deleting the given API
- Throws:
APIException- Is thrown if an anomaly is encountered while deleting the given API
-
getLock
- Throws:
APIException
-