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


Java TypeHint类代码示例

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


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

示例1: post

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@POST
@Produces(Protocol.MIME_TYPES_ALL)
@Consumes(Protocol.MIME_TYPES_RDF)
@TypeHint(Stream.class)
public Response post(final Stream<Statement> statements) throws OperationException {

	closeOnCompletion(statements);

	// Validate preconditions and handle probe requests here, before body is consumed
	// POST URI does not support GET, hence no tag and last modified
	init(true, null);

	Outcome outcome = getSession().sparqlupdate().statements(statements).exec();

	// Setup the response stream
	final int httpStatus = outcome.getStatus().getHTTPStatus();
	final Stream<Outcome> entity = Stream.create(outcome);

	// Stream the result to the client
	return newResponseBuilder(httpStatus, entity, Protocol.STREAM_OF_OUTCOMES).build();
}
 
开发者ID:dkmfbk,项目名称:knowledgestore,代码行数:22,代码来源:SparqlUpdate.java

示例2: post

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@POST
@Produces(Protocol.MIME_TYPES_ALL)
@Consumes(Protocol.MIME_TYPES_RDF)
@TypeHint(Stream.class)
public Response post(final Stream<Statement> statements) throws OperationException {

	closeOnCompletion(statements);

	// Validate preconditions and handle probe requests here, before body is consumed
	// POST URI does not support GET, hence no tag and last modified
	init(true, null);

	Outcome outcome = getSession().sparqldelete().statements(statements).exec();

	// Setup the response stream
	final int httpStatus = outcome.getStatus().getHTTPStatus();
	final Stream<Outcome> entity = Stream.create(outcome);

	// Stream the result to the client
	return newResponseBuilder(httpStatus, entity, Protocol.STREAM_OF_OUTCOMES).build();
}
 
开发者ID:dkmfbk,项目名称:knowledgestore,代码行数:22,代码来源:SparqlDelete.java

示例3: getStaticRoutes

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
/**
 * Returns a list of static routes present on the given container
 *
 * @param containerName Name of the Container. The Container name for the base controller is "default".
 * @return List of configured static routes on the given container
 */
@Path("/{containerName}")
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(StaticRoutes.class)
@StatusCodes( {
        @ResponseCode(code = 200, condition = "Operation successful"),
        @ResponseCode(code = 404, condition = "The containerName passed was not found") })
public StaticRoutes getStaticRoutes(
        @PathParam("containerName") String containerName) {

    if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
            Privilege.WRITE, this)){
        throw new
            UnauthorizedException("User is not authorized to perform this operation on container "
                        + containerName);
    }
    return new StaticRoutes(getStaticRoutesInternal(containerName));
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:25,代码来源:StaticRoutingNorthbound.java

示例4: getStaticFlows

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
/**
 * Returns a list of Flows configured on the given container
 *
 * @param containerName
 *            Name of the Container. The Container name for the base
 *            controller is "default".
 * @return List of configured flows configured on a given container
 */
@Path("/{containerName}")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(FlowConfigs.class)
@StatusCodes({
        @ResponseCode(code = 200, condition = "Operation successful"),
        @ResponseCode(code = 404, condition = "The containerName is not found"),
        @ResponseCode(code = 503, condition = "One or more of Controller Services are unavailable") })
public FlowConfigs getStaticFlows(
        @PathParam("containerName") String containerName) {
    if (!NorthboundUtils.isAuthorized(
            getUserName(), containerName, Privilege.READ, this)) {
        throw new UnauthorizedException(
                "User is not authorized to perform this operation on container "
                        + containerName);
    }

    List<FlowConfig> flowConfigs = getStaticFlowsInternal(containerName,
            null);
    return new FlowConfigs(flowConfigs);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:30,代码来源:FlowProgrammerNorthbound.java

示例5: addNodePorts

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
/**
 *
 * Add ports to a subnet
 *
 * @param containerName
 *            Name of the Container
 * @param name
 *            Name of the SubnetConfig to be modified
 * @param subnetConfigData
 *            the {@link SubnetConfig} structure in JSON passed as a POST
 *            parameter
 * @return If the operation is successful or not
 */
@Path("/{containerName}/{subnetName}/add")
@POST
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@StatusCodes({
    @ResponseCode(code = 202, condition = "Operation successful"),
    @ResponseCode(code = 400, condition = "Invalid request"),
    @ResponseCode(code = 404, condition = "The containerName or subnetName is not found"),
    @ResponseCode(code = 500, condition = "Internal server error") })
public Response addNodePorts(
        @PathParam("containerName") String containerName,
        @PathParam("subnetName") String name,
        @TypeHint(SubnetConfig.class) JAXBElement<SubnetConfig> subnetConfigData) {

    SubnetConfig subnetConf = subnetConfigData.getValue();
    return addOrDeletePorts(containerName, name, subnetConf, "add");
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:30,代码来源:SubnetsNorthboundJAXRS.java

示例6: deleteNodePorts

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
/**
 *
 * Delete ports from a subnet
 *
 * @param containerName
 *            Name of the Container
 * @param name
 *            Name of the SubnetConfig to be modified
 * @param subnetConfigData
 *            the {@link SubnetConfig} structure in JSON passed as a POST
 *            parameter
 * @return If the operation is successful or not
 */
@Path("/{containerName}/{subnetName}/delete")
@POST
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@StatusCodes({
    @ResponseCode(code = 202, condition = "Operation successful"),
    @ResponseCode(code = 400, condition = "Invalid request"),
    @ResponseCode(code = 404, condition = "The containerName or subnetName is not found"),
    @ResponseCode(code = 500, condition = "Internal server error") })
public Response deleteNodePorts(
        @PathParam("containerName") String containerName,
        @PathParam("subnetName") String name,
        @TypeHint(SubnetConfig.class) JAXBElement<SubnetConfig> subnetConfigData) {

    SubnetConfig subnetConf = subnetConfigData.getValue();
    return addOrDeletePorts(containerName, name, subnetConf, "delete");
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:30,代码来源:SubnetsNorthboundJAXRS.java

示例7: getActiveHosts

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
/**
 * Returns a list of all Hosts : both configured via PUT API and dynamically
 * learnt on the network.
 *
 * @param containerName
 *            Name of the Container. The Container name for the base
 *            controller is "default".
 * @return List of Active Hosts.
 */
@Path("/{containerName}")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(Hosts.class)
@StatusCodes({
        @ResponseCode(code = 200, condition = "Operation successful"),
        @ResponseCode(code = 404, condition = "The containerName is not found"),
        @ResponseCode(code = 503, condition = "One or more of Controller Services are unavailable") })
public Hosts getActiveHosts(@PathParam("containerName") String containerName) {

    if (!NorthboundUtils.isAuthorized(
            getUserName(), containerName, Privilege.READ, this)) {
        throw new UnauthorizedException(
                "User is not authorized to perform this operation on container "
                        + containerName);
    }
    IfIptoHost hostTracker = getIfIpToHostService(containerName);
    if (hostTracker == null) {
        throw new ServiceUnavailableException("Host Tracker "
                + RestMessages.SERVICEUNAVAILABLE.toString());
    }

    return new Hosts(hostTracker.getAllHosts());
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:34,代码来源:HostTrackerNorthbound.java

示例8: getInactiveHosts

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
/**
 * Returns a list of Hosts that are statically configured and are connected
 * to a NodeConnector that is down.
 *
 * @param containerName
 *            Name of the Container. The Container name for the base
 *            controller is "default".
 * @return List of inactive Hosts.
 */
@Path("/{containerName}/inactive")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(Hosts.class)
@StatusCodes({
        @ResponseCode(code = 200, condition = "Operation successful"),
        @ResponseCode(code = 404, condition = "The containerName is not found"),
        @ResponseCode(code = 503, condition = "One or more of Controller Services are unavailable") })
public Hosts getInactiveHosts(
        @PathParam("containerName") String containerName) {
    if (!NorthboundUtils.isAuthorized(
            getUserName(), containerName, Privilege.READ, this)) {
        throw new UnauthorizedException(
                "User is not authorized to perform this operation on container "
                        + containerName);
    }
    IfIptoHost hostTracker = getIfIpToHostService(containerName);
    if (hostTracker == null) {
        throw new ServiceUnavailableException("Host Tracker "
                + RestMessages.SERVICEUNAVAILABLE.toString());
    }

    return new Hosts(hostTracker.getInactiveStaticHosts());
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:34,代码来源:HostTrackerNorthbound.java

示例9: getAllPools

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@Path("/{containerName}")
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(Pools.class)
@StatusCodes( {
    @ResponseCode(code = 200, condition = "Operation successful"),
    @ResponseCode(code = 404, condition = "The containerName is not found"),
    @ResponseCode(code = 503, condition = "Load balancer service is unavailable") })
public Pools getAllPools(
        @PathParam("containerName") String containerName) {

    IConfigManager configManager = getConfigManagerService(containerName);
    if (configManager == null) {
        throw new ServiceUnavailableException("Load Balancer "
                                                + RestMessages.SERVICEUNAVAILABLE.toString());
    }

    return new Pools(configManager.getAllPools());
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:20,代码来源:LoadBalancerNorthbound.java

示例10: getAllVIPs

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@Path("/{containerName}/vips")
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(VIPs.class)
@StatusCodes( {
    @ResponseCode(code = 200, condition = "Operation successful"),
    @ResponseCode(code = 404, condition = "The containerName is not found"),
    @ResponseCode(code = 503, condition = "Load balancer service is unavailable") })
public VIPs getAllVIPs(
        @PathParam("containerName") String containerName) {

    IConfigManager configManager = getConfigManagerService(containerName);
    if (configManager == null) {
        throw new ServiceUnavailableException("Load Balancer "
                + RestMessages.SERVICEUNAVAILABLE.toString());
    }

    return new VIPs(configManager.getAllVIPs());
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:20,代码来源:LoadBalancerNorthbound.java

示例11: getHello

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@Path("/{containerName}/hello/{helloId}")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(HelloDTO.class)
public Response getHello(@PathParam("containerName") String containerName,
        @PathParam("helloId") String helloId) {
    HelloService service = (HelloService) ServiceHelper.getGlobalInstance(
            HelloService.class, this);

    GetHelloInput input = new GetHelloInputBuilder().setHelloId(helloId)
            .build();
    Future<RpcResult<GetHelloOutput>> output = service.getHello(input);
    try {
        if (output.get().getResult() != null) {
            log.debug("RESULT: {}", output.get().getResult().getName());
            return Response.ok(
                    new HelloDTO(output.get().getResult().getName(),
                            output.get().getResult().getValue())).build();
        } else {
            return Response.status(404).build();
        }
    } catch (InterruptedException | ExecutionException e) {
        log.error("Unexpected exception when attempting to GET", e);
        return Response.serverError().build();
    }
}
 
开发者ID:davidkbainbridge,项目名称:odl-sample-service,代码行数:27,代码来源:Northbound.java

示例12: get

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@GET
@Produces(Protocol.MIME_TYPES_ALL)
@TypeHint(Stream.class)
public Response get(
        @QueryParam(Protocol.PARAMETER_DEFAULT_GRAPH) final List<String> defaultGraphs,
        @QueryParam(Protocol.PARAMETER_NAMED_GRAPH) final List<String> namedGraphs,
        @QueryParam(Protocol.PARAMETER_QUERY) final String query) throws OperationException {
    return query(query, defaultGraphs, namedGraphs);
}
 
开发者ID:dkmfbk,项目名称:knowledgestore,代码行数:10,代码来源:Sparql.java

示例13: postURLencoded

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@POST
@Consumes("application/x-www-form-urlencoded")
@Produces(Protocol.MIME_TYPES_ALL)
@TypeHint(Stream.class)
public Response postURLencoded(
        @FormParam(Protocol.PARAMETER_DEFAULT_GRAPH) final List<String> defaultGraphs,
        @FormParam(Protocol.PARAMETER_NAMED_GRAPH) final List<String> namedGraphs,
        @FormParam(Protocol.PARAMETER_QUERY) final String query) throws OperationException {
    return query(query, defaultGraphs, namedGraphs);
}
 
开发者ID:dkmfbk,项目名称:knowledgestore,代码行数:11,代码来源:Sparql.java

示例14: postDirect

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
@POST
@Consumes("application/sparql-query")
@Produces(Protocol.MIME_TYPES_ALL)
@TypeHint(Stream.class)
public Response postDirect(
        @QueryParam(Protocol.PARAMETER_DEFAULT_GRAPH) final List<String> defaultGraphs,
        @QueryParam(Protocol.PARAMETER_NAMED_GRAPH) final List<String> namedGraphs,
        final String query) throws OperationException {
    return query(query, defaultGraphs, namedGraphs);
}
 
开发者ID:dkmfbk,项目名称:knowledgestore,代码行数:11,代码来源:Sparql.java

示例15: createBgpvpns

import org.codehaus.enunciate.jaxrs.TypeHint; //导入依赖的package包/类
/**
 * Creates new Bgpvpns.
 */
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@TypeHint(NeutronBgpvpn.class)
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createBgpvpns(final NeutronBgpvpnRequest input) {
    return create(input);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:13,代码来源:NeutronBgpvpnsNorthbound.java


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