com.h3c.sdn.misc

## Class ServiceRestComponent

- java.lang.Object
- - com.h3c.sdn.misc.ResourceClient
  - - com.h3c.sdn.misc.PoolableResourceClient
    - - com.h3c.sdn.misc.ServiceRestComponent

- All Implemented Interfaces:
    AdminRest, ServiceRest

      @Service(value=ServiceRest.class)
      public class ServiceRestComponent
      extends PoolableResourceClient
      implements ServiceRest

  A poolable HTTP client that can be used with the controller's North-Bound (NB) REST API. All users of this service are assumed to part of the controller stack, and thus will be using the controller's shared secret for authentication and authorization purposes.

- - ### Field Summary

    - ### Fields inherited from class com.h3c.sdn.misc.PoolableResourceClient

      `CONFIG_CLIENT_AUTH_KEY, CONFIG_CONN_ROUTE_KEY, CONFIG_CONN_TIMEOUT, CONFIG_CONN_TOTAL_KEY, CONFIG_CONN_TTL_KEY, CONFIG_KEYSTORE_KEY, CONFIG_KEYSTORE_PASS_KEY, CONFIG_PORT_KEY, CONFIG_SELFSIGNED, CONFIG_SO_TIMEOUT, CONFIG_SSL_KEY, CONFIG_TRUSTSTORE_KEY, CONFIG_TRUSTSTORE_PASS_KEY, isSSL, log, port, ss`

    - ### Fields inherited from class com.h3c.sdn.misc.ResourceClient

      `LOGIN_TOKEN`

    - ### Fields inherited from interface com.h3c.sdn.misc.ServiceRest

      `SERVICE_HEADER_STRING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceRestComponent()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `annotate(org.apache.http.client.methods.HttpRequestBase request, LoginContext login)` Annotate the given request with the token of the supplied login context.
    `URI` | `uri(IpAddress target, String path, QueryParameter... parameters)` Creates a URI for accessing the specified resource path at the given system.

    - ### Methods inherited from class com.h3c.sdn.misc.PoolableResourceClient

      `activate, bindSharedSecret, client, deactivate, login, modified, unbindSharedSecret`

    - ### Methods inherited from class com.h3c.sdn.misc.ResourceClient

      `delete, delete, get, getInputStream, post, post, post, post, put, put, put, request, response, response, uri, uri, webContext`

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

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

    - ### Methods inherited from interface com.h3c.sdn.misc.AdminRest

      `delete, delete, get, getInputStream, login, post, post, post, post, put, put, put`

- - ### Constructor Detail

    - #### ServiceRestComponent

          public ServiceRestComponent()

  - ### Method Detail

    - #### annotate

          protected void annotate(org.apache.http.client.methods.HttpRequestBase request,
                      LoginContext login)

      Description copied from class: `ResourceClient`
      Annotate the given request with the token of the supplied login context. If the supplied login context is null, the annotation will not take place.
      Overrides:
        `annotate` in class `ResourceClient`
      Parameters:
        `request` - HTTP request
        `login` - optional login context

    - #### uri

          public URI uri(IpAddress target,
                String path,
                QueryParameter... parameters)

      Description copied from interface: `AdminRest`
      Creates a URI for accessing the specified resource path at the given system.
      Specified by:
        `uri` in interface `AdminRest`
      Parameters:
        `target` - target system
        `path` - resource path
        `parameters` - query parameters
      Returns:
        resource URI

Copyright © 2014. All Rights Reserved.