org.restlet.resource.Get.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.restlet.resource.Get.<init>()方法的一些代码示例,展示了Get.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Get.<init>()方法的具体详情如下:
包路径:org.restlet.resource.Get
类名称:Get
方法名:<init>

Get.<init>介绍

暂无

代码示例

代码示例来源:origin: uber/chaperone

@Override
@Get
public Representation get() {
 return new StringRepresentation("OK");
}

代码示例来源:origin: uber/chaperone

@Override
@Get
public Representation get() {
 final String opt = (String) getRequest().getAttributes().get("opt");
 if ("disable_autobalancing".equalsIgnoreCase(opt)) {
  _helixMirrorMakerManager.disableAutoBalancing();
  LOGGER.info("Disabled autobalancing!");
  return new StringRepresentation("Disabled autobalancing!\n");
 } else if ("enable_autobalancing".equalsIgnoreCase(opt)) {
  _helixMirrorMakerManager.enableAutoBalancing();
  LOGGER.info("Enabled autobalancing!");
  return new StringRepresentation("Enabled autobalancing!\n");
 }
 LOGGER.info("No valid input!");
 return new StringRepresentation("No valid input!\n");
}

代码示例来源:origin: uber/chaperone

@Override
@Get
public Representation get() {
 final String option = (String) getRequest().getAttributes().get("option");
 if ("srcKafka".equals(option)) {
  if (_srcKafkaValidationManager == null) {
   LOGGER.warn("SourceKafkaClusterValidationManager is null!");
   return new StringRepresentation("SrcKafkaValidationManager is not been initialized!");
  }
  LOGGER.info("Trying to call validation on source kafka cluster!");
  return new StringRepresentation(_srcKafkaValidationManager.validateSourceKafkaCluster());
 } else {
  LOGGER.info("Trying to call validation on current cluster!");
  return new StringRepresentation(_validationManager.validateExternalView());
 }
}

代码示例来源:origin: uber/chaperone

@Override
@Get
public Representation get() {
 final String topicName = (String) getRequest().getAttributes().get("topicName");

代码示例来源:origin: locationtech/geowave

@Override
 @Get("html")
 public String toString() {
  return "The route exists, but the command does not extend ServerResource";
 }
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-api

/**
   * Generate the RDF representation of this resource.
   */
  @Get(":rdf|rj|json|ttl")
  Representation getRdfAnnotationCountByAnnotatedObjectUri(Variant variant) throws ResourceException;
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-api

/**
 * Fetch a form that can be used in an HTML application to create a new user.
 * 
 * @param entity
 * @return
 * @throws ResourceException
 */
@Get("html")
Representation getCreateUserHtml(Representation entity) throws ResourceException;

代码示例来源:origin: com.github.ansell.oas/oas-webservice-api

/**
   * Generate the RDF representation of this resource.
   */
  @Get(":rdf|rj|json|ttl")
  Representation getRdf(Variant variant) throws ResourceException;
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-api

/**
 * Returns a representation containing the index page.
 * 
 * @param entity
 * @return
 * @throws ResourceException
 */
@Get("html")
Representation getIndexPageHtml(Representation entity) throws ResourceException;

代码示例来源:origin: org.restlet.jse/org.restlet.example

/**
 * Represents the account as a simple string with the owner name for now.
 * 
 * @return The account representation.
 */
@Get
AccountRepresentation represent();

代码示例来源:origin: org.restlet.jse/org.restlet.example

/**
 * Returns the list of accounts, each one on a separate line.
 * 
 * @return The list of accounts.
 */
@Get("txt")
String represent();

代码示例来源:origin: org.restlet.jse/org.restlet.example

/**
 * Represents the account as a simple string with the owner name for now.
 * 
 * @return The account representation.
 */
@Get
String represent();

代码示例来源:origin: org.restlet.jse/org.restlet.example

/**
 * Represents the application root with a welcome message.
 * 
 * @return The root representation.
 */
@Get("txt")
String represent();

代码示例来源:origin: org.restlet.jse/org.restlet.example

/**
 * Returns the list of accounts, each one on a separate line.
 * 
 * @return The list of accounts.
 */
@Get
String represent();

代码示例来源:origin: uber/uReplicator

@Override
@Get
public Representation get() {
 return new StringRepresentation("OK\n");
}

代码示例来源:origin: uber/uReplicator

@Override
@Get
public Representation get() {
 return new StringRepresentation("OK");
}

代码示例来源:origin: org.restlet.jse/org.restlet.example

@Get
  public String redirect() {
    // Sets the response status to 301 (Moved Permanently)
    redirectPermanent("http://localhost:8111/");

    System.out.println("Redirecting client to new location...");

    // Add explanation message entity
    return "Resource moved... \n";
  }
}

代码示例来源:origin: org.restlet.jse/org.restlet.example

@Get
public Representation toJson() throws JSONException {
  // Create a JSON object structure similar to a map
  JSONObject mailElt = new JSONObject();
  mailElt.put("status", "received");
  mailElt.put("subject", "Message to self");
  mailElt.put("content", "Doh!");
  mailElt.put("accountRef", new Reference(getReference(), "..")
      .getTargetRef().toString());
  return new JsonRepresentation(mailElt);
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-impl

@Get("html")
public Representation getHtml(final Representation entity, final Variant variant) throws ResourceException
{
  final Map<String, Object> dataModel = RestletUtils.getBaseDataModel(this.getRequest());
  
  dataModel.put("contentTemplate", "testannotations.html.ftl");
  dataModel.put("pageTitle", "Test Annotations Page - Ontology Annotation Services");
  
  // Output the base template, with contentTemplate from the dataModel defining the template
  // to use for the content in the body of the page
  return RestletUtils.getHtmlRepresentation(
      this.getPropertyUtil().get(OasProps.PROP_TMPL_BASE, OasProps.DEF_TMPL_BASE), dataModel,
      MediaType.TEXT_HTML, this.getOasApplication().getTemplateConfiguration());
}

代码示例来源:origin: locationtech/geowave

@Get("json")
public Representation restGet() throws Exception {
 if (HttpMethod.GET.equals(operation.getMethod())) {
  // Still send query parameters for GETs to the RequestParameters
  // class, but don't check for JSON or other Form payloads.
  return handleRequest(new RequestParametersForm(getQuery()));
 } else {
  setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED);
  return null;
 }
}

相关文章

Get类方法