com.h3c.sdn.misc

## Interface AdminRest

- All Known Subinterfaces:
    ServiceRest
  All Known Implementing Classes:
    AdminRestComponent, ServiceRestComponent

      public interface AdminRest

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ResponseData` | `delete(LoginContext login, URI uri)` Issues a delete request against the specified URI.
    `ResponseData` | `delete(LoginContext login, URI uri, byte[] request)` Issues a delete request against the specified URI.
    `ResponseData` | `get(LoginContext login, URI uri)` Issues a get request against the specified URI.
    `InputStream` | `getInputStream(LoginContext login, URI uri, String mediaType)` Issues a get request against the specified URI.
    `LoginContext` | `login()` Employs a shared-secret to authenticate and to obtain login context.
    `ResponseData` | `post(LoginContext login, URI uri)` Issues a post request against the specified URI
    `ResponseData` | `post(LoginContext login, URI uri, byte[] request)` Issues a post request against the specified URI.
    `ResponseData` | `post(LoginContext login, URI uri, org.apache.http.Header[] headers, byte[] request)` Issues a post request against the specified URI.
    `ResponseData` | `post(LoginContext login, URI uri, org.apache.http.Header[] headers, InputStream request)` Issues a post request against the specified URI, with the expectation that the response will not contain data.
    `ResponseData` | `put(LoginContext login, URI uri)` Issues a put request against the specified URI, with the expectation that the response will not contain data
    `ResponseData` | `put(LoginContext login, URI uri, byte[] request)` Issues a put request against the specified URI.
    `ResponseData` | `put(LoginContext login, URI uri, org.apache.http.Header[] headers, byte[] request)` Issues a put request against the specified URI.
    `URI` | `uri(IpAddress target, String path, QueryParameter... parameters)` Creates a URI for accessing the specified resource path at the given system.

- - ### Method Detail

    - #### login

          LoginContext login()

      Employs a shared-secret to authenticate and to obtain login context.
      Returns:
        login context

    - #### get

          ResponseData get(LoginContext login,
                         URI uri)

      Issues a get request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### getInputStream

          InputStream getInputStream(LoginContext login,
                                   URI uri,
                                   String mediaType)

      Issues a get request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
        `mediaType` - optional expected media type specified in the Accept header
      Returns:
        input stream to the response data
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### post

          ResponseData post(LoginContext login,
                          URI uri,
                          byte[] request)

      Issues a post request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
        `request` - byte array of request data
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### post

          ResponseData post(LoginContext login,
                          URI uri,
                          org.apache.http.Header[] headers,
                          byte[] request)

      Issues a post request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
        `headers` - required headers
        `request` - byte array of request data
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### post

          ResponseData post(LoginContext login,
                          URI uri,
                          org.apache.http.Header[] headers,
                          InputStream request)

      Issues a post request against the specified URI, with the expectation that the response will not contain data.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
        `headers` - required headers
        `request` - InputStream of request data
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### post

          ResponseData post(LoginContext login,
                          URI uri)

      Issues a post request against the specified URI
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### put

          ResponseData put(LoginContext login,
                         URI uri,
                         org.apache.http.Header[] headers,
                         byte[] request)

      Issues a put request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
        `headers` - required headers
        `request` - byte array of request data
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### put

          ResponseData put(LoginContext login,
                         URI uri,
                         byte[] request)

      Issues a put request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
        `request` - byte array of request data
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### put

          ResponseData put(LoginContext login,
                         URI uri)

      Issues a put request against the specified URI, with the expectation that the response will not contain data
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### delete

          ResponseData delete(LoginContext login,
                            URI uri)

      Issues a delete request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### delete

          ResponseData delete(LoginContext login,
                            URI uri,
                            byte[] request)

      Issues a delete request against the specified URI.
      Parameters:
        `login` - previously established login context
        `uri` - resource URI
        `request` - byte array of request data
      Returns:
        a ResponseData object containing the status code, reason phrase and data as a byte array.
      Throws:
        `RuntimeException` - in case of an HTTP protocol error or connection problems

    - #### uri

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

      Creates a URI for accessing the specified resource path at the given system.
      Parameters:
        `target` - target system
        `path` - resource path
        `parameters` - query parameters
      Returns:
        resource URI
      Throws:
        `IllegalArgumentException` - if address or path have invalid format

Copyright © 2014. All Rights Reserved.