Package com.eaio.uuid

Examples of com.eaio.uuid.UUID


      uuid = doc.getUUID().toString();
  }
 
  protected MetasImpl(Collection col) {
    update(col);
    uuid = (new UUID()).toString();
  }
View Full Code Here


    uuid = (new UUID()).toString();
  }

  protected MetasImpl(XmldbURI uri) {
    this.uri = uri.toString();
    uuid = (new UUID()).toString();
  }
View Full Code Here

 
  @SuppressWarnings("unused")
  private MetaImpl() {}

  protected MetaImpl(String objectUUID, String k, Object v) {
    this(objectUUID, (new UUID()).toString(), k, v);
  }
View Full Code Here

      }
    }
    Internal.DB_VERSION._setValue(BBConfiguration.configuration.getString(IBBConfigurationKeys.API_VERSION));
    String uniqueId="";
    try{
      UUID u = new UUID();
      uniqueId=new String(Base64.encodeBase64(u.toString().getBytes()));
    }catch (Exception e){
      java.util.UUID u = java.util.UUID.randomUUID();
      uniqueId=new String(Base64.encodeBase64(u.toString().getBytes()));
    }
    Internal.INSTALLATION_ID._setValue(uniqueId);
    Logger.info("Unique installation id is: " + uniqueId);
    Logger.info("...done");
  }
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

//            " are using a primitive for your key which is not a good idea either if you are going to use a generator(use Integer or String or Long instead)");
      return id;
    }
    Object newId;
    if (field.getType().equals(UUID.class))
      newId = new UUID();
    else
      newId = generator.generateNewKey(entity);
    ReflectionUtil.putFieldValue(entity, field, newId);
    return newId;
  }
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

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.