Class EndpointManager
- java.lang.Object
-
- org.wso2.carbon.governance.api.endpoints.EndpointManager
-
public class EndpointManager extends Object
This provides the management functionality for endpoint artifacts stored on the registry.
-
-
Constructor Summary
Constructors Constructor Description EndpointManager(org.wso2.carbon.registry.core.Registry registry)Constructor accepting an instance of the registry to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEndpoint(Endpoint endpoint)Adds the given endpoint artifact to the registry.Endpoint[]getAllEndpoints()Finds all Endpoint artifacts on the registry.EndpointgetEndpoint(String endpointId)Fetches the given endpoint artifact on the registry.EndpointgetEndpointByUrl(String url)Finds the endpoint artifact that matches the given URL.EndpointnewEndpoint(String url)Creates a new endpoint artifact from the given URL.voidremoveEndpoint(String endpointId)Removes the given endpoint artifact from the registry.voidsetContent(Endpoint endpoint, org.wso2.carbon.registry.core.Resource endpointResource)Sets content of the given endpoint artifact to the given resource on the registry.voidupdateEndpoint(Endpoint endpoint)Updates the given endpoint artifact on the registry.
-
-
-
Method Detail
-
newEndpoint
public Endpoint newEndpoint(String url) throws GovernanceException
Creates a new endpoint artifact from the given URL.- Parameters:
url- the given URL.- Returns:
- the artifact added.
- Throws:
GovernanceException- if the operation failed.
-
addEndpoint
public void addEndpoint(Endpoint endpoint) throws GovernanceException
Adds the given endpoint artifact to the registry. Please do not use this method to update an existing artifact use the update method instead. If this method is used to update an existing artifact, all existing properties (such as lifecycle details) will be removed from the existing artifact.- Parameters:
endpoint- the endpoint artifact.- Throws:
GovernanceException- if the operation failed.
-
updateEndpoint
public void updateEndpoint(Endpoint endpoint) throws GovernanceException
Updates the given endpoint artifact on the registry.- Parameters:
endpoint- the endpoint artifact.- Throws:
GovernanceException- if the operation failed.
-
getEndpoint
public Endpoint getEndpoint(String endpointId) throws GovernanceException
Fetches the given endpoint artifact on the registry.- Parameters:
endpointId- the identifier of the endpoint artifact.- Returns:
- the endpoint artifact.
- Throws:
GovernanceException- if the operation failed.
-
removeEndpoint
public void removeEndpoint(String endpointId) throws GovernanceException
Removes the given endpoint artifact from the registry.- Parameters:
endpointId- the identifier of the endpoint artifact.- Throws:
GovernanceException- if the operation failed.
-
setContent
public void setContent(Endpoint endpoint, org.wso2.carbon.registry.core.Resource endpointResource) throws GovernanceException
Sets content of the given endpoint artifact to the given resource on the registry.- Parameters:
endpoint- the endpoint artifact.endpointResource- the content resource.- Throws:
GovernanceException- if the operation failed.
-
getEndpointByUrl
public Endpoint getEndpointByUrl(String url) throws GovernanceException
Finds the endpoint artifact that matches the given URL.- Parameters:
url- the URL.- Returns:
- the endpoint artifact that corresponds.
- Throws:
GovernanceException- if the operation failed.
-
getAllEndpoints
public Endpoint[] getAllEndpoints() throws GovernanceException
Finds all Endpoint artifacts on the registry.- Returns:
- all Endpoint artifacts on the registry.
- Throws:
GovernanceException- if the operation failed.
-
-