org.wso2.carbon.governance.api.endpoints

## 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 and 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 and Description
    --- | ---
    `void` | `addEndpoint(Endpoint endpoint)` Adds the given endpoint artifact to the registry.
    `Endpoint[]` | `getAllEndpoints()` Finds all Endpoint artifacts on the registry.
    `Endpoint` | `getEndpoint(String endpointId)` Fetches the given endpoint artifact on the registry.
    `Endpoint` | `getEndpointByUrl(String url)` Finds the endpoint artifact that matches the given URL.
    `Endpoint` | `newEndpoint(String url)` Creates a new endpoint artifact from the given URL.
    `void` | `removeEndpoint(String endpointId)` Removes the given endpoint artifact from the registry.
    `void` | `setContent(Endpoint endpoint, org.wso2.carbon.registry.core.Resource endpointResource)` Sets content of the given endpoint artifact to the given resource on the registry.
    `void` | `updateEndpoint(Endpoint endpoint)` Updates the given endpoint artifact on the registry.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### 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 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.

Copyright © 2017 WSO2. All rights reserved.