package org.slc.sli.common.util.uuid;

import java.util.UUID;

import javax.annotation.PostConstruct;

import com.fasterxml.uuid.EthernetAddress;
import com.fasterxml.uuid.Generators;
import com.fasterxml.uuid.impl.TimeBasedGenerator;

import org.springframework.stereotype.Component;

/**
 * Generates Type 1 (time-based) UUIDs.
 *
 * @author smelody
 *
 */
@Component
public class Type1UUIDGeneratorStrategy implements UUIDGeneratorStrategy {

    private TimeBasedGenerator generator;

    @PostConstruct
    public void init() {

        EthernetAddress nic = EthernetAddress.fromInterface();
        generator = Generators.timeBasedGenerator(nic);
    }

    @Override
    public UUID randomUUID() {

        return generator.generate();
    }

}

@@ -67,37 +67,47 @@
 ort 
-javax.annotation.PostConstruc
+org.springframework.stereotype.Componen
 t;%0A%0A
@@ -243,58 +243,8 @@
 r;%0A%0A
-import org.springframework.stereotype.Component;%0A%0A
 /**%0A
@@ -439,19 +439,86 @@
 enerator
+ = Generators.timeBasedGenerator(EthernetAddress.fromInterface())
 ;%0A%0A
+//
     @Pos
@@ -528,16 +528,18 @@
 nstruct%0A
+//
     publ
@@ -551,25 +551,29 @@
 id init() %7B%0A
-%0A
+//%0A//
         Ethe
@@ -619,24 +619,26 @@
 nterface();%0A
+//
         gene
@@ -681,23 +681,79 @@
 r(nic);%0A
+//
     %7D%0A%0A
+    /**%0A     * Generate a type 1 random UUID.%0A     */%0A
     @Ove
@@ -789,17 +789,16 @@
 UID() %7B%0A
-%0A
         

remove post construct annotation