• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TypeHint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: createVPNService

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


示例17: createNetworks

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


示例18: createVpnIkePolicy

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


示例19: createVpnIPSecSiteConnection

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


示例20: createVpnIPSecPolicy

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AnnotationCommandHandlerBeanPostProcessor类代码示例发布时间:2022-05-23
下一篇:
Java ObjectLinkedOpenHashSet类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap