Package com.opengamma.component.rest

Source Code of com.opengamma.component.rest.RemoteComponentServer

/**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.component.rest;

import java.net.URI;

import com.opengamma.component.ComponentServer;
import com.opengamma.util.rest.AbstractRemoteClient;

/**
* Remote client for accessing remote components.
*/
public class RemoteComponentServer extends AbstractRemoteClient {

  /**
   * Creates the resource.
   *
   * @param baseUri  the base URI, not null
   */
  public RemoteComponentServer(final URI baseUri) {
    super(baseUri);
  }

  //-------------------------------------------------------------------------
  /**
   * Gets the remote components at the URI.
   * <p>
   * Any relative URIs in the response from the server will be converted into absolute URIs.
   *
   * @return the list of remote components
   */
  public ComponentServer getComponentServer() {
    URI uri = DataComponentServerResource.uri(getBaseUri());
    ComponentServer server = accessRemote(uri).get(ComponentServer.class);
    server.applyBaseUri(uri);
    return server;
  }

}
TOP

Related Classes of com.opengamma.component.rest.RemoteComponentServer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.