Package org.platformlayer.ops.tasks

Examples of org.platformlayer.ops.tasks.OpsContextBuilder


  @Produces({ XML, JSON })
  public MetricInfoCollection listMetrics() throws OpsException, RepositoryException {
    final ItemBase managedItem = getManagedItem();
    final ServiceProvider serviceProvider = getServiceProvider();

    OpsContextBuilder opsContextBuilder = objectInjector.getInstance(OpsContextBuilder.class);

    final OpsContext opsContext = opsContextBuilder.buildTemporaryOpsContext(getServiceType(),
        getProjectAuthorization());

    return OpsContext.runInContext(opsContext, new CheckedCallable<MetricInfoCollection, Exception>() {
      @Override
      public MetricInfoCollection call() throws Exception {
View Full Code Here


  @Produces({ XML, JSON })
  public MetricDataSource getMetrics(final MetricQuery query) throws RepositoryException, OpsException {
    final ItemBase managedItem = getManagedItem();
    final ServiceProvider serviceProvider = getServiceProvider();

    OpsContextBuilder opsContextBuilder = objectInjector.getInstance(OpsContextBuilder.class);

    final OpsContext opsContext = opsContextBuilder.buildTemporaryOpsContext(getServiceType(),
        getProjectAuthorization());

    return OpsContext.runInContext(opsContext, new CheckedCallable<MetricDataSource, Exception>() {
      @Override
      public MetricDataSource call() throws Exception {
View Full Code Here

    return ensureItem(auth, item, true, generateUniqueName, uniqueTag);
  }

  protected OpsContext buildTemporaryOpsContext(ServiceType serviceType, ProjectAuthorization auth)
      throws OpsException {
    OpsContextBuilder opsContextBuilder = injector.getInstance(OpsContextBuilder.class);
    return opsContextBuilder.buildTemporaryOpsContext(serviceType, auth);
  }
View Full Code Here

    if (serviceProvider == null) {
      raiseNotFound();
    }

    OpsContextBuilder opsContextBuilder = opsContextBuilderFactory.get();
    final OpsContext opsContext = opsContextBuilder.buildTemporaryOpsContext(serviceProvider.getServiceType(),
        getProjectAuthorization());

    PublicKey publicKey = OpsContext.runInContext(opsContext, new CheckedCallable<PublicKey, Exception>() {
      @Override
      public PublicKey call() throws Exception {
View Full Code Here

  @Path("extensions")
  public Object getExtensionsResource() throws Exception {
    final ServiceProvider serviceProvider = getServiceProvider();

    OpsContextBuilder opsContextBuilder = objectInjector.getInstance(OpsContextBuilder.class);

    final OpsContext opsContext = opsContextBuilder.buildTemporaryOpsContext(getServiceType(),
        getProjectAuthorization());

    Object extensionResource = OpsContext.runInContext(opsContext, new CheckedCallable<Object, Exception>() {
      @Override
      public Object call() throws Exception {
View Full Code Here

    return resource;
  }

  @Path("extensions")
  public Object getExtensionsResource() throws Exception {
    OpsContextBuilder opsContextBuilder = objectInjector.getInstance(OpsContextBuilder.class);

    final OpsContext opsContext = opsContextBuilder.buildTemporaryOpsContext(getServiceType(),
        getProjectAuthorization());

    Object extensionResource = OpsContext.runInContext(opsContext, new CheckedCallable<Object, Exception>() {
      @Override
      public Object call() throws Exception {
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.tasks.OpsContextBuilder

Copyright © 2018 www.massapicom. 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.