Package util

Examples of util.IDGenerator


import util.IDGenerator.IDStrategy;

public class IDGeneratorTest {

  public static void Test1() throws DecoderException, NoSuchAlgorithmException, UnsupportedEncodingException{
    IDGenerator generator = new IDGenerator();
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
  }
View Full Code Here


    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
  }
 
 
  public static void Test2() throws DecoderException, NoSuchAlgorithmException, UnsupportedEncodingException{
    IDGenerator generator = new IDGenerator();
    System.out.println(generator.getNextID("ben", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("alice", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("bob", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("dirk", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("george", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("jimmy", IDStrategy.RANDOM));
  }
View Full Code Here

    // publish the root scope where all videos will be published
    String rootScopeStr = "1111111111111111";
        ByteIdentifier rootId = new ByteIdentifier(Hex.decodeHex(rootScopeStr.toCharArray()));
        rootScope = new ScopeID(rootId);
        client.publishRootScope(rootId, strategy, null);
        rootGenerator = new IDGenerator();
        videoPublisher = new VideoPublisher(client, rootScope, strategy);
        // publish the catalog.
    videoPublisher.publishCatalog();
    ridMappings = new HashMap<String, String>();
View Full Code Here

    // publish the root scope where all videos will be published
    String rootScopeStr = "1111111111111111";
    ByteIdentifier rootId = new ByteIdentifier(Hex.decodeHex(rootScopeStr.toCharArray()));
    rootScope = new ScopeID(rootId);
    client.publishRootScope(rootId, strategy, null);
    rootGenerator = new IDGenerator();
    videoPublisher = new VideoPublisher(client, rootScope, strategy);
    // publish the catalog.
    videoPublisher.publishCatalog();
    ridMappings = new HashMap<String, String>();
    listMappings = new HashMap<Integer, String>();
View Full Code Here

TOP

Related Classes of util.IDGenerator

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.