Package org.nasutekds.server.replication.common

Examples of org.nasutekds.server.replication.common.ChangeNumber


    operationalAttributes.add(attr);
    HashMap<AttributeType,List<Attribute>> opList=
      new HashMap<AttributeType,List<Attribute>>();
    opList.put(attr.getAttributeType(), operationalAttributes);

    ChangeNumber cn = new ChangeNumber(TimeThread.getTime(), 12345);

    AddMsg msg = new AddMsg(cn, rawDN, "thisIsaUniqueID", "parentUniqueId",
                            objectClass, userAttributes,
                            operationalAttributes);
View Full Code Here


  /**
   * Build some data for the AckMsg test below.
   */
  @DataProvider(name = "createAckData")
  public Object[][] createAckData() {
    ChangeNumber cn1 = new ChangeNumber(101);
    ChangeNumber cn2 = new ChangeNumber(TimeThread.getTime(), 123, 45);
    ChangeNumber cn3 = new ChangeNumber(TimeThread.getTime(), 1234567, 45678);

    ArrayList<Integer> fservers1 = new ArrayList<Integer>();
    fservers1.add(new Integer(12345));
    fservers1.add(new Integer(-12345));
    fservers1.add(new Integer(31657));
View Full Code Here

    InternalClientConnection connection =
      InternalClientConnection.getRootConnection();
    DeleteOperationBasis opBasis =
      new DeleteOperationBasis(connection, 1, 1,null, DN.decode("cn=t1"));
    LocalBackendDeleteOperation op = new LocalBackendDeleteOperation(opBasis);
    ChangeNumber cn = new ChangeNumber(TimeThread.getTime(), 12345);
    op.setAttachment(SYNCHROCONTEXT, new DeleteContext(cn, "uniqueid"));
    DeleteMsg delmsg = new DeleteMsg(op);
    int draftcn = 21;

    String serviceId = "serviceid";
View Full Code Here

  @DataProvider(name="createServerStartData")
  public Object [][] createServerStartData() throws Exception
  {
    String baseDN = TEST_ROOT_DN_STRING;
    ServerState state = new ServerState();
    state.update(new ChangeNumber((long)0, 0,0));
    Object[] set1 = new Object[] {1, baseDN, 0, state, 0L, false, (byte)0};

    state = new ServerState();
    state.update(new ChangeNumber((long)75, 5,263));
    Object[] set2 = new Object[] {16, baseDN, 100, state, 1248L, true, (byte)31};

    state = new ServerState();
    state.update(new ChangeNumber((long)75, 98573895,45263));
    Object[] set3 = new Object[] {16, baseDN, 100, state, 1248L, true, (byte)31};

    return new Object [][] { set1, set2, set3 };
  }
View Full Code Here

  @DataProvider(name="createReplServerStartData")
  public Object [][] createReplServerStartData() throws Exception
  {
    String baseDN = TEST_ROOT_DN_STRING;
    ServerState state = new ServerState();
    state.update(new ChangeNumber((long)0, 0,0));
    Object[] set1 = new Object[] {1, baseDN, 0, "localhost:8989", state, 0L, (byte)0, 0};

    state = new ServerState();
    state.update(new ChangeNumber((long)75, 5,263));
    Object[] set2 = new Object[] {16, baseDN, 100, "anotherHost:1025", state, 1245L, (byte)25, 3456};

    state = new ServerState();
    state.update(new ChangeNumber((long)75, 5, 45263));
    Object[] set3 = new Object[] {16, baseDN, 100, "anotherHost:1025", state, 1245L, (byte)25, 3456};

    return new Object [][] { set1, set2, set3 };
  }
View Full Code Here

  @DataProvider(name="createReplServerStartDSData")
  public Object [][] createReplServerStartDSData() throws Exception
  {
    String baseDN = TEST_ROOT_DN_STRING;
    ServerState state = new ServerState();
    state.update(new ChangeNumber((long)0, 0, 0));
    Object[] set1 = new Object[] {1, baseDN, 0, "localhost:8989", state, 0L, (byte)0, 0, 0, 0};

    state = new ServerState();
    state.update(new ChangeNumber((long)75, 5, 263));
    Object[] set2 = new Object[] {16, baseDN, 100, "anotherHost:1025", state, 1245L, (byte)25, 3456, 3, 31512};

    state = new ServerState();
    state.update(new ChangeNumber((long)123, 5, 98));
    Object[] set3 = new Object[] {36, baseDN, 100, "anotherHostAgain:8017", state, 6841L, (byte)32, 2496, 630, 9524};

    return new Object [][] { set1, set2, set3 };
  }
View Full Code Here

    int sender = 2;
    int dest = 3;

    // RS State
    ServerState rsState = new ServerState();
    ChangeNumber rscn1 = new ChangeNumber(111);
    ChangeNumber rscn2 = new ChangeNumber(1145678);
    rsState.update(rscn1);
    rsState.update(rscn2);

    // LS1 state
    ServerState s1 = new ServerState();
    int sid1 = 111;
    ChangeNumber cn1 = new ChangeNumber(11, sid1);
    s1.update(cn1);

    // LS2 state
    ServerState s2 = new ServerState();
    int sid2 = 222;
    Long now = ((Integer)10).longValue();
    ChangeNumber cn2 = new ChangeNumber(now, 123, sid2);
    s2.update(cn2);

    // LS3 state
    ServerState s3 = new ServerState();
    int sid3 = 56789;
    ChangeNumber cn3 = new ChangeNumber(now, 123, sid3);
    s3.update(cn3);

    MonitorMsg msg =
      new MonitorMsg(sender, dest);
    msg.setReplServerDbState(rsState);
View Full Code Here

  public void UpdateMsgTest() throws Exception
  {
    final String test = "string used for test";
    UpdateMsg msg =
      new UpdateMsg(
          new ChangeNumber((long) 1, 2 , 39123),
          test.getBytes());
    UpdateMsg newMsg = new UpdateMsg(msg.getBytes());
    assertEquals(test.getBytes(), newMsg.getPayload());
  }
View Full Code Here

  @Test()
  public void startECLSessionMsgTest()
    throws Exception
  {
    // data
    ChangeNumber changeNumber = new ChangeNumber(TimeThread.getTime(), 12345);
    String generalizedState = new String("fakegenstate");
    ServerState state = new ServerState();
    assertTrue(state.update(new ChangeNumber((long)75, 5,263)));
    short mode = 3;
    int firstDraftChangeNumber = 13;
    int lastDraftChangeNumber  = 14;
    String myopid = new String("fakeopid");
    // create original
View Full Code Here

    operationalAttributes.add(attr);
    HashMap<AttributeType,List<Attribute>> opList=
      new HashMap<AttributeType,List<Attribute>>();
    opList.put(attr.getAttributeType(), operationalAttributes);

    ChangeNumber cn = new ChangeNumber(TimeThread.getTime(), 123, 45);
    DN dn = DN.decode(rawDN);

    for (int i=1;i<perfRep;i++)
    {
      t1 = System.nanoTime();
View Full Code Here

TOP

Related Classes of org.nasutekds.server.replication.common.ChangeNumber

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.