Search in sources :

Example 46 with PathParam

use of javax.ws.rs.PathParam in project keywhiz by square.

the class ClientResource method modifyClientGroups.

/**
 * Modify groups a client has membership in
 *
 * @param name    Client name
 * @param request JSON request specifying which groups to add or remove
 * @return Listing of groups client has membership in
 * <p>
 * responseMessage 201 Client modified successfully
 * <p>
 * responseMessage 404 Client not found
 */
@Timed
@ExceptionMetered
@PUT
@Path("{name}/groups")
@Produces(APPLICATION_JSON)
public Iterable<String> modifyClientGroups(@Auth AutomationClient automationClient, @PathParam("name") String name, @Valid ModifyGroupsRequestV2 request) {
    Client client = clientDAOReadWrite.getClientByName(name).orElseThrow(NotFoundException::new);
    String user = automationClient.getName();
    long clientId = client.getId();
    Set<String> oldGroups = aclDAOReadWrite.getGroupsFor(client).stream().map(Group::getName).collect(toSet());
    Set<String> groupsToAdd = Sets.difference(request.addGroups(), oldGroups);
    Set<String> groupsToRemove = Sets.intersection(request.removeGroups(), oldGroups);
    // TODO: should optimize AclDAO to use names and return only name column
    groupsToGroupIds(groupsToAdd).forEach((maybeGroupId) -> maybeGroupId.ifPresent((groupId) -> aclDAOReadWrite.findAndEnrollClient(clientId, groupId, auditLog, user, new HashMap<>())));
    groupsToGroupIds(groupsToRemove).forEach((maybeGroupId) -> maybeGroupId.ifPresent((groupId) -> aclDAOReadWrite.findAndEvictClient(clientId, groupId, auditLog, user, new HashMap<>())));
    return aclDAOReadWrite.getGroupsFor(client).stream().map(Group::getName).collect(toSet());
}
Also used : Produces(javax.ws.rs.Produces) Event(keywhiz.log.Event) URISyntaxException(java.net.URISyntaxException) Path(javax.ws.rs.Path) LoggerFactory(org.slf4j.LoggerFactory) GroupDAOFactory(keywhiz.service.daos.GroupDAO.GroupDAOFactory) Valid(javax.validation.Valid) ClientDAOFactory(keywhiz.service.daos.ClientDAO.ClientDAOFactory) Consumes(javax.ws.rs.Consumes) ExceptionMetered(com.codahale.metrics.annotation.ExceptionMetered) ModifyGroupsRequestV2(keywhiz.api.automation.v2.ModifyGroupsRequestV2) BadRequestException(javax.ws.rs.BadRequestException) UriBuilder(javax.ws.rs.core.UriBuilder) URI(java.net.URI) Client(keywhiz.api.model.Client) APPLICATION_JSON(javax.ws.rs.core.MediaType.APPLICATION_JSON) GroupDAO(keywhiz.service.daos.GroupDAO) Collectors.toSet(java.util.stream.Collectors.toSet) DELETE(javax.ws.rs.DELETE) Tracing.setTag(keywhiz.Tracing.setTag) Group(keywhiz.api.model.Group) Tracing.tagErrors(keywhiz.Tracing.tagErrors) Set(java.util.Set) ConflictException(keywhiz.service.exceptions.ConflictException) Instant(java.time.Instant) Sets(com.google.common.collect.Sets) NotFoundException(javax.ws.rs.NotFoundException) String.format(java.lang.String.format) Timed(com.codahale.metrics.annotation.Timed) Stream(java.util.stream.Stream) Response(javax.ws.rs.core.Response) Optional(java.util.Optional) SanitizedSecret(keywhiz.api.model.SanitizedSecret) NotImplementedException(org.apache.commons.lang3.NotImplementedException) PathParam(javax.ws.rs.PathParam) AclDAO(keywhiz.service.daos.AclDAO) ClientDAO(keywhiz.service.daos.ClientDAO) GET(javax.ws.rs.GET) ClientDetailResponseV2(keywhiz.api.automation.v2.ClientDetailResponseV2) Auth(io.dropwizard.auth.Auth) HashMap(java.util.HashMap) Inject(javax.inject.Inject) AutomationClient(keywhiz.api.model.AutomationClient) CreateClientRequestV2(keywhiz.api.automation.v2.CreateClientRequestV2) AuditLog(keywhiz.log.AuditLog) ModifyClientRequestV2(keywhiz.api.automation.v2.ModifyClientRequestV2) POST(javax.ws.rs.POST) Logger(org.slf4j.Logger) AclDAOFactory(keywhiz.service.daos.AclDAO.AclDAOFactory) EventTag(keywhiz.log.EventTag) PUT(javax.ws.rs.PUT) NotFoundException(javax.ws.rs.NotFoundException) Client(keywhiz.api.model.Client) AutomationClient(keywhiz.api.model.AutomationClient) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) Timed(com.codahale.metrics.annotation.Timed) ExceptionMetered(com.codahale.metrics.annotation.ExceptionMetered) PUT(javax.ws.rs.PUT)

Example 47 with PathParam

use of javax.ws.rs.PathParam in project alluxio by Alluxio.

the class S3RestServiceHandler method postBucket.

/**
 * Currently implements the DeleteObjects request type if the query parameter "delete" exists.
 *
 * @param bucket the bucket name
 * @param delete the delete query parameter. Existence indicates to run the DeleteObjects impl
 * @param contentLength body content length
 * @param is the input stream to read the request
 *
 * @return a {@link DeleteObjectsResult} if this was a DeleteObjects request
 */
@POST
@Path(BUCKET_PARAM)
public Response postBucket(@PathParam("bucket") final String bucket, @QueryParam("delete") String delete, @HeaderParam("Content-Length") int contentLength, final InputStream is) {
    return S3RestUtils.call(bucket, () -> {
        if (delete != null) {
            try {
                DeleteObjectsRequest request = new XmlMapper().readerFor(DeleteObjectsRequest.class).readValue(is);
                List<DeleteObjectsRequest.DeleteObject> objs = request.getToDelete();
                List<DeleteObjectsResult.DeletedObject> success = new ArrayList<>();
                List<DeleteObjectsResult.ErrorObject> errored = new ArrayList<>();
                objs.sort(Comparator.comparingInt(x -> -1 * x.getKey().length()));
                objs.forEach(obj -> {
                    try {
                        AlluxioURI uri = new AlluxioURI(AlluxioURI.SEPARATOR + bucket).join(AlluxioURI.SEPARATOR + obj.getKey());
                        DeletePOptions options = DeletePOptions.newBuilder().build();
                        mFileSystem.delete(uri, options);
                        DeleteObjectsResult.DeletedObject del = new DeleteObjectsResult.DeletedObject();
                        del.setKey(obj.getKey());
                        success.add(del);
                    } catch (FileDoesNotExistException | DirectoryNotEmptyException e) {
                        /*
              FDNE - delete on FDNE should be counted as a success, as there's nothing to do
              DNE - s3 has no concept dirs - if it _is_ a dir, nothing to delete.
               */
                        DeleteObjectsResult.DeletedObject del = new DeleteObjectsResult.DeletedObject();
                        del.setKey(obj.getKey());
                        success.add(del);
                    } catch (IOException | AlluxioException e) {
                        DeleteObjectsResult.ErrorObject err = new DeleteObjectsResult.ErrorObject();
                        err.setKey(obj.getKey());
                        err.setMessage(e.getMessage());
                        errored.add(err);
                    }
                });
                DeleteObjectsResult result = new DeleteObjectsResult();
                if (!request.getQuiet()) {
                    result.setDeleted(success);
                }
                result.setErrored(errored);
                return result;
            } catch (IOException e) {
                LOG.debug("Failed to parse DeleteObjects request:", e);
                return Response.Status.BAD_REQUEST;
            }
        } else {
            return Response.Status.OK;
        }
    });
}
Also used : CreateFilePOptions(alluxio.grpc.CreateFilePOptions) Produces(javax.ws.rs.Produces) Date(java.util.Date) LoggerFactory(org.slf4j.LoggerFactory) Path(javax.ws.rs.Path) PropertyKey(alluxio.conf.PropertyKey) MediaType(javax.ws.rs.core.MediaType) FileSystem(alluxio.client.file.FileSystem) QueryParam(javax.ws.rs.QueryParam) User(alluxio.security.User) Consumes(javax.ws.rs.Consumes) HeaderParam(javax.ws.rs.HeaderParam) DELETE(javax.ws.rs.DELETE) Context(javax.ws.rs.core.Context) ServerConfiguration(alluxio.conf.ServerConfiguration) AlluxioException(alluxio.exception.AlluxioException) Collectors(java.util.stream.Collectors) IOUtils(org.apache.commons.io.IOUtils) ProxyWebServer(alluxio.web.ProxyWebServer) DigestOutputStream(java.security.DigestOutputStream) List(java.util.List) Response(javax.ws.rs.core.Response) ByteStreams(com.google.common.io.ByteStreams) FileDoesNotExistException(alluxio.exception.FileDoesNotExistException) InstancedConfiguration(alluxio.conf.InstancedConfiguration) HEAD(javax.ws.rs.HEAD) PathParam(javax.ws.rs.PathParam) CreateDirectoryPOptions(alluxio.grpc.CreateDirectoryPOptions) GET(javax.ws.rs.GET) MessageDigest(java.security.MessageDigest) XmlMapper(com.fasterxml.jackson.dataformat.xml.XmlMapper) Hex(org.apache.commons.codec.binary.Hex) FileOutStream(alluxio.client.file.FileOutStream) ArrayList(java.util.ArrayList) DeletePOptions(alluxio.grpc.DeletePOptions) Constants(alluxio.Constants) DirectoryNotEmptyException(alluxio.exception.DirectoryNotEmptyException) AlluxioURI(alluxio.AlluxioURI) FileInStream(alluxio.client.file.FileInStream) ListStatusPOptions(alluxio.grpc.ListStatusPOptions) Logger(org.slf4j.Logger) POST(javax.ws.rs.POST) BaseEncoding(com.google.common.io.BaseEncoding) FileAlreadyExistsException(alluxio.exception.FileAlreadyExistsException) IOException(java.io.IOException) Subject(javax.security.auth.Subject) URIStatus(alluxio.client.file.URIStatus) Preconditions(com.google.common.base.Preconditions) ServletContext(javax.servlet.ServletContext) PUT(javax.ws.rs.PUT) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Comparator(java.util.Comparator) InputStream(java.io.InputStream) NotThreadSafe(javax.annotation.concurrent.NotThreadSafe) FileDoesNotExistException(alluxio.exception.FileDoesNotExistException) ArrayList(java.util.ArrayList) DirectoryNotEmptyException(alluxio.exception.DirectoryNotEmptyException) IOException(java.io.IOException) XmlMapper(com.fasterxml.jackson.dataformat.xml.XmlMapper) DeletePOptions(alluxio.grpc.DeletePOptions) AlluxioURI(alluxio.AlluxioURI) AlluxioException(alluxio.exception.AlluxioException) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 48 with PathParam

use of javax.ws.rs.PathParam in project Payara by payara.

the class RestMethodMetadata method processParameters.

/**
 * Process the parameters for the method.  Any parameter marked <code>@PathParam</code> is ignored, since JAX-RS
 * handles setting that value, meaning its presence need not be exposed to the client.  Any parameter marked with
 * <code>@QueryParameter</code> is stored in the <code>queryParameter</code> list.  Anything left is considered the
 * type of the request body. There should be only one of these.
 * @param method
 */
private void processParameters(Method method) {
    Type[] paramTypes = method.getGenericParameterTypes();
    Annotation[][] paramAnnos = method.getParameterAnnotations();
    int paramCount = paramTypes.length;
    for (int i = 0; i < paramCount; i++) {
        boolean processed = false;
        boolean isPathParam = false;
        Type paramType = paramTypes[i];
        for (Annotation annotation : paramAnnos[i]) {
            processed = (annotation instanceof Suspended) || (annotation instanceof PathParam);
            if (annotation instanceof QueryParam) {
                queryParameters.add(new ParamMetadata(context, paramType, ((QueryParam) annotation).value(), paramAnnos[i]));
                processed = true;
            }
        }
        if (!processed && !isPathParam) {
            requestPayload = calculateParameterType(paramType);
        }
    }
}
Also used : ParameterizedType(java.lang.reflect.ParameterizedType) Type(java.lang.reflect.Type) QueryParam(javax.ws.rs.QueryParam) Suspended(javax.ws.rs.container.Suspended) PathParam(javax.ws.rs.PathParam) Annotation(java.lang.annotation.Annotation)

Example 49 with PathParam

use of javax.ws.rs.PathParam in project kylo by Teradata.

the class FeedRestController method getAllowedActions.

@GET
@Path("{feedId}/actions/allowed")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Gets the list of actions permitted for the given username and/or groups.")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns the actions.", response = ActionGroup.class), @ApiResponse(code = 404, message = "A feed with the given ID does not exist.", response = RestResponseStatus.class) })
public Response getAllowedActions(@PathParam("feedId") String feedIdStr, @QueryParam("user") Set<String> userNames, @QueryParam("group") Set<String> groupNames) {
    log.debug("Get allowed actions for feed: {}", feedIdStr);
    Set<? extends Principal> users = Arrays.stream(this.securityTransform.asUserPrincipals(userNames)).collect(Collectors.toSet());
    Set<? extends Principal> groups = Arrays.stream(this.securityTransform.asGroupPrincipals(groupNames)).collect(Collectors.toSet());
    return this.securityService.getAllowedFeedActions(feedIdStr, Stream.concat(users.stream(), groups.stream()).collect(Collectors.toSet())).map(g -> Response.ok(g).build()).orElseThrow(() -> new WebApplicationException("A feed with the given ID does not exist: " + feedIdStr, Status.NOT_FOUND));
}
Also used : Arrays(java.util.Arrays) RegisteredTemplateService(com.thinkbiganalytics.feedmgr.service.template.RegisteredTemplateService) Produces(javax.ws.rs.Produces) DatasourceDefinitions(com.thinkbiganalytics.metadata.rest.model.data.DatasourceDefinitions) DatasourceDefinition(com.thinkbiganalytics.metadata.rest.model.data.DatasourceDefinition) StringUtils(org.apache.commons.lang3.StringUtils) FeedModelTransform(com.thinkbiganalytics.feedmgr.service.feed.FeedModelTransform) NifiClientRuntimeException(com.thinkbiganalytics.nifi.rest.client.NifiClientRuntimeException) MediaType(javax.ws.rs.core.MediaType) HiveService(com.thinkbiganalytics.hive.service.HiveService) Map(java.util.Map) AccessController(com.thinkbiganalytics.security.AccessController) NifiFeed(com.thinkbiganalytics.feedmgr.rest.model.NifiFeed) Sort(org.springframework.data.domain.Sort) FeedServicesAccessControl(com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl) FeedCleanupTimeoutException(com.thinkbiganalytics.feedmgr.service.FeedCleanupTimeoutException) EnumSet(java.util.EnumSet) MetadataService(com.thinkbiganalytics.feedmgr.service.MetadataService) PermissionsChange(com.thinkbiganalytics.security.rest.model.PermissionsChange) NifiProperty(com.thinkbiganalytics.nifi.rest.model.NifiProperty) FeedCleanupFailedException(com.thinkbiganalytics.feedmgr.service.FeedCleanupFailedException) ActionGroup(com.thinkbiganalytics.security.rest.model.ActionGroup) MetadataAccessControl(com.thinkbiganalytics.metadata.api.security.MetadataAccessControl) PageRequest(org.springframework.data.domain.PageRequest) Set(java.util.Set) Page(org.springframework.data.domain.Page) EntityVersionDifference(com.thinkbiganalytics.feedmgr.rest.model.EntityVersionDifference) FeedPropertyType(com.thinkbiganalytics.metadata.FeedPropertyType) Stream(java.util.stream.Stream) WebApplicationException(javax.ws.rs.WebApplicationException) RoleMembershipChange(com.thinkbiganalytics.security.rest.model.RoleMembershipChange) BodyPartEntity(org.glassfish.jersey.media.multipart.BodyPartEntity) AccessDeniedException(java.nio.file.AccessDeniedException) SecurityModelTransform(com.thinkbiganalytics.security.rest.controller.SecurityModelTransform) GET(javax.ws.rs.GET) FeedPropertySection(com.thinkbiganalytics.metadata.FeedPropertySection) FeedMetadata(com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata) HiveUtils(com.thinkbiganalytics.hive.util.HiveUtils) AnnotationFieldNameResolver(com.thinkbiganalytics.annotations.AnnotationFieldNameResolver) StandardCopyOption(java.nio.file.StandardCopyOption) ArrayList(java.util.ArrayList) Lists(com.google.common.collect.Lists) RestResponseStatus(com.thinkbiganalytics.rest.model.RestResponseStatus) ResourceBundle(java.util.ResourceBundle) DeployFeedException(com.thinkbiganalytics.feedmgr.service.feed.DeployFeedException) FieldUtils(org.apache.commons.lang3.reflect.FieldUtils) Api(io.swagger.annotations.Api) DuplicateFeedNameException(com.thinkbiganalytics.feedmgr.service.feed.DuplicateFeedNameException) Files(java.nio.file.Files) SecurityService(com.thinkbiganalytics.feedmgr.service.security.SecurityService) IOException(java.io.IOException) Pair(com.thinkbiganalytics.search.rest.model.Pair) SearchResult(com.thinkbiganalytics.rest.model.search.SearchResult) FeedCurrentlyRunningException(com.thinkbiganalytics.feedmgr.service.feed.reindexing.FeedCurrentlyRunningException) File(java.io.File) Paths(java.nio.file.Paths) SwaggerDefinition(io.swagger.annotations.SwaggerDefinition) ApiResponse(io.swagger.annotations.ApiResponse) Strings(org.apache.directory.api.util.Strings) LoggerFactory(org.slf4j.LoggerFactory) Path(javax.ws.rs.Path) ClientErrorException(javax.ws.rs.ClientErrorException) ApiOperation(io.swagger.annotations.ApiOperation) QueryParam(javax.ws.rs.QueryParam) Consumes(javax.ws.rs.Consumes) JDBCException(org.hibernate.JDBCException) BodyPart(org.glassfish.jersey.media.multipart.BodyPart) NifiPropertyUtil(com.thinkbiganalytics.nifi.rest.support.NifiPropertyUtil) DefaultValue(javax.ws.rs.DefaultValue) ChangeType(com.thinkbiganalytics.security.rest.model.PermissionsChange.ChangeType) DELETE(javax.ws.rs.DELETE) FeedVersions(com.thinkbiganalytics.feedmgr.rest.model.FeedVersions) DeployResponseEntityVersion(com.thinkbiganalytics.feedmgr.rest.model.DeployResponseEntityVersion) FeedHistoryDataReindexingNotEnabledException(com.thinkbiganalytics.feedmgr.service.feed.reindexing.FeedHistoryDataReindexingNotEnabledException) Collection(java.util.Collection) InternalServerErrorException(javax.ws.rs.InternalServerErrorException) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) EditFeedEntity(com.thinkbiganalytics.feedmgr.rest.model.EditFeedEntity) NotFoundException(javax.ws.rs.NotFoundException) AnnotatedFieldProperty(com.thinkbiganalytics.annotations.AnnotatedFieldProperty) EntityVersion(com.thinkbiganalytics.feedmgr.rest.model.EntityVersion) FeedSummary(com.thinkbiganalytics.feedmgr.rest.model.FeedSummary) List(java.util.List) Generex(com.mifmif.common.regex.Generex) Principal(java.security.Principal) Response(javax.ws.rs.core.Response) AccessControlException(java.security.AccessControlException) PageImpl(org.springframework.data.domain.PageImpl) PreconditionRule(com.thinkbiganalytics.policy.rest.model.PreconditionRule) DataAccessException(org.springframework.dao.DataAccessException) PathParam(javax.ws.rs.PathParam) VersionNotFoundException(com.thinkbiganalytics.metadata.api.versioning.VersionNotFoundException) FormDataMultiPart(org.glassfish.jersey.media.multipart.FormDataMultiPart) ApiResponses(io.swagger.annotations.ApiResponses) Inject(javax.inject.Inject) UIFeed(com.thinkbiganalytics.feedmgr.rest.model.UIFeed) FeedManagerPreconditionService(com.thinkbiganalytics.feedmgr.service.feed.FeedManagerPreconditionService) PropertyExpressionResolver(com.thinkbiganalytics.feedmgr.nifi.PropertyExpressionResolver) ServiceLevelAgreementService(com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementService) Tag(io.swagger.annotations.Tag) Nonnull(javax.annotation.Nonnull) Status(javax.ws.rs.core.Response.Status) FeedNotFoundException(com.thinkbiganalytics.metadata.api.feed.FeedNotFoundException) FormParam(javax.ws.rs.FormParam) DatasourceService(com.thinkbiganalytics.feedmgr.service.datasource.DatasourceService) NifiConnectionException(com.thinkbiganalytics.nifi.rest.client.NifiConnectionException) Logger(org.slf4j.Logger) POST(javax.ws.rs.POST) FeedNameUtil(com.thinkbiganalytics.support.FeedNameUtil) FeedLineageStyle(com.thinkbiganalytics.metadata.rest.model.feed.FeedLineageStyle) FeedServiceLevelAgreement(com.thinkbiganalytics.metadata.rest.model.sla.FeedServiceLevelAgreement) Component(org.springframework.stereotype.Component) Comparator(java.util.Comparator) QueryResult(com.thinkbiganalytics.discovery.schema.QueryResult) InputStream(java.io.InputStream) WebApplicationException(javax.ws.rs.WebApplicationException) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 50 with PathParam

use of javax.ws.rs.PathParam in project kylo by Teradata.

the class DatasourceController method getAllowedPermissionsChange.

@GET
@Path("{id}/actions/change")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Constructs and returns a permission change request for a set of users/groups containing the actions that the requester may permit or revoke.")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns the change request that may be modified by the client and re-posted.", response = PermissionsChange.class), @ApiResponse(code = 400, message = "The type is not valid.", response = RestResponseStatus.class), @ApiResponse(code = 404, message = "No data source exists with the specified ID.", response = RestResponseStatus.class) })
public Response getAllowedPermissionsChange(@PathParam("id") final String datasourceIdStr, @QueryParam("type") final String changeType, @QueryParam("user") final Set<String> userNames, @QueryParam("group") final Set<String> groupNames) {
    if (StringUtils.isBlank(changeType)) {
        throw new WebApplicationException("The query parameter \"type\" is required", Response.Status.BAD_REQUEST);
    }
    Set<? extends Principal> users = Arrays.stream(this.securityTransform.asUserPrincipals(userNames)).collect(Collectors.toSet());
    Set<? extends Principal> groups = Arrays.stream(this.securityTransform.asGroupPrincipals(groupNames)).collect(Collectors.toSet());
    return this.securityService.createDatasourcePermissionChange(datasourceIdStr, PermissionsChange.ChangeType.valueOf(changeType.toUpperCase()), Stream.concat(users.stream(), groups.stream()).collect(Collectors.toSet())).map(p -> Response.ok(p).build()).orElseThrow(() -> new WebApplicationException("A data source with the given ID does not exist: " + datasourceIdStr, Response.Status.NOT_FOUND));
}
Also used : DatabaseType(com.thinkbiganalytics.jdbc.util.DatabaseType) Arrays(java.util.Arrays) JdbcDatasourceDetails(com.thinkbiganalytics.metadata.api.datasource.JdbcDatasourceDetails) Produces(javax.ws.rs.Produces) DatabaseMetadata(com.thinkbiganalytics.discovery.schema.DatabaseMetadata) LoggerFactory(org.slf4j.LoggerFactory) Path(javax.ws.rs.Path) DatasourceModelTransform(com.thinkbiganalytics.feedmgr.service.datasource.DatasourceModelTransform) Collections2(com.google.common.collect.Collections2) DatasourceDefinition(com.thinkbiganalytics.metadata.rest.model.data.DatasourceDefinition) StringUtils(org.apache.commons.lang3.StringUtils) Model(com.thinkbiganalytics.feedmgr.rest.Model) DatasourceDefinitionProvider(com.thinkbiganalytics.metadata.api.datasource.DatasourceDefinitionProvider) ApiOperation(io.swagger.annotations.ApiOperation) MediaType(javax.ws.rs.core.MediaType) QueryParam(javax.ws.rs.QueryParam) DataSetProvider(com.thinkbiganalytics.metadata.api.catalog.DataSetProvider) Consumes(javax.ws.rs.Consumes) Map(java.util.Map) AccessController(com.thinkbiganalytics.security.AccessController) DefaultValue(javax.ws.rs.DefaultValue) NiFiRestClient(com.thinkbiganalytics.nifi.rest.client.NiFiRestClient) Formatters(com.thinkbiganalytics.Formatters) FeedServicesAccessControl(com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl) MetadataAccess(com.thinkbiganalytics.metadata.api.MetadataAccess) DELETE(javax.ws.rs.DELETE) PermissionsChange(com.thinkbiganalytics.security.rest.model.PermissionsChange) ActionGroup(com.thinkbiganalytics.security.rest.model.ActionGroup) Set(java.util.Set) Collectors(java.util.stream.Collectors) NotFoundException(javax.ws.rs.NotFoundException) List(java.util.List) Principal(java.security.Principal) Stream(java.util.stream.Stream) Response(javax.ws.rs.core.Response) AccessControlException(java.security.AccessControlException) Optional(java.util.Optional) WebApplicationException(javax.ws.rs.WebApplicationException) RoleMembershipChange(com.thinkbiganalytics.security.rest.model.RoleMembershipChange) PathParam(javax.ws.rs.PathParam) SecurityModelTransform(com.thinkbiganalytics.security.rest.controller.SecurityModelTransform) GET(javax.ws.rs.GET) DataSet(com.thinkbiganalytics.metadata.api.catalog.DataSet) HashMap(java.util.HashMap) ApiResponses(io.swagger.annotations.ApiResponses) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Inject(javax.inject.Inject) RestResponseStatus(com.thinkbiganalytics.rest.model.RestResponseStatus) DefaultDatabaseMetadata(com.thinkbiganalytics.discovery.model.DefaultDatabaseMetadata) JdbcDatasource(com.thinkbiganalytics.metadata.rest.model.data.JdbcDatasource) UserDatasource(com.thinkbiganalytics.metadata.rest.model.data.UserDatasource) Api(io.swagger.annotations.Api) Tag(io.swagger.annotations.Tag) Nonnull(javax.annotation.Nonnull) Logger(org.slf4j.Logger) CannotGetJdbcConnectionException(org.springframework.jdbc.CannotGetJdbcConnectionException) POST(javax.ws.rs.POST) SecurityService(com.thinkbiganalytics.feedmgr.service.security.SecurityService) Datasource(com.thinkbiganalytics.metadata.rest.model.data.Datasource) AccessControlled(com.thinkbiganalytics.security.AccessControlled) DBCPConnectionPoolService(com.thinkbiganalytics.feedmgr.nifi.controllerservice.DBCPConnectionPoolService) Component(org.springframework.stereotype.Component) SwaggerDefinition(io.swagger.annotations.SwaggerDefinition) DatasourceAccessControl(com.thinkbiganalytics.metadata.api.datasource.security.DatasourceAccessControl) ApiResponse(io.swagger.annotations.ApiResponse) TableSchema(com.thinkbiganalytics.discovery.schema.TableSchema) DatasourceProvider(com.thinkbiganalytics.metadata.api.datasource.DatasourceProvider) DatasourceCriteria(com.thinkbiganalytics.metadata.rest.model.data.DatasourceCriteria) QueryResult(com.thinkbiganalytics.discovery.schema.QueryResult) WebApplicationException(javax.ws.rs.WebApplicationException) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

PathParam (javax.ws.rs.PathParam)127 Path (javax.ws.rs.Path)105 GET (javax.ws.rs.GET)96 Produces (javax.ws.rs.Produces)96 Response (javax.ws.rs.core.Response)93 QueryParam (javax.ws.rs.QueryParam)82 List (java.util.List)72 MediaType (javax.ws.rs.core.MediaType)72 POST (javax.ws.rs.POST)71 DELETE (javax.ws.rs.DELETE)70 Consumes (javax.ws.rs.Consumes)66 Inject (javax.inject.Inject)62 Api (io.swagger.annotations.Api)60 ApiOperation (io.swagger.annotations.ApiOperation)59 Map (java.util.Map)59 ApiResponse (io.swagger.annotations.ApiResponse)58 ApiResponses (io.swagger.annotations.ApiResponses)57 Collectors (java.util.stream.Collectors)57 Logger (org.slf4j.Logger)52 LoggerFactory (org.slf4j.LoggerFactory)52