org.wso2.carbon.rest.api.service
Class RestApiAdmin

java.lang.Object
  extended by org.wso2.carbon.core.AbstractAdmin
      extended by org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
          extended by org.wso2.carbon.rest.api.service.RestApiAdmin

public class RestApiAdmin
extends org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin


Field Summary
 
Fields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext
 
Constructor Summary
RestApiAdmin()
           
 
Method Summary
 boolean addApi(APIData apiData)
           
 boolean addApiForTenant(String apiData, String tenantDomain)
          Set the tenant domain when a publisher publishes his API in MT mode.
 boolean addApiFromString(String apiData)
           
 void deleteAllApi()
          Delete All API in the synapse configuration
 boolean deleteApi(String apiName)
           
 boolean deleteApiForTenant(String apiName, String tenantDomain)
          Set the tenant domain when a publisher deletes his API in MT mode.
 void deleteSelectedApi(String[] apiNames)
          Delete Selected API
 APIData getApiByName(String apiName)
           
 int getAPICount()
           
 APIData getApiForTenant(String apiName, String tenantDomain)
          Set the tenant domain when a publisher tries to retrieve API his API in MT mode.
 String[] getApiNames()
           
 APIData[] getAPIsForListing(int pageNumber, int itemsPerPage)
           
 String getApiSource(APIData apiData)
           
protected  org.apache.axis2.engine.AxisConfiguration getAxisConfig()
          Override the AbstarctAdmin.java's getAxisConfig() to create the CarbonContext from ThreadLoaclContext.
protected  org.apache.axis2.context.ConfigurationContext getConfigContext()
           
 String getResourceSource(ResourceData resourceData)
           
 String[] getSequences()
           
 String getServerContext()
           
protected  org.apache.synapse.config.SynapseConfiguration getSynapseConfiguration()
          Override the parent's getSynapseconfig() method to retrieve the Synapse configuration from the relevant axis configuration
 boolean updateApi(String apiName, APIData apiData)
           
 boolean updateApiForTenant(String apiName, String apiData, String tenantDomain)
          Set the tenant domain when a publisher updates his API in MT mode.
 boolean updateApiFromString(String apiName, String apiData)
           
 
Methods inherited from class org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
getLock, getMediationPersistenceManager, getServerConfigurationInformation, getServerContextInformation, getSynapseEnvironment, getSynapseEnvironment, lockSynapseConfiguration, unlockSynapseConfiguration
 
Methods inherited from class org.wso2.carbon.core.AbstractAdmin
getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestApiAdmin

public RestApiAdmin()
Method Detail

addApi

public boolean addApi(APIData apiData)
               throws APIException
Throws:
APIException

addApiFromString

public boolean addApiFromString(String apiData)
                         throws APIException
Throws:
APIException

addApiForTenant

public boolean addApiForTenant(String apiData,
                               String tenantDomain)
                        throws APIException
Set the tenant domain when a publisher publishes his API in MT mode. When publisher publishes the API, we login the gateway as supretenant. But we need to publish the API in the particular tenant domain.

Parameters:
apiData -
tenantDomain -
Returns:
Throws:
APIException

updateApi

public boolean updateApi(String apiName,
                         APIData apiData)
                  throws APIException
Throws:
APIException

updateApiFromString

public boolean updateApiFromString(String apiName,
                                   String apiData)
                            throws APIException
Throws:
APIException

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 supretenant. But we need to update the API,which is in the particular tenant domain.

Parameters:
apiName -
apiData -
Returns:
Throws:
APIException

deleteApi

public boolean deleteApi(String apiName)
                  throws APIException
Throws:
APIException

deleteSelectedApi

public void deleteSelectedApi(String[] apiNames)
                       throws APIException
Delete Selected API

Parameters:
apiNames -
Throws:
APIException

deleteAllApi

public void deleteAllApi()
                  throws APIException
Delete All API in the synapse configuration

Throws:
APIException

deleteApiForTenant

public boolean deleteApiForTenant(String apiName,
                                  String tenantDomain)
                           throws APIException
Set the tenant domain when a publisher deletes his API in MT mode. When publisher deletes the API, we login the gateway as supretenant. But we need to delete the API,which is in the particular tenant domain.

Parameters:
apiName -
tenantDomain -
Returns:
Throws:
APIException

getAPIsForListing

public APIData[] getAPIsForListing(int pageNumber,
                                   int itemsPerPage)

getAPICount

public int getAPICount()

getServerContext

public String getServerContext()
                        throws APIException
Throws:
APIException

getApiNames

public String[] getApiNames()

getApiByName

public APIData getApiByName(String apiName)

getApiForTenant

public APIData getApiForTenant(String apiName,
                               String tenantDomain)
                        throws APIException
Set 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 supretenant. But we need to get the API,which is in the particular tenant domain.

Parameters:
apiName -
tenantDomain -
Returns:
Throws:
APIException

getSequences

public String[] getSequences()

getApiSource

public String getApiSource(APIData apiData)

getResourceSource

public String getResourceSource(ResourceData resourceData)

getSynapseConfiguration

protected org.apache.synapse.config.SynapseConfiguration getSynapseConfiguration()
Override the parent's getSynapseconfig() method to retrieve the Synapse configuration from the relevant axis configuration

Overrides:
getSynapseConfiguration in class org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
Returns:
extracted SynapseConfiguration from the relevant AxisConfiguration

getAxisConfig

protected org.apache.axis2.engine.AxisConfiguration getAxisConfig()
Override the AbstarctAdmin.java's getAxisConfig() to create the CarbonContext from ThreadLoaclContext. We do this to support, publishing APIs as a supertenant but want to deploy that in tenant space. (This model is needed for APIManager)

Overrides:
getAxisConfig in class org.wso2.carbon.core.AbstractAdmin

getConfigContext

protected org.apache.axis2.context.ConfigurationContext getConfigContext()
Overrides:
getConfigContext in class org.wso2.carbon.core.AbstractAdmin


Copyright © 2015 WSO2. All rights reserved.