Package org.sonatype.nexus.rest.model

Examples of org.sonatype.nexus.rest.model.StatusResourceResponse


    resource.setLicenseExpired(status.isLicenseExpired());

    resource.setTrialLicense(status.isTrialLicense());

    StatusResourceResponse result = new StatusResourceResponse();

    result.setData(resource);

    return result;
  }
View Full Code Here


      }
      catch (IOException e) {
        throw new NexusIllegalStateException("Unable to retrieve nexus status body", e);
      }

      StatusResourceResponse status =
          (StatusResourceResponse) XStreamFactory.getXmlXStream().fromXML(entityText);
      if (!SystemState.STARTED.toString().equals(status.getData().getState())) {
        log.debug("Status check returned system state " + status.getData().getState());
        return false;
      }

      return true;
    }
View Full Code Here

        entityText = RequestFacade.doGetForText("service/local/status?perms=1");
      }
      else {
        entityText = RequestFacade.doGetForText("service/local/status");
      }
      StatusResourceResponse status =
          (StatusResourceResponse) XStreamFactory.getXmlXStream().fromXML(entityText);
      return status;
    }
    catch (IOException ex) {
      throw new NexusIllegalStateException("Could not get nexus status", ex);
View Full Code Here

  @Test
  public void testStatusResourceResponse()
      throws ParseException
  {
    StatusResourceResponse resourceResponse = new StatusResourceResponse();

    StatusResource status = new StatusResource();
    NexusAuthenticationClientPermissions perms = new NexusAuthenticationClientPermissions();
    ClientPermission permission = new ClientPermission();
    permission.setId("id");
    permission.setValue(5);
    perms.addPermission(permission);
    perms.setLoggedIn(true);
    perms.setLoggedInUsername("fred");
    perms.setLoggedInUserSource("source");

    status.setClientPermissions(perms);
    status.setConfigurationUpgraded(true);
    status.setErrorCause("errorCause");
    status.setFirstStart(true);
    status.setInitializedAt(this.dateFormat.parse("01/01/2001"));
    status.setInstanceUpgraded(true);
    status.setLastConfigChange(this.dateFormat.parse("01/01/2002"));
    status.setOperationMode("operationMode");
    status.setStartedAt(this.dateFormat.parse("01/01/2003"));
    status.setState("STATE");
    status.setVersion("version");
    status.setApiVersion("apiversion");
    status.setAppName("appname");
    status.setBaseUrl("baseurl");
    status.setEditionLong("long edition name");
    status.setEditionShort("short");
    status.setAttributionsURL("http://my.attributions.com/url");
    status.setPurchaseURL("http://my.store.com/url");
    status.setUserLicenseURL("http://my.userlicense.com/url");

    status.setFormattedAppName("formatted");

    StatusConfigurationValidationResponse validation = new StatusConfigurationValidationResponse();
    validation.setModified(true);
    validation.setValid(true);

    validation.addValidationError("error1");
    validation.addValidationError("error2");

    validation.addValidationWarning("warning1");
    validation.addValidationWarning("warning2");
    status.setConfigurationValidationResponse(validation);

    resourceResponse.setData(status);

    this.marshalUnmarchalThenCompare(resourceResponse, this.xstreamXML); // FIXME: JSON READER CANNOT PARSE DATES
    // CORRECTLY.
    this.validateXmlHasNoPackageNames(resourceResponse);
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.StatusResourceResponse

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.