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


Java Authorization类代码示例

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


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

示例1: list

import io.swagger.annotations.Authorization; //导入依赖的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

示例2: listAllCustomerEvents

import io.swagger.annotations.Authorization; //导入依赖的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

示例3: getCustomerServiceMetadata

import io.swagger.annotations.Authorization; //导入依赖的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

示例4: listAll

import io.swagger.annotations.Authorization; //导入依赖的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

示例5: list

import io.swagger.annotations.Authorization; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=accountoverview;v=1"})
@ApiOperation(value = "lists accounts", response = AccountsRepresentation.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 account"),
                @ExtensionProperty(name = "customer", value = "customer only allowed getting own accounts")}
        )},
        produces = "application/hal+json, application/hal+json;concept=accountoverview;v=1",
        notes = "List all accounts in a default projection, which is AccountOverview version 1" +
                "Supported projections and versions are: " +
                "AccountOverview in version 1 " +
                "The Accept header for the default version is application/hal+json;concept=AccountOverview;v=1.0.0.... " +
                "The format for the default version is {....}", nickname = "listAccounts")
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response list(@Context UriInfo uriInfo, @Context Request request, @QueryParam("customer") @DefaultValue("0") String customer, @HeaderParam("Accept") String accept) {
    return accountsProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request, customer);
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:27,代码来源:AccountServiceExposure.java

示例6: getMetadata

import io.swagger.annotations.Authorization; //导入依赖的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 account service should be able to listen for and react to. In other words this is the authoritative" +
                "feed for the account service",
        tags = {"events"},
        produces = "application/hal+json,  application/hal+json;concept=metadata;v=1",
        nickname = "getAccountMetadata"
    )
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response getMetadata(@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,代码来源:AccountEventFeedMetadataServiceExposure.java

示例7: list

import io.swagger.annotations.Authorization; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=location;v=1"})
@ApiOperation(value = "lists locations", response = LocationsRepresentation.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 location"),
                @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 Location version 1" +
                "Supported projections and versions are: " +
                "Locations in version 1 " +
                "The Accept header for the default version is application/hal+json;concept=location;v=1.0.0.... " +
                "The format for the default version is {....}", nickname = "listLocations")
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response list(@Context UriInfo uriInfo, @Context Request request, @HeaderParam("Accept") String accept) {
    return locationsProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request);
}
 
开发者ID:psd2-in-a-box,项目名称:mid-tier,代码行数:27,代码来源:LocationServiceExposure.java

示例8: listAll

import io.swagger.annotations.Authorization; //导入依赖的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 = "listLocationAllEvents"
    )
@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,代码来源:LocationEventServiceExposure.java

示例9: getMetadata

import io.swagger.annotations.Authorization; //导入依赖的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 = "getLocationMetadata"
    )
@ApiResponses(value = {
        @ApiResponse(code = 415, message = "Content type not supported.")
    })
public Response getMetadata(@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,代码来源:LocationEventFeedMetadataServiceExposure.java

示例10: shutdown

import io.swagger.annotations.Authorization; //导入依赖的package包/类
@POST
@Path("/shutdown")
@ApiOperation(value = "Shutdown SDC", authorizations = @Authorization(value = "basic"))
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({AuthzRole.ADMIN, AuthzRole.ADMIN_REMOTE})
public Response shutdown() throws PipelineStoreException {
  Thread thread = new Thread("Shutdown Request") {
    @Override
    public void run() {
      // sleeping  500ms to allow the HTTP response to go back
      ThreadUtil.sleep(500);
      runtimeInfo.shutdown(0);
    }
  };
  thread.setDaemon(true);
  thread.start();
  return Response.ok().build();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:19,代码来源:AdminResource.java

示例11: restart

import io.swagger.annotations.Authorization; //导入依赖的package包/类
@POST
@Path("/restart")
@ApiOperation(value = "Restart SDC", authorizations = @Authorization(value = "basic"))
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({AuthzRole.ADMIN, AuthzRole.ADMIN_REMOTE})
public Response restart() throws PipelineStoreException {
  Thread thread = new Thread("Shutdown Request") {
    @Override
    public void run() {
      // sleeping  500ms to allow the HTTP response to go back
      ThreadUtil.sleep(500);
      runtimeInfo.shutdown(88);
    }
  };
  thread.setDaemon(true);
  thread.start();
  return Response.ok().build();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:19,代码来源:AdminResource.java

示例12: getThreadsDump

import io.swagger.annotations.Authorization; //导入依赖的package包/类
@GET
@Path("/threads")
@ApiOperation(value = "Returns Thread Dump along with stack trace", response = Map.class, responseContainer = "List",
  authorizations = @Authorization(value = "basic"))
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({AuthzRole.ADMIN, AuthzRole.ADMIN_REMOTE})
public Response getThreadsDump() throws IOException {
  ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
  ThreadInfo[] threads = threadMXBean.dumpAllThreads(true, true);
  List<Map> augmented = new ArrayList<>(threads.length);
  for (ThreadInfo thread : threads) {
    Map<String, Object> map = new LinkedHashMap<>();
    map.put("threadInfo", thread);
    map.put("userTimeNanosecs", threadMXBean.getThreadUserTime(thread.getThreadId()));
    map.put("cpuTimeNanosecs", threadMXBean.getThreadCpuTime(thread.getThreadId()));
    augmented.add(map);
  }
  return Response.ok(augmented).build();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:20,代码来源:AdminResource.java

示例13: list

import io.swagger.annotations.Authorization; //导入依赖的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

示例14: getUsers

import io.swagger.annotations.Authorization; //导入依赖的package包/类
@GET
@Path("/users")
@ApiOperation(
    value = "Returns All Users Info",
    response = UserJson.class,
    responseContainer = "List",
    authorizations = @Authorization(value = "basic")
)
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({
    AuthzRole.ADMIN,
    AuthzRole.ADMIN_REMOTE,
    AuthzRole.CREATOR,
    AuthzRole.CREATOR_REMOTE
})
public Response getUsers() throws IOException {
  return Response.ok(userGroupManager.getUsers()).build();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:19,代码来源:AdminResource.java

示例15: getGroups

import io.swagger.annotations.Authorization; //导入依赖的package包/类
@GET
@Path("/groups")
@ApiOperation(
    value = "Returns All Group names",
    response = UserJson.class,
    responseContainer = "List",
    authorizations = @Authorization(value = "basic")
)
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({
    AuthzRole.ADMIN,
    AuthzRole.ADMIN_REMOTE,
    AuthzRole.CREATOR,
    AuthzRole.CREATOR_REMOTE
})
public Response getGroups() throws IOException {
  return Response.ok(userGroupManager.getGroups()).build();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:19,代码来源:AdminResource.java


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