Java Code Examples for javax.ws.rs.GET

The following are top voted examples for showing how to use javax.ws.rs.GET. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: E-Clinic   File: AdminClinicRestEndPoint.java   View source code 6 votes vote down vote up
@GET
@Path("find")
@Produces(MediaType.APPLICATION_JSON)
public Response find() {
    JsonArray build = null;
    try {
        build = adminClinicService.get().stream().map(h -> Json.createObjectBuilder()
                .add("firstname", h.getPersonId().getFirstName())
                .add("lastname", h.getPersonId().getLastName())
                .add("id", h.getAdminClinicId())
                .build())
                .collect(Json::createArrayBuilder, JsonArrayBuilder::add, JsonArrayBuilder::add)
                .build();
    } catch (Exception ex) {
        return Response.ok().header("Exception", ex.getMessage()).build();
    }
    return Response.ok().entity(build == null ? "No data found" : build).build();
}
 
Example 2
Project: E-Clinic   File: CountryRestEndPoint.java   View source code 6 votes vote down vote up
@GET
@Path("find")
@Produces(MediaType.APPLICATION_JSON)
public Response find() {
    JsonArray build = null;
    try {
        build = countryService.get().stream().map(h -> Json.createObjectBuilder()
                .add("id", h.getCountryId())
                .add("name", h.getCountryName())
                .build())
                .collect(Json::createArrayBuilder, JsonArrayBuilder::add, JsonArrayBuilder::add)
                .build();
    } catch (Exception ex) {
        return Response.ok().header("Exception", ex.getMessage()).build();
    }
    return Response.ok().entity(build == null ? "No data found" : build).build();
}
 
Example 3
Project: scott-eu   File: ServiceProviderService1.java   View source code 6 votes vote down vote up
@GET
@Path("{planId}")
@Produces({ MediaType.TEXT_HTML })
public Response getPlanAsHtml(
    @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("planId") final String planId
    ) throws ServletException, IOException, URISyntaxException
{
    // Start of user code getPlanAsHtml_init
    // End of user code

    final Plan aPlan = PlannerReasonerManager.getPlan(httpServletRequest, serviceProviderId, planId);

    if (aPlan != null) {
        httpServletRequest.setAttribute("aPlan", aPlan);
        // Start of user code getPlanAsHtml_setAttributes
        // End of user code

        RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/se/ericsson/cf/scott/sandbox/plan.jsp");
        rd.forward(httpServletRequest,httpServletResponse);
    }

    throw new WebApplicationException(Status.NOT_FOUND);
}
 
Example 4
Project: microprofile-jwt-auth   File: RequiredClaimsEndpoint.java   View source code 6 votes vote down vote up
@GET
@Path("/verifyExpiration")
@Produces(MediaType.APPLICATION_JSON)
public JsonObject verifyExpiration(@QueryParam("exp") Long exp) {
    boolean pass = false;
    String msg;
    // exp
    Long expValue = rawTokenJson.getExpirationTime();
    if (expValue == null || expValue.intValue() == 0) {
        msg = Claims.exp.name() + "value is null or empty, FAIL";
    }
    else if (expValue.equals(exp)) {
        msg = Claims.exp.name() + " PASS";
        pass = true;
    }
    else {
        msg = String.format("%s: %s != %s", Claims.exp.name(), expValue, exp);
    }
    JsonObject result = Json.createObjectBuilder()
            .add("pass", pass)
            .add("msg", msg)
            .build();
    return result;
}
 
Example 5
Project: marathonv5   File: LiveSalesListFacadeREST.java   View source code 6 votes vote down vote up
@GET
@Produces({"application/xml", "application/json"})
@Path("/recent/region/producttype/{regionName}/{productTypeId}/{orderLineId}")
public List<LiveSalesList> findRecentRegionProductTypeFrom(@PathParam("regionName") String regionName, @PathParam("productTypeId") Integer productTypeId, @PathParam("orderLineId") Integer orderLineId) {
    CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
    javax.persistence.criteria.CriteriaQuery cq = cb.createQuery();
    Root<LiveSalesList> liveSalesList = cq.from(LiveSalesList.class);
    cq.select(liveSalesList);
    cq.where(cb.and(
        cb.equal(liveSalesList.get(LiveSalesList_.productTypeId), productTypeId),
        cb.equal(liveSalesList.get(LiveSalesList_.region), regionName),
        cb.gt(liveSalesList.get(LiveSalesList_.orderLineId), orderLineId)
    ));
    Query q = getEntityManager().createQuery(cq);
    q.setMaxResults(500);
    return q.getResultList();
}
 
Example 6
Project: hadoop   File: RMWebServices.java   View source code 6 votes vote down vote up
@GET
@Path("/apps/{appid}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public AppInfo getApp(@Context HttpServletRequest hsr,
    @PathParam("appid") String appId) {
  init();
  if (appId == null || appId.isEmpty()) {
    throw new NotFoundException("appId, " + appId + ", is empty or null");
  }
  ApplicationId id;
  id = ConverterUtils.toApplicationId(recordFactory, appId);
  if (id == null) {
    throw new NotFoundException("appId is null");
  }
  RMApp app = rm.getRMContext().getRMApps().get(id);
  if (app == null) {
    throw new NotFoundException("app with id: " + appId + " not found");
  }
  return new AppInfo(rm, app, hasAccess(app, hsr), hsr.getScheme() + "://");
}
 
Example 7
Project: hadoop-oss   File: KMS.java   View source code 6 votes vote down vote up
@GET
@Path(KMSRESTConstants.KEYS_METADATA_RESOURCE)
@Produces(MediaType.APPLICATION_JSON)
public Response getKeysMetadata(@QueryParam(KMSRESTConstants.KEY)
    List<String> keyNamesList) throws Exception {
  KMSWebApp.getAdminCallsMeter().mark();
  UserGroupInformation user = HttpUserGroupInformation.get();
  final String[] keyNames = keyNamesList.toArray(
      new String[keyNamesList.size()]);
  assertAccess(KMSACLs.Type.GET_METADATA, user, KMSOp.GET_KEYS_METADATA);

  KeyProvider.Metadata[] keysMeta = user.doAs(
      new PrivilegedExceptionAction<KeyProvider.Metadata[]>() {
        @Override
        public KeyProvider.Metadata[] run() throws Exception {
          return provider.getKeysMetadata(keyNames);
        }
      }
  );

  Object json = KMSServerJSONUtils.toJSON(keyNames, keysMeta);
  kmsAudit.ok(user, KMSOp.GET_KEYS_METADATA, "");
  return Response.ok().type(MediaType.APPLICATION_JSON).entity(json).build();
}
 
Example 8
Project: talk-observing-distributed-systems   File: TweetsResource.java   View source code 6 votes vote down vote up
@GET
@Traced(operationName = "find_tweets") //Tracing instrumentation
@Timed //Metrics instrumentation
public Response findTweets() {
  try {
    final List<TweetRepresentation> tweetRepresentations =
        tweetsService.findTweets(new TweetsQuery())
            .stream()
            .map(Tweet::printRepresentation)
            .collect(toList());
    final TweetsRepresentation tweetsRepresentation = new TweetsRepresentation();
    tweetsRepresentation.setTweets(tweetRepresentations);
    return Response.ok(tweetsRepresentation).build();
  } catch (Exception e) {
    e.printStackTrace();
    return Response.serverError().entity(e.getMessage()).build();
  }
}
 
Example 9
Project: E-Clinic   File: CityRestEndPoint.java   View source code 6 votes vote down vote up
@GET
@Path("find")
@Produces(MediaType.APPLICATION_JSON)
public Response find() {
    JsonArray build = null;
    try {
        build = cityService.get().stream().map(h -> Json.createObjectBuilder()
                .add("id", h.getCityId())
                .add("name", h.getCityName())
                .build())
                .collect(Json::createArrayBuilder, JsonArrayBuilder::add, JsonArrayBuilder::add)
                .build();
    } catch (Exception ex) {
        return Response.ok().header("Exception", ex.getMessage()).build();
    }
    return Response.ok().entity(build == null ? "No data found" : build).build();
}
 
Example 10
Project: sdn-controller-nsc-plugin   File: InspectionHookApis.java   View source code 6 votes vote down vote up
@Path("/{inspectionHookId}")
@GET
public InspectionHookEntity getInspectionHook(@PathParam("controllerId") String controllerId,
        @PathParam("inspectionHookId") String inspectionHookId)
                throws Exception {

    LOG.info("Getting the inspection hook element for id {} ", inspectionHookId);

    SampleSdnRedirectionApi sdnApi = ((SampleSdnRedirectionApi) this.api
            .createRedirectionApi(new VirtualizationConnectorElementImpl("Sample", controllerId), "TEST"));

    InspectionHookEntity inspectionHook = (InspectionHookEntity) sdnApi.getInspectionHook(inspectionHookId);

    inspectionHook.setInspectedPort(null);
    inspectionHook.setInspectionPort(null);

    return inspectionHook;
}
 
Example 11
Project: hadoop   File: NMWebServices.java   View source code 6 votes vote down vote up
@GET
@Path("/containers")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public ContainersInfo getNodeContainers() {
  init();
  ContainersInfo allContainers = new ContainersInfo();
  for (Entry<ContainerId, Container> entry : this.nmContext.getContainers()
      .entrySet()) {
    if (entry.getValue() == null) {
      // just skip it
      continue;
    }
    ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue(),
        uriInfo.getBaseUri().toString(), webapp.name());
    allContainers.add(info);
  }
  return allContainers;
}
 
Example 12
Project: osc-core   File: DistributedApplianceInstanceApis.java   View source code 6 votes vote down vote up
@ApiOperation(value = "Retrieves the Distributed Appliance Instance",
        notes = "Retrieves a Distributed Appliance Instance specified by the Id",
        response = DistributedApplianceDto.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation"),
        @ApiResponse(code = 400, message = "In case of any error", response = ErrorCodeDto.class) })
@Path("/{distributedApplianceInstanceId}")
@GET
public DistributedApplianceInstanceDto getDistributedApplianceInstance(@Context HttpHeaders headers,
                                                                       @ApiParam(value = "The Id of the Distributed Appliance Instance",
                                                                               required = true) @PathParam("distributedApplianceInstanceId") Long distributedApplianceInstanceId) {

    logger.info("Getting Distributed Appliance Instance " + distributedApplianceInstanceId);
    this.userContext.setUser(OscAuthFilter.getUsername(headers));

    GetDtoFromEntityRequest getDtoRequest = new GetDtoFromEntityRequest();
    getDtoRequest.setEntityId(distributedApplianceInstanceId);
    getDtoRequest.setEntityName("DistributedApplianceInstance");
    GetDtoFromEntityServiceApi<DistributedApplianceInstanceDto> getDtoService = this.getDtoFromEntityServiceFactory.getService(DistributedApplianceInstanceDto.class);

    return this.apiUtil.submitBaseRequestToService(getDtoService, getDtoRequest).getDto();
}
 
Example 13
Project: 201710-paseos_01   File: UsuarioResource.java   View source code 6 votes vote down vote up
@GET
@Path("usuarios")
public List<UsuarioDetailDTO> getUsuariosGuias(@QueryParam("guias")int g ){
   List<UsuarioDetailDTO> lista = new ArrayList<UsuarioDetailDTO>(); 
   List<UsuarioDetailDTO> lista1 = listEntity2DTO(usuarioLogic.getUsuarios());
   for (UsuarioDetailDTO usuario : lista1 )
   {
       if (usuario.getGuia()!=null)
          { 
       if (usuario.getGuia().booleanValue())
       {
           lista.add(usuario); 
       }
        }
   }
   
   if (g == 1 )
   {
       return lista; 
   }
   else 
   {
       return lista1; 
   }
}
 
Example 14
Project: osc-core   File: VirtualSystemApis.java   View source code 6 votes vote down vote up
@ApiOperation(value = "Retrieves the Deployment Specification",
        notes = "Retrieves a Deployment Specification specified by its owning Virtual System and Deployment Spec Id",
        response = ApplianceManagerConnectorDto.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation"),
        @ApiResponse(code = 400, message = "In case of any error", response = ErrorCodeDto.class) })
@Path("/{vsId}/deploymentSpecs/{dsId}")
@GET
public DeploymentSpecDto getDeploymentSpec(@Context HttpHeaders headers,
        @ApiParam(value = "The Virtual System Id") @PathParam("vsId") Long vsId,
        @ApiParam(value = "The Deployment Specification Id") @PathParam("dsId") Long dsId) {
    logger.info("getting Deployment Spec " + dsId);
    this.userContext.setUser(OscAuthFilter.getUsername(headers));
    GetDtoFromEntityRequest getDtoRequest = new GetDtoFromEntityRequest();
    getDtoRequest.setEntityId(dsId);
    getDtoRequest.setEntityName("DeploymentSpec");
    GetDtoFromEntityServiceApi<DeploymentSpecDto> getDtoService = this.getDtoFromEntityServiceFactory.getService(DeploymentSpecDto.class);
    DeploymentSpecDto dto = this.apiUtil.submitBaseRequestToService(getDtoService, getDtoRequest).getDto();

    this.apiUtil.validateParentIdMatches(dto, vsId, "SecurityGroup");

    return dto;
}
 
Example 15
Project: ctsms   File: JournalResource.java   View source code 5 votes vote down vote up
@GET
@Produces(MediaType.APPLICATION_JSON)
public ResourceIndex index(@Context Application application,
		@Context HttpServletRequest request) throws Exception {
	// String basePath = request.getRequestURL().toString();
	return new ResourceIndex(IndexResource.getResourceIndexNode(JournalResource.class, request)); // basePath));
}
 
Example 16
Project: opencps-v2   File: OfficeSiteManagement.java   View source code 5 votes vote down vote up
@GET
@Path("/{id}")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getOfficeSite(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") long id);
 
Example 17
Project: soapbox-race-core   File: DriverPersona.java   View source code 5 votes vote down vote up
@GET
@Secured
@Path("/GetPersonaPresenceByName")
@Produces(MediaType.APPLICATION_XML)
public String getPersonaPresenceByName(@QueryParam("displayName") String displayName) {
	PersonaPresence personaPresenceByName = bo.getPersonaPresenceByName(displayName);
	if (personaPresenceByName.getPersonaId() == 0) {
		return "";
	}
	return MarshalXML.marshal(personaPresenceByName);
}
 
Example 18
Project: bootstrap   File: ConfigurationResource.java   View source code 5 votes vote down vote up
/**
 * Return a specific configuration. System properties overrides the value from the database. Configuration values
 * are
 * always encrypted.
 * 
 * @param name
 *            The requested parameter name.
 * @return a specific configuration. May be <code>null</code>.
 */
@GET
@CacheResult(cacheName = "configuration")
public String get(@CacheKey final String name) {
	String value = System.getProperty(name);
	if (value == null) {
		value = Optional.ofNullable(repository.findByName(name)).map(SystemConfiguration::getValue).orElse(null);
	}
	return Optional.ofNullable(value).map(cryptoHelper::decryptAsNeeded).orElse(null);
}
 
Example 19
Project: soundwave   File: Query.java   View source code 5 votes vote down vote up
@GET
@Path("/aggregations/terms/{queryString}")
public Response getAggregationsUrl(@PathParam("queryString") @NotNull String query) {

  EsAggregation aggregation = new EsAggregation();
  aggregation.setQuery(query);

  return getAggregations(aggregation);
}
 
Example 20
Project: ctsms   File: ProbandResource.java   View source code 5 votes vote down vote up
@GET
@Produces({ MediaType.APPLICATION_JSON })
@Path("{id}/files")
public Page<FileOutVO> getFiles(@PathParam("id") Long id, @Context UriInfo uriInfo)
		throws AuthenticationException, AuthorisationException, ServiceException {
	PSFUriPart psf;
	return new Page<FileOutVO>(WebUtil.getServiceLocator().getFileService().getFiles(auth, fileModule, id, null, null, psf = new PSFUriPart(uriInfo)), psf);
}
 
Example 21
Project: javaee8-applications   File: SSEResource.java   View source code 5 votes vote down vote up
@GET
@Path("subscribe")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void subscribe(@Context SseEventSink eventSink,
                      @Context Sse sse){
    eventSink.send(sse.newEvent("Welcome to the List!"));
    eventSink.send(sse.newEvent("Message One!"));
    eventSink.send(sse.newEvent("SERVER-NOTIFICATION", "Message Two!"));
    eventSink.send(sse.newEventBuilder()
                    .comment("Nice Test")
                    .name("SERVER-TEST")
                    .data("Some data...could be an object")
                    .build());
    eventSink.close();
}
 
Example 22
Project: outland   File: FeatureResource.java   View source code 5 votes vote down vote up
@GET
@Path("/{group}")
@PermitAll
@Timed(name = "getFeatures")
public Response getFeatures(
    @Auth AuthPrincipal principal,
    @PathParam("group") String group
) throws AuthenticationException {

  final long start = System.currentTimeMillis();
  grantedGuard(principal, group);
  return this.headers.enrich(Response.ok(featureService.loadFeatures(group)), start).build();
}
 
Example 23
Project: InComb   File: VoteService.java   View source code 5 votes vote down vote up
/**
 * Returns all in votes of a given contentId Element
 * @param contentId to get the in votes of
 * @param con Connection to use - is injected automatically
 * @return a list of Users that voted in for the given contentid
 */
@GET
@Path("/ins")
public Response getInsOfContentId(@PathParam("contentId") final long contentId, @Context final Connection con){
	final ContentVoteDao dao = new ContentVoteDao(con);
	final List<User> insOfUsers= dao.getUsersThatVotedInOfContentId(contentId);
	return ok(UserUtil.toModels(insOfUsers, true));
}
 
Example 24
Project: dremio-oss   File: ProvisioningResource.java   View source code 5 votes vote down vote up
@GET
@Path("/cluster/{id}")
@Produces(MediaType.APPLICATION_JSON)
public ClusterResponse getClusterInfo(@PathParam("id") final String id) throws Exception {
  ClusterEnriched cluster = service.getClusterInfo(new ClusterId(id));
  return toClusterResponse(cluster);
}
 
Example 25
Project: nuls   File: NodesResourceImpl.java   View source code 5 votes vote down vote up
@Override
@GET
@Path("/count/consensus")
@Produces(MediaType.APPLICATION_JSON)
public RpcResult getConsensusCount() {
    return RpcResult.getSuccess();
}
 
Example 26
Project: acmeair-modular   File: AcmeAirConfiguration.java   View source code 5 votes vote down vote up
@GET
@Path("/runtime")
@Produces("application/json")
public ArrayList<ServiceData> getRuntimeInfo() {
	try {
		logger.fine("Getting Runtime info");
		ArrayList<ServiceData> list = new ArrayList<ServiceData>();
		ServiceData data = new ServiceData();
		data.name = "Runtime";
		data.description = "Java";			
		list.add(data);
		
		data = new ServiceData();
		data.name = "Version";
		data.description = System.getProperty("java.version");			
		list.add(data);
		
		data = new ServiceData();
		data.name = "Vendor";
		data.description = System.getProperty("java.vendor");			
		list.add(data);
		
		return list;
	}
	catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
Example 27
Project: SigFW   File: DiameterFirewallAPI_V1_0.java   View source code 5 votes vote down vote up
@GET
@Consumes("text/plain")
@Produces("text/plain")
@Path("diameter_application_id_whitelist_remove")
public String diameter_application_id_whitelist_remove(@MatrixParam("ai") int ai) {
    DiameterFirewallConfig.diameter_application_id_whitelist.remove((new Integer(ai)).toString());
    return "Successful";
}
 
Example 28
Project: app-ms   File: JwksResource.java   View source code 5 votes vote down vote up
/**
 * Only return the public keys.
 *
 * @return public key set.
 */
@ApiOperation(value = "Get public keys",
    response = Response.class,
    notes = "Provides the JWKS of public keys used for JWS and JWE for clients.")
@GET
@Produces(MediaType.APPLICATION_JSON)
public String getPublicKeySet() {

    return cachedDataProvider.getKeySet().toJson(JsonWebKey.OutputControlLevel.PUBLIC_ONLY);
}
 
Example 29
Project: hadoop   File: AHSWebServices.java   View source code 5 votes vote down vote up
@GET
@Path("/apps/{appid}/appattempts/{appattemptid}/containers/{containerid}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Override
public ContainerInfo getContainer(@Context HttpServletRequest req,
    @Context HttpServletResponse res, @PathParam("appid") String appId,
    @PathParam("appattemptid") String appAttemptId,
    @PathParam("containerid") String containerId) {
  init(res);
  return super.getContainer(req, res, appId, appAttemptId, containerId);
}
 
Example 30
Project: kafka-0.11.0.0-src-with-comment   File: ConnectorsResource.java   View source code 5 votes vote down vote up
@GET
@Path("/{connector}/config")
public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector,
                                              final @QueryParam("forward") Boolean forward) throws Throwable {
    FutureCallback<Map<String, String>> cb = new FutureCallback<>();
    herder.connectorConfig(connector, cb);
    return completeOrForwardRequest(cb, "/connectors/" + connector + "/config", "GET", null, forward);
}
 
Example 31
Project: personium-core   File: CellSnapshotDavFileResource.java   View source code 5 votes vote down vote up
/**
 * process OPTIONS Method.
 * @return JAX-RS response object
 */
@OPTIONS
public Response options() {
    // Check exist
    checkFileExists();
    // Access Control
    davRsCmp.getParent().checkAccessContext(davRsCmp.getAccessContext(), CellPrivilege.ROOT);
    return PersoniumCoreUtils.responseBuilderForOptions(
            HttpMethod.GET,
            HttpMethod.PUT,
            HttpMethod.DELETE,
            io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND
            ).build();
}
 
Example 32
Project: verify-hub   File: IdentityProviderResource.java   View source code 5 votes vote down vote up
@GET
@Path(Urls.ConfigUrls.IDP_CONFIG_DATA)
@Timed
public IdpConfigDto getIdpConfig(@PathParam(Urls.SharedUrls.ENTITY_ID_PARAM) String entityId) {

    IdentityProviderConfigEntityData idpData = getIdentityProviderConfigData(entityId);
    return new IdpConfigDto(
            idpData.getSimpleId(),
            idpData.isEnabled(),
            idpData.getSupportedLevelsOfAssurance(),
            idpData.getUseExactComparisonType()
    );
}
 
Example 33
Project: Info-Portal   File: UserResource.java   View source code 5 votes vote down vote up
@GET
@Path("/{id}")
public Response getUser(@PathParam("id") long id) {
    User user = users.findUser(id);
    if (user != null) {
        return Response.status(Response.Status.ACCEPTED).entity(user).build();
    }
    return Response.status(Response.Status.NOT_FOUND).build();
}
 
Example 34
Project: athena   File: MetersWebResource.java   View source code 5 votes vote down vote up
/**
 * Returns all meters of all devices.
 *
 * @return 200 OK with array of all the meters in the system
 * @onos.rsModel Meters
 */
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getMeters() {
    final Iterable<Meter> meters = meterService.getAllMeters();
    if (meters != null) {
        meters.forEach(meter -> metersNode.add(codec(Meter.class).encode(meter, this)));
    }
    return ok(root).build();
}
 
Example 35
Project: Equella   File: ItemResource.java   View source code 5 votes vote down vote up
@GET
@Path("/{uuid}/{version}")
@ApiOperation(value = "Get information about an item", response = ItemBean.class)
public ItemBean getItem(
	// @formatter:off
	@Context UriInfo uriInfo,
	@ApiParam(APIDOC_ITEMUUID) @PathParam("uuid") String uuid,
	@ApiParam(APIDOC_ITEMVERSION) @PathParam("version") int version,
	@ApiParam(value = "How much information to return for the item", required = false, allowableValues = ALL_ALLOWABLE_INFOS, allowMultiple = true) @QueryParam("info") CsvList info);
 
Example 36
Project: opencps-v2   File: WorkTimeManagement.java   View source code 5 votes vote down vote up
@GET
@Path("/{n}")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response read(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@DefaultValue("0") @PathParam("n") int n);
 
Example 37
Project: athena   File: ControlMetricsWebResource.java   View source code 5 votes vote down vote up
/**
 * Returns control message metrics of a given device.
 *
 * @param deviceId device identification
 * @return control message metrics of a given device
 * @onos.rsModel ControlMessageMetric
 */
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("messages/{deviceId}")
public Response controlMessageMetrics(@PathParam("deviceId") String deviceId) {

    metricsStats(monitorService, localNodeId, CONTROL_MESSAGE_METRICS,
            DeviceId.deviceId(deviceId), root);

    return ok(root).build();
}
 
Example 38
Project: sdn-controller-nsc-plugin   File: PortApis.java   View source code 5 votes vote down vote up
@GET
public List<String> getPortIds(@PathParam("controllerId") String controllerId) throws Exception {
    LOG.info("Listing port elements ids'");

    SampleSdnRedirectionApi sdnApi = ((SampleSdnRedirectionApi) this.api
            .createRedirectionApi(new VirtualizationConnectorElementImpl("Sample", controllerId), "TEST"));

    return sdnApi.getPortIds();
}
 
Example 39
Project: dust-api   File: DeviceResource.java   View source code 5 votes vote down vote up
@GET
@Path("/{nickname}/details-qr")
@Produces("image/png")
public Response deviceDetailsLinkQrCode(
        @PathParam("nickname") final String nickname,
        @QueryParam("baseUrl") @DefaultValue(DEFAULT_BASE_URL) final String baseUrl
) throws IOException {
    final byte[] detailsQr = qrCodeAsPng(baseUrl, nickname, "");
    return Response.ok(new ByteArrayInputStream(detailsQr)).build();
}
 
Example 40
Project: holon-examples   File: ProtectedEndpoint.java   View source code 5 votes vote down vote up
@PermitAll
@GET
@Path("/anyrole")
@Produces(MediaType.TEXT_PLAIN)
public String getAnyRole() {
	return "anyrole";
}