Package com.eaio.uuid

Examples of com.eaio.uuid.UUID


                if (user == null) {
                  //user is new
                  user = new User();
                  user.setEmail(StringUtils.isBlank(email) ? "email@domain.com" : email);
                  user.setName(StringUtils.isBlank(name) ? "No Name" : name);
                  user.setPassword(new UUID().toString());
                  user.setIdentifier(Config.FB_PREFIX.concat(fbId));
                  if (user.getPicture() == null && pic != null) {
                    Map<String, Object> data = (Map<String, Object>) pic.get("data");
                    // try to get the direct url to the profile pic
                    if (data != null && data.containsKey("url")) {
View Full Code Here


 
  public static class UUIDConverter extends BaseConverter {
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      UUID uid = (UUID) value;
        long time = uid.getTime();
        long clockSeqAndNode = uid.getClockSeqAndNode();
        byte[] timeArray = LONG_CONVERTER.convertToNoSql(time);
        byte[] nodeArray = LONG_CONVERTER.convertToNoSql(clockSeqAndNode);
        byte[] combinedUUID = new byte[timeArray.length + nodeArray.length];
        System.arraycopy(timeArray,0,combinedUUID,0         ,timeArray.length);
        System.arraycopy(nodeArray,0,combinedUUID,timeArray.length,nodeArray.length);
View Full Code Here

        byte[] clockSeqAndNodeArray=new byte[8];
        System.arraycopy(value,0,timeArray,0,8);
        System.arraycopy(value,8,clockSeqAndNodeArray,0,8);
        long time = StandardConverters.convertFromBytes(Long.class, timeArray);
        long clockSeqAndNode = StandardConverters.convertFromBytes(Long.class, clockSeqAndNodeArray);
        UUID ud = new UUID(time,clockSeqAndNode);
        return ud;
      } catch(Exception e) {
        throw new RuntimeException("value in len="+value.length, e);
      }
    }
View Full Code Here

      }
    }

    @Override
    protected Object convertToType(String value) {
      UUID ud = new UUID(value);
      return ud;
    }
View Full Code Here

    public JournalReplayIterable createReplayIterable() throws IOException {
        return new JournalReplayIterable();
    }

    private JournalDescriptor createAndAddNewJournal() throws IOException {
        UUID uid = new UUID();
        String fn = createNewJournalName(uid.toString());
        return addNewJournalToIdMap(uid, fn);
    }
View Full Code Here

        // read files and sort by their UUID name so they are in proper chronological order
        Collection<File> files = FileUtils.listFiles(pagingDirectory, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
        TreeSet<File> sortedFiles = new TreeSet<File>(new Comparator<File>() {
            @Override
            public int compare(File o1, File o2) {
                return new UUID(o1.getName()).compareTo(new UUID(o2.getName()));
            }
        });
        sortedFiles.addAll(files);

        // cleanup memory
View Full Code Here

        // if didn't find anything, return null
        return null;
    }

    private void createNewSegment() {
        UUID newId = new UUID();

        MemorySegment seg = new MemorySegment();
        seg.setId(newId);
        seg.setMaxSizeInBytes(maxSegmentSizeInBytes);
        seg.setStatus(MemorySegment.Status.READY);
View Full Code Here

    act.setIsCool(true);
    BigInteger bigInt = BigInteger.valueOf(Long.MAX_VALUE+87);
    act.setBigInt(bigInt);
    time = LocalDateTime.now();
    act.setDate(time);
    uid = new UUID();
    act.setUniqueId(uid);
    mgr.put(act);
   
    //Everything is null for this activity so queries above should not find him...
    Activity act2 = new Activity("act2");
View Full Code Here

    facade = new MockFacade();
  }
 
  @Test
  public void testConverter() {
    UUID uuid = new UUID();
    String val = StandardConverters.convertToString(uuid);
    UUID uuid2 = StandardConverters.convertFromString(UUID.class, val);
    Assert.assertEquals(uuid, uuid2);
  }
View Full Code Here

  protected MetasImpl(DocumentAtExist doc) {
    update(doc);
   
    if (doc.getUUID() == null)
      uuid = (new UUID()).toString();
    else
      uuid = doc.getUUID().toString();
  }
View Full Code Here

TOP

Related Classes of com.eaio.uuid.UUID

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.