当前位置: 首页>>代码示例>>Java>>正文


Java HeaderParam类代码示例

本文整理汇总了Java中javax.ws.rs.HeaderParam的典型用法代码示例。如果您正苦于以下问题:Java HeaderParam类的具体用法?Java HeaderParam怎么用?Java HeaderParam使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HeaderParam类属于javax.ws.rs包,在下文中一共展示了HeaderParam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listAll

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=events;v=1"})
@ApiOperation(
        value = "obtain all events emitted by the account-event service", response = EventsRepresentation.class,
        notes = " the events are signalled by this resource as this this is the authoritative resource for all events that " +
                "subscribers to the account service should be able to listen for and react to. In other words this is the authoritative" +
                "feed for the account service",
        authorizations = {
                @Authorization(value = "oauth2", scopes = {}),
                @Authorization(value = "oauth2-cc", scopes = {}),
                @Authorization(value = "oauth2-ac", scopes = {}),
                @Authorization(value = "oauth2-rop", scopes = {}),
                @Authorization(value = "Bearer")
        },
        tags = {"interval", "events"},
        produces = "application/hal+json,  application/hal+json;concept=events;v=1",
        nickname = "listAccountAllEvents"
    )
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response listAll(@Context UriInfo uriInfo, @Context Request request,
                        @HeaderParam("Accept") String accept, @QueryParam("interval") String interval) {
    return eventsProducers.getOrDefault(accept, this::handleUnsupportedContentType)
            .getResponse(uriInfo, request, interval);
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:27,代码来源:AccountEventServiceExposure.java

示例2: getCustomerServiceMetadata

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=metadata;v=1"})
@ApiOperation(
        value = "metadata for the events endpoint", response = EventsMetadataRepresentation.class,
        authorizations = {
                @Authorization(value = "oauth2", scopes = {}),
                @Authorization(value = "oauth2-cc", scopes = {}),
                @Authorization(value = "oauth2-ac", scopes = {}),
                @Authorization(value = "oauth2-rop", scopes = {}),
                @Authorization(value = "Bearer")
        },
        notes = " the events are signalled by this resource as this this is the authoritative resource for all events that " +
                "subscribers to the customer service should be able to listen for and react to. In other words this is the authoritative" +
                "feed for the customer service",
        tags = {"events"},
        produces = "application/hal+json,  application/hal+json;concept=metadata;v=1",
        nickname = "getCustomerMetadata"
    )
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response getCustomerServiceMetadata(@Context UriInfo uriInfo, @Context Request request, @HeaderParam("Accept") String accept) {
    return eventMetadataProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request);
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:25,代码来源:CustomerEventFeedMetadataServiceExposure.java

示例3: list

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=virtualaccount;v=1"})
@ApiOperation(value = "lists accounts", response = VirtualAccountsRepresentation.class,
        authorizations = {
                @Authorization(value = "oauth2", scopes = {}),
                @Authorization(value = "oauth2-cc", scopes = {}),
                @Authorization(value = "oauth2-ac", scopes = {}),
                @Authorization(value = "oauth2-rop", scopes = {}),
                @Authorization(value = "Bearer")
        },
        extensions = {@Extension(name = "roles", properties = {
                @ExtensionProperty(name = "advisor", value = "advisors are allowed getting every virtualaccount"),
                @ExtensionProperty(name = "customer", value = "customer only allowed getting own locations")}
        )},
        produces = "application/hal+json, application/hal+json;concept=locations;v=1",
        notes = "List all locations in a default projection, which is VirtualAccount version 1" +
                "Supported projections and versions are: " +
                "VirtualAccounts in version 1 " +
                "The Accept header for the default version is application/hal+json;concept=virtualaccount;v=1.0.0.... " +
                "The format for the default version is {....}", nickname = "listVirtualAccounts")
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response list(@Context UriInfo uriInfo, @Context Request request, @HeaderParam("Accept") String accept) {
    return accountsProducer.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request);
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:27,代码来源:VirtualAccountServiceExposure.java

示例4: listAllCustomerEvents

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=events;v=1"})
@ApiOperation(
        value = "obtain all events emitted by the customer-event service", response = EventsRepresentation.class,
        notes = " the events are signalled by this resource as this this is the authoritative resource for all events that " +
                "subscribers to the customers service should be able to listen for and react to. In other words this is the authoritative" +
                "feed for the customers service",
        authorizations = {
                @Authorization(value = "oauth2", scopes = {}),
                @Authorization(value = "oauth2-cc", scopes = {}),
                @Authorization(value = "oauth2-ac", scopes = {}),
                @Authorization(value = "oauth2-rop", scopes = {}),
                @Authorization(value = "Bearer")
        },
        tags = {"interval", "events"},
        produces = "application/hal+json,  application/hal+json;concept=events;v=1",
        nickname = "listAllCustomerEvents"
    )
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response listAllCustomerEvents(@Context UriInfo uriInfo, @Context Request request,
                        @HeaderParam("Accept") String accept, @QueryParam("interval") String interval) {
    return eventsProducers.getOrDefault(accept, this::handleUnsupportedContentType)
            .getResponse(uriInfo, request, interval);
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:27,代码来源:CustomerEventServiceExposure.java

示例5: list

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=customers;v=1"})
@ApiOperation(value = "lists customers", response = CustomersRepresentation.class,
        authorizations = {
                @Authorization(value = "oauth2", scopes = {}),
                @Authorization(value = "oauth2-cc", scopes = {}),
                @Authorization(value = "oauth2-ac", scopes = {}),
                @Authorization(value = "oauth2-rop", scopes = {}),
                @Authorization(value = "Bearer")
        },
        extensions = {@Extension(name = "roles", properties = {
                @ExtensionProperty(name = "advisor", value = "advisors are allowed getting every customer"),
                @ExtensionProperty(name = "customer", value = "customer only allowed getting own information")}
        )},
        produces = "application/hal+json, application/hal+json;concept=customers;v=1",
        notes = "List all customers in a default projection, which is Customers version 1" +
                "Supported projections and versions are: " +
                "Customers in version 1 " +
                "The Accept header for the default version is application/hal+json;concept=customers;v=1.0.0.... " +
                "The format for the default version is {....}", nickname = "listCustomers")
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response list(@Context UriInfo uriInfo, @Context Request request, @HeaderParam("Accept") String accept) {
    return customersProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request);
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:27,代码来源:CustomerServiceExposure.java

示例6: graphIndirectPost

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
/**
 * Indirect HTTP POST
 *
 * @see <a href="http://www.w3.org/TR/sparql11-http-rdf-update/#http-post">
 * Section 5.5 "HTTP POST"
 * </a>
 * @param uriInfo JAX-RS {@link UriInfo} object
 * @param type Content-Type HTTP header field
 * @param graphString the "graph" query parameter
 * @param def the "default" query parameter
 * @param chunked the "chunked" query parameter
 * @param in HTTP body as {@link InputStream}
 * @return "204 No Content", if operation was successful
 */
@POST
@Consumes({
	RDFMediaType.RDF_TURTLE,
	RDFMediaType.RDF_YARS,
	RDFMediaType.RDF_XML,
	RDFMediaType.RDF_NTRIPLES,
	RDFMediaType.RDF_XML
})
public Response graphIndirectPost(
		@Context UriInfo uriInfo,
		@HeaderParam("Content-Type") MediaType type,
		@QueryParam("graph") String graphString,
		@QueryParam("default") String def,
		@QueryParam("chunked") String chunked,
		InputStream in) {
	return handleAdd(uriInfo, type, graphString, def, in, chunked, false);
}
 
开发者ID:lszeremeta,项目名称:neo4j-sparql-extension-yars,代码行数:32,代码来源:GraphStore.java

示例7: createObject

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
/**
 * Creates a new object.
 *
 * This originally used application/octet-stream;qs=1001 as a workaround
 * for JERSEY-2636, to ensure requests without a Content-Type get routed here.
 * This qs value does not parse with newer versions of Jersey, as qs values
 * must be between 0 and 1.  We use qs=1.000 to mark where this historical
 * anomaly had been.
 *
 * @param contentDisposition the content Disposition value
 * @param requestContentType the request content type
 * @param slug the slug value
 * @param requestBodyStream  the request body stream
 * @param link the link value
 * @param digest the digest header
 * @return 201
 * @throws InvalidChecksumException if invalid checksum exception occurred
 * @throws IOException if IO exception occurred
 * @throws MalformedRdfException if malformed rdf exception occurred
 */
@POST
@Consumes({MediaType.APPLICATION_OCTET_STREAM + ";qs=1.000", WILDCARD})
@Produces({TURTLE_WITH_CHARSET + ";qs=1.0", JSON_LD + ";qs=0.8",
        N3_WITH_CHARSET, N3_ALT2_WITH_CHARSET, RDF_XML, NTRIPLES, TEXT_PLAIN_WITH_CHARSET,
        TURTLE_X, TEXT_HTML_WITH_CHARSET, "*/*"})
public Response createObject(@HeaderParam(CONTENT_DISPOSITION) final ContentDisposition contentDisposition,
                             @HeaderParam(CONTENT_TYPE) final MediaType requestContentType,
                             @HeaderParam("Slug") final String slug,
                             @ContentLocation final InputStream requestBodyStream,
                             @HeaderParam(LINK) final String link,
                             @HeaderParam("Digest") final String digest)
        throws InvalidChecksumException, IOException, MalformedRdfException {
    LOGGER.info("POST: {}", externalPath);

    final ContainerService containerService = getContainerService();
    final URI resourceUri = createFromPath(externalPath);

    //check that resource exists
    if (!containerService.exists(resourceUri)) {
        if (!isRoot(resourceUri)) {
            return status(NOT_FOUND).build();
        } else {
            createRoot();
        }
    }

    final String newResourceName = slug == null ? UUID.randomUUID().toString() : slug;
    final String resourcePath = (isRoot(resourceUri) ? "" : resourceUri.getPath());
    final URI newResourceUri = createFromPath(resourcePath + "/" + newResourceName);
    final Container container = containerService.findOrCreate(newResourceUri);
    final Model model = ModelFactory.createDefaultModel();

    model.read(requestBodyStream, container.getIdentifier().toString(), "TTL");
    final Stream<Triple> triples = model.listStatements().toList().stream().map(Statement::asTriple);
    container.updateTriples(triples);
    return created(toExternalURI(container.getIdentifier(), headers)).build();
}
 
开发者ID:duraspace,项目名称:lambdora,代码行数:58,代码来源:LambdoraLdp.java

示例8: updatePassword

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/updatepassword")
public Response updatePassword(@HeaderParam("token") String token, String body) 
        throws SQLException, Exception{
    
    Gson gson = new Gson();
    Usuario u = gson.fromJson(body, Usuario.class);  
    
    try {
        if(!Verify(token, "admin") && !Verify(token, "user"))
            return Response.status(Response.Status.UNAUTHORIZED)
                    .entity("Usuário ou senha incorretos").build();
    } catch (Exception ex) {
        return Resposta.retornar(400, ex.toString(), token);
    }
    
    int id = getSubject(token);    
    u.setId(id);
    UsuarioDAO.updatePassword(u);

    return Response.ok().build();
}
 
开发者ID:Montanheiro,项目名称:SistemaAlmoxarifado,代码行数:24,代码来源:UsuarioResource.java

示例9: list

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
/**
     * Roleリソースのルート.
     * Boxの一覧を返す。
     * @param authzHeader Authorization ヘッダ
     * @return JAX-RS Response Object
     */
//    @Path("")
    @GET
    public final Response list(
            @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeader) {
        // アクセス制御
        this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), CellPrivilege.AUTH_READ);
        EntitiesResponse er = op.getEntities(Box.EDM_TYPE_NAME, null);
        List<OEntity> loe = er.getEntities();
        List<String> sl = new ArrayList<String>();
        sl.add(BOX_PATH_CELL_LEVEL);
        for (OEntity oe : loe) {
            OProperty<String> nameP = oe.getProperty("Name", String.class);
            sl.add(nameP.getValue());
        }
        StringBuilder sb = new StringBuilder();
        for (String s : sl) {
            sb.append(s + "<br/>");
        }
        return Response.ok().entity(sb.toString()).build();
    }
 
开发者ID:personium,项目名称:personium-core,代码行数:27,代码来源:RoleResource.java

示例10: get

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
/**
 * returns a Tableau export for the dataset
 * @return
 * @throws DatasetNotFoundException
 * @throws NamespaceException
 */
@GET
@Produces({APPLICATION_TDS, APPLICATION_TDS_DRILL})
public Response get(@HeaderParam(HttpHeaders.HOST) String host) throws DatasetNotFoundException, NamespaceException {
  // make sure path exists
  DatasetConfig datasetConfig = namespace.getDataset(datasetPath.toNamespaceKey());

  ResponseBuilder builder =  Response.ok().entity(datasetConfig);
  if (host == null) {
    return builder.build();
  }

  final String hostOnly;
  int portIndex = host.indexOf(":");
  if (portIndex == -1) {
    hostOnly = host;
  } else {
    hostOnly = host.substring(0, portIndex);
  }

  builder.header(WebServer.X_DREMIO_HOSTNAME, hostOnly);

  return builder.build();
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:30,代码来源:TableauResource.java

示例11: launchEvent

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@GET
@Secured
@Path("/launchevent/{eventId}")
@Produces(MediaType.APPLICATION_XML)
public SessionInfo launchEvent(@HeaderParam("securityToken") String securityToken, @PathParam("eventId") int eventId) {
	SessionInfo sessionInfo = new SessionInfo();
	SecurityChallenge securityChallenge = new SecurityChallenge();
	securityChallenge.setChallengeId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
	securityChallenge.setLeftSize(14);
	securityChallenge.setPattern("FFFFFFFFFFFFFFFF");
	securityChallenge.setRightSize(50);
	sessionInfo.setChallenge(securityChallenge);
	sessionInfo.setEventId(eventId);
	EventSessionEntity createEventSession = eventBO.createEventSession(eventId);
	sessionInfo.setSessionId(createEventSession.getId());
	tokenSessionBO.setActiveLobbyId(securityToken, 0L);
	return sessionInfo;
}
 
开发者ID:SoapboxRaceWorld,项目名称:soapbox-race-core,代码行数:19,代码来源:MatchMaking.java

示例12: logEvent

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@PUT
	@Path("logEvent/{fn_event}")
	public void logEvent(@HeaderParam("uid") String uid,
			String message,
			@PathParam("fn_event") String event)
			throws Exception {
				File dir = new File(Storage_Controller.getBaseFolder());
				File log = new File(dir, "log.txt");
				
				if(!log.exists()){
	    			log.createNewFile();
	    		}
				
				SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
				String time  = dateFormat.format(new Date());
				
				BufferedWriter output = new BufferedWriter(new FileWriter(log, true));
				
//				System.out.println("["+time+"]\t["+uid+"]\t["+event+"]\t"+message+"\n");
				output.write("["+time+"]\t["+uid+"]\t["+event+"]\t"+message+"\n");
	            output.flush();
	}
 
开发者ID:NLPReViz,项目名称:emr-nlp-server,代码行数:23,代码来源:WSInterface.java

示例13: requestShipment

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@POST
@Path(LRAOperationAPI.REQUEST)
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.APPLICATION_JSON)
@LRA(value = LRA.Type.REQUIRED)
public Response requestShipment(@HeaderParam(LRAClient.LRA_HTTP_HEADER) String lraUri, OrderInfo orderInfo) {
    String lraId = LRAClient.getLRAId(lraUri);
    log.info("processing request for LRA " + lraId);

    shipmentService.computeShipment(lraId, orderInfo);

    //stub for compensation scenario
    if ("failShipment".equals(orderInfo.getProduct().getProductId())) {
        return Response
                .status(Response.Status.BAD_REQUEST)
                .entity("Shipment for order " + orderInfo.getOrderId() + " failure")
                .build();
    }

    return Response
            .ok()
            .entity(String.format("Shipment for order %s processed", orderInfo.getOrderId()))
            .build();
}
 
开发者ID:xstefank,项目名称:lra-service,代码行数:25,代码来源:ShipmentEndpoint.java

示例14: graphDirectPut

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
/**
 * Direct HTTP PUT
 *
 * @see <a href="http://www.w3.org/TR/sparql11-http-rdf-update/#http-put">
 * Section 5.3 "HTTP PUT"
 * </a>
 * @param uriInfo JAX-RS {@link UriInfo} object
 * @param type Content-Type HTTP header field
 * @param chunked the "chunked" query parameter
 * @param in HTTP body as {@link InputStream}
 * @return "204 No Content", if operation was successful
 */
@PUT
@Consumes({
	RDFMediaType.RDF_TURTLE,
	RDFMediaType.RDF_YARS,
	RDFMediaType.RDF_XML,
	RDFMediaType.RDF_NTRIPLES,
	RDFMediaType.RDF_XML
})
@Path("/{graph}")
public Response graphDirectPut(
		@Context UriInfo uriInfo,
		@HeaderParam("Content-Type") MediaType type,
		@QueryParam("chunked") String chunked,
		InputStream in) {
	String graphuri = uriInfo.getAbsolutePath().toASCIIString();
	return handleAdd(uriInfo, type, graphuri, null, in, chunked, true);
}
 
开发者ID:lszeremeta,项目名称:neo4j-sparql-extension-yars,代码行数:30,代码来源:GraphStore.java

示例15: provideValue

import javax.ws.rs.HeaderParam; //导入依赖的package包/类
@Override
public Object provideValue(Parameter parameter, ContainerRequestContext requestContext, ObjectMapper objectMapper) {
	Object returnValue;
	String value = requestContext.getHeaderString(parameter.getAnnotation(HeaderParam.class).value());
	if (value == null) {
		return null;
	}
	else {
		if (String.class.isAssignableFrom(parameter.getType())) {
			returnValue = value;
		}
		else {
			try {
				returnValue = objectMapper.readValue(value, parameter.getType());
			}
			catch (IOException e) {
				throw new IllegalStateException(e);
			}
		}
	}

	return returnValue;
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:24,代码来源:HeaderParamProvider.java


注:本文中的javax.ws.rs.HeaderParam类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。