Package io.fathom.cloud.server.model

Examples of io.fathom.cloud.server.model.Project


    public Project findSystemProject() throws CloudException {
        log.warn("findSystemProject is very inefficient");

        for (ProjectData project : authRepository.getProjects().list()) {
            if (project.getName().equals(SYSTEM_PROJECT_NAME)) {
                return new Project(project.getId());
            }
        }
        return null;
    }
View Full Code Here


    }

    private void doProjectGrant() throws CloudException {
        Auth auth = getAuth();

        Project project = auth.getProject();

        AuthenticatedUser authenticatedUser = ((AuthServiceImpl) authService).toAuthenticatedUser(auth);
        AuthenticatedProject authenticatedProject = identityService.authenticateToProject(authenticatedUser,
                project.getId());

        RoleData role = getRole();

        DomainData domain = identityService.getDefaultDomain();
View Full Code Here

        if (auth == null) {
            throw new IllegalStateException("Error authenticating to project");
        }
        log.info("Authenticated to project");

        Project project = auth.getProject();
        println("Created project: %s", project.getId());
    }
View Full Code Here

            addEndpoint(service, baseUrl + "/openstack/storage/" + project.getId());
        }

        List<ServiceType> enabledServices = Lists.newArrayList();

        Project genericProject = new Project(project.getId());
        for (ExtensionModule extension : extensions.getExtensions()) {
            if (extension instanceof OpenstackExtension) {
                List<ServiceType> extensionServices = ((OpenstackExtension) extension).getServices(genericProject,
                        baseUrl);
                enabledServices.addAll(extensionServices);
View Full Code Here

    @Override
    public void setProjectSecret(ClientApp app, Auth auth, Project project, byte[] payload) throws CloudException {
        AuthenticatedUser user = authService.toAuthenticatedUser(auth);

        Project authProject = auth.getProject();
        if (project == null) {
            throw new IllegalArgumentException();
        }

        if (authProject.getId() != project.getId()) {
            throw new IllegalArgumentException();
        }

        long projectId = project.getId();
View Full Code Here

    @Override
    public byte[] findProjectSecret(ClientApp app, Auth auth, Project project) throws CloudException {
        AuthenticatedUser user = authService.toAuthenticatedUser(auth);

        Project authProject = auth.getProject();
        if (project == null) {
            throw new IllegalArgumentException();
        }

        if (authProject.getId() != project.getId()) {
            throw new IllegalArgumentException();
        }

        long projectId = project.getId();
View Full Code Here

    @Path("{bucket}")
    public void watchBucket(@Suspended final AsyncResponse response, @QueryParam("since") String since)
            throws CloudException {
        User user = getAuth().getUser();

        Project project = findProject(projectName);
        if (project == null) {
            throw new WebApplicationException(Status.NOT_FOUND);
        }

        FsBucket bucket = fs.findBucket(user, project, bucketName);
View Full Code Here

    @Inject
    FileServiceInternal fs;

    @POST
    public Response createBucket() throws Exception {
        Project project = getProject();

        Map<String, String> userAttributes = Maps.newHashMap();

        Enumeration<String> headerNames = httpRequest.getHeaderNames();
        while (headerNames.hasMoreElements()) {
View Full Code Here

        return createBucket();
    }

    @DELETE
    public Response deleteBucket() throws Exception {
        Project project = getProject();

        fs.deleteBucket(project, bucketName);

        ResponseBuilder response = Response.status(Status.NO_CONTENT);
        return response.build();
View Full Code Here

    public Response listObjects(@QueryParam("format") String formatParam) throws CloudException {
        if (!isAuthenticated()) {
            return doAnonymousRead();
        }

        Project project = getProject();

        User user = getAuth().getUser();
        FsBucket bucket = fs.findBucket(user, project, bucketName);
        if (bucket == null) {
            throw new WebApplicationException(Status.NOT_FOUND);
View Full Code Here

TOP

Related Classes of io.fathom.cloud.server.model.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.