Class EndpointManager
java.lang.Object
org.wso2.carbon.governance.api.endpoints.EndpointManager
This provides the management functionality for endpoint artifacts stored on
the registry.
-
Constructor Summary
ConstructorsConstructorDescriptionEndpointManager(org.wso2.carbon.registry.core.Registry registry) Constructor accepting an instance of the registry to use. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEndpoint(Endpoint endpoint) Adds the given endpoint artifact to the registry.Endpoint[]Finds all Endpoint artifacts on the registry.getEndpoint(String endpointId) Fetches the given endpoint artifact on the registry.getEndpointByUrl(String url) Finds the endpoint artifact that matches the given URL.newEndpoint(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.
-
Constructor Details
-
EndpointManager
public EndpointManager(org.wso2.carbon.registry.core.Registry registry) Constructor accepting an instance of the registry to use.- Parameters:
registry- the instance of the registry.
-
-
Method Details
-
newEndpoint
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
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
Updates the given endpoint artifact on the registry.- Parameters:
endpoint- the endpoint artifact.- Throws:
GovernanceException- if the operation failed.
-
getEndpoint
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
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
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
Finds all Endpoint artifacts on the registry.- Returns:
- all Endpoint artifacts on the registry.
- Throws:
GovernanceException- if the operation failed.
-