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


Java ResponseCode类代码示例

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


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

示例1: showPort

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Returns a specific Port.
 */

@Path("{portUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackPorts.class)
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showPort(@PathParam("portUUID") String portUUID,
        // return fields
        @QueryParam("fields") List<String> fields) {
    return show(portUUID, fields);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:19,代码来源:NeutronPortsNorthbound.java

示例2: updateLoadBalancerPoolMember

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Updates a LB member pool.
 */

@Path("{loadBalancerPoolUUID}/members/{loadBalancerPoolMemberUUID}")
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found") })
public Response updateLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
        @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
        final NeutronLoadBalancerPoolMemberRequest input) {
    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
    NeutronLoadBalancerPool singletonPool = loadBalancerPoolInterface.get(loadBalancerPoolUUID);
    NeutronLoadBalancerPoolMember singleton = input.getSingleton();
    singleton.setPoolID(loadBalancerPoolUUID);

    if (singletonPool == null) {
        throw new ResourceNotFoundException("Pool doesn't Exist");
    }
    loadBalancerPoolInterface.updateNeutronLoadBalancerPoolMember(loadBalancerPoolUUID, loadBalancerPoolMemberUUID,
            singleton);
    return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:26,代码来源:NeutronLoadBalancerPoolNorthbound.java

示例3: showMeteringLabelRule

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Returns a specific metering label rule.
 */

@Path("{ruleUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
        @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showMeteringLabelRule(@PathParam("ruleUUID") String ruleUUID,
        // return fields
        @QueryParam("fields") List<String> fields) {
    return show(ruleUUID, fields);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:19,代码来源:NeutronMeteringLabelRulesNorthbound.java

示例4: createMeteringLabelRule

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Creates new metering label rule.
 */
@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 createMeteringLabelRule(final NeutronMeteringLabelRuleRequest input) {
    INeutronMeteringLabelRuleCRUD meteringLabelRuleInterface = getNeutronCRUD();
    if (input.isSingleton()) {
        NeutronMeteringLabelRule singleton = input.getSingleton();

        /*
         * add meteringLabelRule to the cache
         */
        meteringLabelRuleInterface.add(singleton);
    } else {

        /*
         * only singleton meteringLabelRule creates supported
         */
        throw new BadRequestException("Only singleton meteringLabelRule creates supported");
    }
    return Response.status(HttpURLConnection.HTTP_CREATED).entity(input).build();
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:28,代码来源:NeutronMeteringLabelRulesNorthbound.java

示例5: createTapFlow

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Creates new Tap Flow.
 */
@Path("{tapServiceUUID}/flows")
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createTapFlow(@PathParam("tapServiceUUID") String tapServiceUUID,
                              final NeutronTapFlowRequest input) {

    INeutronTapFlowCRUD tapFlowInterface = getNeutronCRUD();

    if (input.isSingleton()) {
        NeutronTapFlow singleton = input.getSingleton();
        singleton.setTapFlowServiceID(tapServiceUUID);

        tapFlowInterface.addTapFlow(singleton);
    } else {
        throw new BadRequestException("Only Singleton tapFlow creation supported");
    }

    return Response.status(HttpURLConnection.HTTP_CREATED).entity(input).build();
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:26,代码来源:NeutronTapFlowNorthbound.java

示例6: updateTapFlow

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Updates a Tap Flow.
 */
@Path("{tapServiceUUID}/flows/{tapFlowUUID}")
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response updateTapFlow(@PathParam("tapServiceUUID") String tapServiceUUID,
                              @PathParam("tapFlowUUID") String tapFlowUUID,
                              final NeutronTapFlowRequest input) {

    INeutronTapFlowCRUD tapFlowInterface = getNeutronCRUD();

    if (!tapFlowInterface.tapFlowExists(tapServiceUUID, tapFlowUUID)) {
        throw new ResourceNotFoundException("Specified UUID does not Exist");
    }

    NeutronTapFlow singleton = input.getSingleton();
    singleton.setTapFlowServiceID(tapServiceUUID);
    tapFlowInterface.updateTapFlow(singleton);

    return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:27,代码来源:NeutronTapFlowNorthbound.java

示例7: showLoadBalancer

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Returns a specific LoadBalancer.
 */

@Path("{loadBalancerID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })

@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID,
        // return fields
        @QueryParam("fields") List<String> fields) {
    return show(loadBalancerID, fields);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:19,代码来源:NeutronLoadBalancerNorthbound.java

示例8: showLoadBalancerHealthMonitor

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Returns a specific LoadBalancerHealthMonitor.
 */

@Path("{loadBalancerHealthMonitorID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showLoadBalancerHealthMonitor(
        @PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
        // return fields
        @QueryParam("fields") List<String> fields) {
    return show(loadBalancerHealthMonitorID, fields);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:19,代码来源:NeutronLoadBalancerHealthMonitorNorthbound.java

示例9: showMeteringLabel

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Returns a specific metering label.
 */

@Path("{labelUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
        @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showMeteringLabel(@PathParam("labelUUID") String labelUUID,
        // return fields
        @QueryParam("fields") List<String> fields) {
    return show(labelUUID, fields);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:19,代码来源:NeutronMeteringLabelsNorthbound.java

示例10: createL2gatewayConnection

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Creates L2gateway Connection.
 * @param  input contains connection details
 * @return status
 */
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
        @ResponseCode(code = HttpURLConnection.HTTP_BAD_REQUEST, condition = "Bad Request"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
        @ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_CONFLICT, condition = "Conflict"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })

public Response createL2gatewayConnection(final NeutronL2gatewayConnectionRequest input) {
    LOG.debug("createL2GatewayConnection   NeutronL2GatewayConnectionRequest");
    return create(input);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:22,代码来源:NeutronL2gatewayConnectionNorthbound.java

示例11: deleteQosPolicy

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Deletes a Qos Policy.
 */
@Path("{qosPolicyUUID}")
@DELETE
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response deleteQosPolicy(@PathParam("qosPolicyUUID") String qosPolicyUUID) {
    return delete(qosPolicyUUID);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:12,代码来源:NeutronQosPolicyNorthbound.java

示例12: updateFirewall

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Updates a Firewall.
 */

@Path("{firewallUUID}")
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response updateFirewall(@PathParam("firewallUUID") String firewallUUID, final NeutronFirewallRequest input) {
    return update(firewallUUID, input);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:15,代码来源:NeutronFirewallNorthbound.java

示例13: createSFCPortPair

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

示例14: showTapService

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Returns a specific Tap Service.
 */
@Path("{tapServiceUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showTapService(@PathParam("tapServiceUUID") String tapServiceUUID,
        @QueryParam("fields") List<String> fields) {
    return show(tapServiceUUID, fields);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:16,代码来源:NeutronTapServiceNorthbound.java

示例15: deleteVpnIPSecPolicy

import org.codehaus.enunciate.jaxrs.ResponseCode; //导入依赖的package包/类
/**
 * Deletes a VPN IPSEC Policy.
 */

@Path("{policyID}")
@DELETE
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
        @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
        @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response deleteVpnIPSecPolicy(@PathParam("policyID") String policyUUID) {
    return delete(policyUUID);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:13,代码来源:NeutronVpnIpSecPoliciesNorthbound.java


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