Package org.hive2hive.core.api.interfaces

Examples of org.hive2hive.core.api.interfaces.IFileConfiguration


    for (NetworkManager node : network) {
      KeyPair keyPair = EncryptionUtil.generateRSAKeyPair(H2HConstants.KEYLENGTH_USER_KEYS);
      UserCredentials userCredentials = generateRandomCredentials();
      UserProfileManager profileManager = new UserProfileManager(node.getDataManager(), userCredentials);
      PublicKeyManager keyManager = new PublicKeyManager(userCredentials.getUserId(), keyPair, node.getDataManager());
      IFileConfiguration config = FileConfiguration.createDefault();
      DownloadManager downloadManager = new DownloadManager(node.getDataManager(), node.getMessageManager(),
          keyManager, config);
      File root = new File(System.getProperty("java.io.tmpdir"), NetworkTestUtil.randomString());
      H2HSession session;
      session = new H2HSession(profileManager, keyManager, downloadManager, config, root.toPath());
View Full Code Here


    KeyPair keyPair = EncryptionUtil.generateRSAKeyPair(H2HConstants.KEYLENGTH_USER_KEYS);
    UserCredentials userCredentials = generateRandomCredentials();
    for (NetworkManager node : network) {
      UserProfileManager profileManager = new UserProfileManager(node.getDataManager(), userCredentials);
      PublicKeyManager keyManager = new PublicKeyManager(userCredentials.getUserId(), keyPair, node.getDataManager());
      IFileConfiguration config = FileConfiguration.createDefault();
      DownloadManager downloadManager = new DownloadManager(node.getDataManager(), node.getMessageManager(),
          keyManager, config);
      File root = new File(System.getProperty("java.io.tmpdir"), NetworkTestUtil.randomString());
      H2HSession session;
      session = new H2HSession(profileManager, keyManager, downloadManager, config, root.toPath());
View Full Code Here

  @Test
  public void testCleanupMaxNumVersions() throws IOException, GetFailedException, NoSessionException,
      IllegalArgumentException, NoPeerConnectionException, InvalidProcessStateException {
    // overwrite config
    IFileConfiguration limitingConfig = new IFileConfiguration() {

      @Override
      public BigInteger getMaxSizeAllVersions() {
        return BigInteger.valueOf(Long.MAX_VALUE);
      }
View Full Code Here

  @Test
  public void testCleanupMaxSize() throws IOException, GetFailedException, NoSessionException,
      IllegalArgumentException, NoPeerConnectionException, InvalidProcessStateException {
    // overwrite config and set the currently max limit
    final long fileSize = file.length();
    IFileConfiguration limitingConfig = new IFileConfiguration() {

      @Override
      public BigInteger getMaxSizeAllVersions() {
        return BigInteger.valueOf(fileSize);
      }
View Full Code Here

  @Test
  public void getPeer() {
    // a unconnected node does not provide a peer
    INetworkConfiguration config = NetworkConfiguration.create();
    IFileConfiguration fileConfig = FileConfiguration.createDefault();
    IH2HNode node = H2HNode.createNode(config, fileConfig);
    Assert.assertNull(node.getPeer());

    // connected nodes return a peer
    Assert.assertNotNull(network.get(random.nextInt(NETWORK_SIZE)).getPeer());
View Full Code Here

TOP

Related Classes of org.hive2hive.core.api.interfaces.IFileConfiguration

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.