Examples of UserMetadata


Examples of org.jclouds.atmos.domain.UserMetadata

   @Test
   public void testCorrectSystemMetadataObjectName() throws SecurityException, NoSuchMethodException {

      AtmosObject blob = BLOB_FACTORY.create(new SystemMetadata(null, null, null, null, null, null, 0, null, "foo",
            null, 0, null, null), new UserMetadata());
      assertEquals(fn.apply(blob), "foo");
   }
View Full Code Here

Examples of org.jclouds.atmos.domain.UserMetadata

         ImmutableMap.of("listablemeta1", "listablefoo1", "listablemeta2", "listablefoo2"), ImmutableSet.of("tag1",
               "tag2"), ImmutableSet.of("listabletag1", "listabletag2"));

   public void test() {
      ParseUserMetadataFromHeaders parser = Guice.createInjector().getInstance(ParseUserMetadataFromHeaders.class);
      UserMetadata data = parser.apply(ParseObjectFromHeadersAndHttpContentTest.RESPONSE);

      assertEquals(data, EXPECTED);
   }
View Full Code Here

Examples of org.jclouds.atmos.domain.UserMetadata

   }

   public AtmosObject apply(BlobMetadata from) {
      if (from == null)
         return null;
      UserMetadata userMd = new UserMetadata();
      if (from.getUserMetadata() != null) {
         for (Entry<String, String> entry : from.getUserMetadata().entrySet())
            userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue());
      }
      return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd);
   }
View Full Code Here

Examples of org.jclouds.atmos.domain.UserMetadata

            from.getFirstHeaderOrNull(AtmosHeaders.TAGS)) : ImmutableSet.<String> of();

      Iterable<String> listableTags = (from.getFirstHeaderOrNull(AtmosHeaders.LISTABLE_TAGS) != null) ? Splitter
            .on(", ").split(from.getFirstHeaderOrNull(AtmosHeaders.LISTABLE_TAGS)) : ImmutableSet.<String> of();

      return new UserMetadata(meta, listableMeta, tags, listableTags);
   }
View Full Code Here

Examples of org.jclouds.atmos.domain.UserMetadata

      this.userMetadata = userMetadata;
   }

   @Inject
   public AtmosObjectImpl(MutableContentMetadata contentMetadata) {
      this(contentMetadata, null, new UserMetadata());
   }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        // This needs to be a read/write transaction as we might make a user.
        MetaGraphTx tx = metaGraphService.buildTransaction().start();
        GetJobsResponse getJobsResponse;

        try {
            UserMetadata userMetadata = tx.getOrCreateUser(principal);

            List<GetJobResponse> jobs = new ArrayList<>();

            for (ProjectMetadata projectMetadata : userMetadata.getProjects()) {
                for (JobMetadata jobMetadata : projectMetadata.getJobs()) {
                    jobs.add(new GetJobResponse(jobMetadata));
                }
            }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        MetaGraphTx tx = metaGraphService.newTransaction();

        try {
            UserMetadata userMetadata = tx.getOrCreateUser(authentication);

            // Make sure we have permission to access this graph.
            GraphMetadata graphMetadata = userMetadata.getGraph(new GraphMetadata.Id(graphId));
            if (graphMetadata == null) {
                return null;
            }

            DendriteGraph graph = metaGraphService.getDendriteGraph(graphId);
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

        Set<String> graphNames = new TreeSet<>();

        MetaGraphTx tx = metaGraphService.buildTransaction().readOnly().start();

        try {
            UserMetadata userMetadata = tx.getOrCreateUser(authentication);

            for (GraphMetadata graphMetadata: userMetadata.getGraphs()) {
                graphNames.add(graphMetadata.getId().toString());
            }
        } finally {
            tx.commit();
        }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

    public GetUserResponse getUser(@PathVariable String userId) throws NotFound {

        MetaGraphTx tx = metaGraphService.buildTransaction().readOnly().start();

        try {
            UserMetadata userMetadata = tx.getUser(userId);

            if (userMetadata == null) {
                throw new NotFound(UserMetadata.class, userId);
            }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.UserMetadata

    @Test
    public void testGettingNormalGraph() {
        // Create a graph.
        MetaGraphTx tx = metaGraph.newTransaction();

        UserMetadata userMetadata = tx.createUser("test");
        Assert.assertNotNull(userMetadata);

        ProjectMetadata projectMetadata = tx.createProject("test", userMetadata);
        Assert.assertNotNull(projectMetadata);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.