Package org.wso2.carbon.endpoint.service
Class EndpointAdmin
java.lang.Object
org.wso2.carbon.core.AbstractAdmin
org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
org.wso2.carbon.endpoint.service.EndpointAdmin
public class EndpointAdmin
extends org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
Copyright (c) 2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
Field Summary
FieldsFields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDynamicEndpoint(String key, String epConfiguration) Add an endpoint to the Synapse registrybooleanaddEndpoint(String epString) Add an Endpoint described by the given configurationbooleanaddEndpointForTenant(String endpointData, String tenantDomain) Set the tenant domain when a publisher publishes his API in MT mode.voidDeletebooleanRemove a endpoint form the registrybooleandeleteEndpoint(String endpointName) Deletes the endpoint from the SynapseConfigurationbooleandeleteEndpointForTenant(String endpointName, String tenantDomain) Set the tenant domain when a publisher publishes his API in MT mode.voiddeleteSelectedEndpoint(String[] endpointNames) Delete selected endpointsvoiddisableStatistics(String endpointName) Stop collecting statistics for a specified endpointvoidenableStatistics(String endpointName) Enable statistics collection for the specified endpointorg.wso2.carbon.mediation.dependency.mgt.ConfigurationObject[]getDependents(String endpointName) Get dependents of a particular endpoint.getDynamicEndpoint(String key) Get a dynamic endpoint from the registryintString[]Get all endpoints stored in the registrygetEndpointConfiguration(String endpointName) Gets the endpoint element as a stringintString[]Get all endpoint configurations from the synapse configurationGet Metadata of all Endpoints of Synapse configurationString[]String[]getEndPointsNamesForTenant(String tenantDomain) Set the tenant domain when a publisher publishes his API in MT mode.booleanisEndpointExist(String endpointName) Check endpoint entry exist in the synapseConfigurationbooleanisEndpointExistForTenant(String endpointName, String tenantDomain) Check endpoint entry exist in the tenant synapseConfigurationbooleanCheck registry is available or notbooleansaveDynamicEndpoint(String key, String epName) Update an existing Endpoint endpoint in the registrybooleansaveEndpoint(String epString) Update an existing endpoint from the given String representation of the XMLvoidSwitch off EndpointvoidSet Endpoint status to ActiveMethods inherited from class org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
getLock, getMediationPersistenceManager, getServerConfigurationInformation, getServerContextInformation, getSynapseConfiguration, getSynapseEnvironment, getSynapseEnvironment, lockSynapseConfiguration, unlockSynapseConfigurationMethods inherited from class org.wso2.carbon.core.AbstractAdmin
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUserId, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
-
Field Details
-
WSO2_ENDPOINT_MEDIA_TYPE
- See Also:
-
-
Constructor Details
-
EndpointAdmin
public EndpointAdmin()
-
-
Method Details
-
switchOn
Set Endpoint status to Active- Parameters:
endpointName- name of the endpoint- Throws:
EndpointAdminException- in case of an error
-
switchOff
Switch off Endpoint- Parameters:
endpointName- name of the endpoint- Throws:
EndpointAdminException- in case of an error
-
addEndpoint
Add an Endpoint described by the given configuration- Parameters:
epString- - configuration representing the endpoint that needs to be added- Returns:
- true if the endpoint was successfully added and false otherwise
- Throws:
EndpointAdminException- if the element is not an endpoint or if an endpoint with the same name exists
-
addEndpointForTenant
public boolean addEndpointForTenant(String endpointData, String tenantDomain) throws EndpointAdminException Set 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 create the endpoint file in the particular tenant domain.- Parameters:
endpointData- Endpoint file contenttenantDomain- Domain of the logged tenant- Returns:
- true if the endpoint was successfully added to tenant space and false otherwise
- Throws:
EndpointAdminException- Thrown if an error occur
-
deleteEndpointForTenant
public boolean deleteEndpointForTenant(String endpointName, String tenantDomain) throws EndpointAdminException Set 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 delete the endpoint file in the particular tenant domain.- Parameters:
endpointName- Name of the endpoint file to be deletedtenantDomain- Domain of the logged tenant- Returns:
- true if the endpoint was successfully deleted from tenant space and false otherwise
- Throws:
EndpointAdminException- Thrown if an error occur
-
getEndPointsNamesForTenant
Set 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 get the names of the endpoint files in the particular tenant domain.- Parameters:
tenantDomain- Domain of the logged tenant- Returns:
- Returns an array of Strings with endpoint names
- Throws:
EndpointAdminException- Thrown if an error occurs
-
deleteEndpoint
Deletes the endpoint from the SynapseConfiguration- Parameters:
endpointName- - name of the endpoint to be deleted- Returns:
- true if the endpoint was successfully deleted and false otherwise
- Throws:
EndpointAdminException- if the proxy service name given is not existent in the synapse configuration
-
deleteSelectedEndpoint
Delete selected endpoints- Parameters:
endpointNames-- Throws:
EndpointAdminException
-
deleteAllEndpointGroups
Delete- Throws:
EndpointAdminException
-
getEndpointConfiguration
Gets the endpoint element as a string- Parameters:
endpointName- - name of the endpoint- Returns:
- String representing the endpoint with the given endpoint name
- Throws:
Exception- in case of an errorEndpointAdminException
-
getEndpoints
Get all endpoint configurations from the synapse configuration- Returns:
- a list of all the endpoints
- Throws:
EndpointAdminException- in case of an error
-
getEndpointsData
Get Metadata of all Endpoints of Synapse configuration- Returns:
- EndpointMetaData
-
enableStatistics
Enable statistics collection for the specified endpoint- Parameters:
endpointName- name of the endpoint- Throws:
EndpointAdminException- in case of an error
-
disableStatistics
Stop collecting statistics for a specified endpoint- Parameters:
endpointName- name of the endpoint- Throws:
EndpointAdminException- on error
-
saveEndpoint
Update an existing endpoint from the given String representation of the XML- Parameters:
epString- - String representing the XML which describes the Endpoint element- Returns:
- true if the endpoint was saved successfully and false otherwise
- Throws:
EndpointAdminException- if the endpoint does not exists in the SynapseConfiguration
-
saveDynamicEndpoint
Update an existing Endpoint endpoint in the registry- Parameters:
key- dynamic endpoint keyepName- endpoint name- Returns:
- whether operation is successful
- Throws:
EndpointAdminException- on Error
-
addDynamicEndpoint
Add an endpoint to the Synapse registry- Parameters:
key- of the dynamic endpointepConfiguration- endpoint configuration- Throws:
EndpointAdminException- in case of an error
-
getDynamicEndpoint
Get a dynamic endpoint from the registry- Parameters:
key- dynamic endpoint key- Returns:
- dynamic endpoint configuration
- Throws:
EndpointAdminException- on an error
-
isRegisterNull
Check registry is available or not- Returns:
- boolean
- Throws:
EndpointAdminException
-
getDynamicEndpoints
Get all endpoints stored in the registry- Returns:
- endpoints in the registry
- Throws:
EndpointAdminException- in case of an error
-
deleteDynamicEndpoint
Remove a endpoint form the registry- Parameters:
key- dynamic endpoint key- Returns:
- whether operation is successful
- Throws:
EndpointAdminException- in case of an error
-
getDependents
public org.wso2.carbon.mediation.dependency.mgt.ConfigurationObject[] getDependents(String endpointName) Get dependents of a particular endpoint.- Parameters:
endpointName- endpoint name- Returns:
- dependants of a endpoints
-
getEndPointsNames
- Throws:
EndpointAdminException
-
getEndpointCount
- Throws:
EndpointAdminException
-
getDynamicEndpointCount
- Throws:
EndpointAdminException
-
isEndpointExist
Check endpoint entry exist in the synapseConfiguration- Parameters:
endpointName- - endpoint name to be check exist- Returns:
- true if the endpoint was exist
- Throws:
EndpointAdminException- if there error when checking endpoint existence.
-
isEndpointExistForTenant
public boolean isEndpointExistForTenant(String endpointName, String tenantDomain) throws EndpointAdminException Check endpoint entry exist in the tenant synapseConfiguration- Parameters:
endpointName- - Endpoint name to be checkedtenantDomain- tenantDomain- Returns:
- whether the local entry is exist
- Throws:
EndpointAdminException- if there any error in check existence.
-