Package general

Examples of general.DepTuple


    Statistics.incCas(System.currentTimeMillis()-time);
  }

  @Override
  public void putMetadata(NodeMetadata metadata) throws DirectoryServiceException {
    DepTuple tuple;
    try {
      long time = System.currentTimeMillis();
      Printer.println("  -> Start operation cas at DepSpace", "azul");
      tuple = accessor.cas(DepTuple.createTuple("*", metadata.getParent(), metadata.getName(), "*", "*", "*"), metadata.getAsTuple());
      long tempo = System.currentTimeMillis()-time;
View Full Code Here


    }
  }

  @Override
  public NodeMetadata getMetadata(String path) throws DirectoryServiceException {
    DepTuple tuple = null;
    try {
      if(cont++==50){
        cont=0;
        System.out.print(".");
      }
      String[] divPath = dividePath(path);
      long time = System.currentTimeMillis();
      Printer.println("  -> Start operation rdp at DepSpace", "azul");
      tuple = accessor.rdp(DepTuple.createTuple("*",divPath[0], divPath[1], "*", "*", "*"));
      long tempo = System.currentTimeMillis()-time;
      Printer.println("  -> End operation rdp at DepSpace", "azul");
      Printer.println("  -> Operation rdp took: " + Long.toString(tempo) + " milis", "azul");
      Statistics.incRdp(System.currentTimeMillis()-time);
    } catch (DepSpaceException e) {
      throw new DirectoryServiceConnectionProblemException("Connection Problem");
    }

    if(tuple == null)
      throw new DirectoryServiceException("Tuple not Found!");

    NodeMetadata node = new NodeMetadata(tuple.getFields(), tuple.getC_rd(), tuple.getC_in());

    return node;
  }
View Full Code Here

  @Override
  public PrivateNameSpaceStats getPrivateNameSpaceMetadata() throws DirectoryServiceException {
    try {
      long time = System.currentTimeMillis();
      Printer.println("  -> Start operation rdp at DepSpace", "azul");
      DepTuple tuple = accessor.rdp(DepTuple.createTuple(NodeType.PRIVATE_NAMESPACE.getAsString(), "*", "*"));
      long tempo = System.currentTimeMillis()-time;
      Printer.println("  -> End operation rdp at DepSpace", "azul");
      Printer.println("  -> Operation rdp took: " + Long.toString(tempo) + " milis", "azul");
      Statistics.incRdp(System.currentTimeMillis()-time);
      if(tuple == null)
        throw new DirectoryServiceException("Tuple not Found!");

      return new PrivateNameSpaceStats((String)tuple.getFields()[1], (SecretKey)tuple.getFields()[2]);
    } catch (DepSpaceException e) {
      throw new DirectoryServiceConnectionProblemException("Connection Problem");
    }
  }
View Full Code Here

  @Override
  public void putPrivateNameSpaceMetadata(int clientId, PrivateNameSpaceStats pnsStats) throws DirectoryServiceException {
    try {
      long time = System.currentTimeMillis();
      Printer.println("  -> Start operation cas at DepSpace", "azul");
      DepTuple tuple = accessor.cas(DepTuple.createTuple(NodeType.PRIVATE_NAMESPACE.getAsString(), "*", "*"), DepTuple.createAccessControledTuple(new int []{clientId}, new int []{clientId}, NodeType.PRIVATE_NAMESPACE.getAsString(), pnsStats.getIdPath(), pnsStats.getKey()));
      long tempo = System.currentTimeMillis()-time;
      Printer.println("  -> End operation cas at DepSpace", "azul");
      Printer.println("  -> Operation cas took: " + Long.toString(tempo) + " milis", "azul");
      Statistics.incCas(System.currentTimeMillis()-time);
      if(tuple != null)
View Full Code Here

  @Override
  public List<String[]> getCredentials(int clientId) throws DirectoryServiceException {
    try {
      String s = new String(""+clientId);
      DepTuple tuple = accessor.rdp(DepTuple.createTuple(s, "*"));
      if(tuple == null)
        throw new DirectoryServiceException("There are no client credentials.");
     
      return stringToList((String) tuple.getFields()[1]);
    } catch (DepSpaceException e) {
      throw new DirectoryServiceConnectionProblemException("Connection Problem");
    }
  }
View Full Code Here

TOP

Related Classes of general.DepTuple

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.