org.apache.tamaya.server

## Class ConfigurationResource

- java.lang.Object
- - org.apache.tamaya.server.ConfigurationResource

-     @Path(value="/")
      @Produces(value={"application/json","text/plain"})
      public class ConfigurationResource
      extends Object

  Configuration resource with an etcd compatible REST API (excluding the blocking API calls).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigurationResource(String scope)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `deleteConfig(String key)`
    `String` | `deleteEtcdConfig(String key)`
    `long` | `getDeleteCounter()`
    `long` | `getReadCounter()`
    `long` | `getWriteCounter()`
    `String` | `readConfig(Boolean recursive)` This models a etcd2 compliant access point for getting a property value.
    `String` | `readConfig(String key, Boolean recursive)` This models a etcd2 compliant access point for getting a property value.
    `String` | `readEtcdConfig(Boolean recursive)`
    `String` | `readEtcdConfig(String key, Boolean recursive)` This models a etcd2 compliant access point for getting a property value.
    `String` | `version()`
    `String` | `writeConfig(String key, String value, Integer ttl)` This models a etcd2 compliant access point for setting a property value: { "action": "set", "node": { "createdIndex": 3, "key": "/message", "modifiedIndex": 3, "value": "Hello etcd" }, "prevNode": { "createdIndex": 2, "key": "/message", "value": "Hello world", "modifiedIndex": 2 } }
    `String` | `writeEtcdConfig(String key, String value, Integer ttl)`

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

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

- - ### Constructor Detail

    - #### ConfigurationResource

          public ConfigurationResource(String scope)

  - ### Method Detail

    - #### version

          @GET
          @Path(value="/version")
          @Produces(value={"application/json","text/plain"})
          public String version()

    - #### readEtcdConfig

          @GET
          @Path(value="/v2/keys")
          public String readEtcdConfig(@QueryParam(value="recursive")
                                       Boolean recursive)

    - #### readConfig

          @GET
          @Path(value="/keys")
          public String readConfig(@QueryParam(value="recursive")
                                   Boolean recursive)

      This models a etcd2 compliant access point for getting a property value.
      Parameters:
        `recursive` - NOT YET IMPLEMENTED!
      Returns:
        all configuration property values.

    - #### readEtcdConfig

          @GET
          @Path(value="/v2/keys/{key}")
          public String readEtcdConfig(@PathParam(value="key")
                                       String key,
                                       @QueryParam(value="recursive")
                                       Boolean recursive)

      This models a etcd2 compliant access point for getting a property value.
      Parameters:
        `key` - name of the key to show
        `recursive` - NOT YET IMPLEMENTED!
      Returns:
        specific configuration key derived from the given key name.

    - #### readConfig

          @GET
          @Path(value="/keys/{key}")
          public String readConfig(@PathParam(value="key")
                                   String key,
                                   @QueryParam(value="recursive")
                                   Boolean recursive)

      This models a etcd2 compliant access point for getting a property value.
      Parameters:
        `key` - name of the key to show
        `recursive` - NOT YET IMPLEMENTED!
      Returns:
        configuration value of the given key.

    - #### writeEtcdConfig

          @PUT
          @Path(value="/v2/keys/{key}")
          public String writeEtcdConfig(@PathParam(value="key")
                                        String key,
                                        @FormParam(value="value")
                                        String value,
                                        @FormParam(value="ttl")
                                        Integer ttl)

    - #### writeConfig

          @PUT
          @Path(value="/keys/{key}")
          public String writeConfig(@PathParam(value="key")
                                    String key,
                                    @FormParam(value="value")
                                    String value,
                                    @FormParam(value="ttl")
                                    Integer ttl)

      This models a etcd2 compliant access point for setting a property value:

               {
           "action": "set",
           "node": {
           "createdIndex": 3,
           "key": "/message",
           "modifiedIndex": 3,
           "value": "Hello etcd"
           },
           "prevNode": {
           "createdIndex": 2,
           "key": "/message",
           "value": "Hello world",
           "modifiedIndex": 2
           }
           }

      Parameters:
        `key` - name of the key to show
        `value` - configuration value for the given key
        `ttl` - time to live
      Returns:
        written configuration value.

    - #### deleteEtcdConfig

          @DELETE
          @Path(value="/v2/keys/{key}")
          public String deleteEtcdConfig(@PathParam(value="key")
                                            String key)

    - #### deleteConfig

          @DELETE
          @Path(value="/keys/{key}")
          public String deleteConfig(@PathParam(value="key")
                                        String key)

    - #### getDeleteCounter

          public long getDeleteCounter()

    - #### getReadCounter

          public long getReadCounter()

    - #### getWriteCounter

          public long getWriteCounter()

Copyright © 2014–2016 Apache Software Foundation. All rights reserved.