Tabnine Logo
SessionConfig.getDestination
Code IndexAdd Tabnine to your IDE (free)

How to use
getDestination
method
in
net.i2p.data.i2cp.SessionConfig

Best Java code snippets using net.i2p.data.i2cp.SessionConfig.getDestination (Showing top 11 results out of 315)

origin: i2p/i2p.i2p

  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder("[SessionConfig: ");
    buf.append("\n\tDestination: ").append(getDestination());
    buf.append("\n\tSignature: ").append(getSignature());
    buf.append("\n\tCreation Date: ").append(getCreationDate());
    buf.append("\n\tOptions: #: ").append(_options.size());
    Properties sorted = new OrderedProperties();
    sorted.putAll(_options);
    for (Map.Entry<Object, Object> e : sorted.entrySet()) {
      String key = (String) e.getKey();
      String val = (String) e.getValue();
      buf.append("\n\t\t[").append(key).append("] = [").append(val).append("]");
    }
    buf.append("]");
    return buf.toString();
  }
}
origin: i2p/i2p.i2p

/**
 *  Equivalent to getConfig().getDestination().calculateHash();
 *  will be null before session is established
 *  Not subsession aware. Returns primary session hash.
 *  Don't use if you can help it.
 *
 *  @return primary hash or null if not yet set
 */
public Hash getDestHash() {
  SessionConfig cfg = getPrimaryConfig();
  if (cfg != null)
    return cfg.getDestination().calculateHash();
  return null;
}
origin: i2p/i2p.i2p

  public void runJob() {
    Hash dest = _config.getDestination().calculateHash();
    if (_log.shouldLog(Log.INFO))
      _log.info("Requesting lease set for destination " + dest);
    ClientTunnelSettings settings = new ClientTunnelSettings(dest);
    Properties props = new Properties();
    
    // We're NOT going to force all clients to use the router's defaults, since that may be
    // excessive.  This means that unless the user says otherwise, we'll be satisfied with whatever
    // is available.  Otherwise, when the router starts up, if there aren't sufficient tunnels with the
    // adequate number of hops, the user will have to wait.  Once peer profiles are persistent, we can
    // reenable this, since on startup we'll have a sufficient number of high enough ranked peers to
    // tunnel through.  (perhaps).
    
    // XXX take the router's defaults
    // XXX props.putAll(Router.getInstance().getConfigMap());
    
    // override them by the client's settings
    props.putAll(_config.getOptions());
    
    // and load 'em up (using anything not yet set as the software defaults)
    settings.readFromProperties(props);
    getContext().tunnelManager().buildTunnels(_config.getDestination(), settings);
  }
}
origin: i2p/i2p.i2p

Destination dest = config.getDestination();
Hash destHash = dest.calculateHash();
if (_log.shouldLog(Log.DEBUG))
origin: i2p/i2p.i2p

@Override
public boolean equals(Object object) {
  if ((object != null) && (object instanceof SessionConfig)) {
    SessionConfig cfg = (SessionConfig) object;
    return DataHelper.eq(getSignature(), cfg.getSignature())
        && DataHelper.eq(getDestination(), cfg.getDestination())
        && DataHelper.eq(getCreationDate(), cfg.getCreationDate())
        && DataHelper.eq(getOptions(), cfg.getOptions());
  }
     return false;
}
origin: i2p/i2p.i2p

  public void timeReached() {
    if (!_isStarted)
      return;
    for (ClientConnectionRunner runner : _runners.values()) {
      if (runner instanceof QueuedClientConnectionRunner)
        continue;
      if (runner.isDead())
        continue;
      SessionConfig cfg = runner.getPrimaryConfig();
      if (cfg == null)
        continue;  // simple session or no session yet
      if (runner.getLeaseSet(cfg.getDestination().calculateHash()) == null)
        continue;  // don't confuse client while waiting for CreateLeaseSet msg
      try {
        // only send version if the client can handle it (0.8.7 or greater)
        runner.doSend(new SetDateMessage(runner.getClientVersion() != null ?
                         CoreVersion.VERSION : null));
      } catch (I2CPMessageException ime) {}
    }
    if (_isStarted)
      schedule(LOOP_TIME);
  }
}
origin: i2p/i2p.i2p

if (!message.getSessionConfig().getDestination().equals(cfg.getDestination())) {
  _log.error("Dest mismatch");
  sendStatusMessage(id, SessionStatusMessage.STATUS_INVALID);
  return;
Hash dest = cfg.getDestination().calculateHash();
cfg.getOptions().putAll(message.getSessionConfig().getOptions());
ClientTunnelSettings settings = new ClientTunnelSettings(dest);
origin: i2p/i2p.i2p

if (getDestination() == null) {
    return false;
} else {
  spk = getDestination().getSigningPublicKey();
origin: i2p/i2p.i2p

Destination dest = in.getDestination();
if (in.verifySignature()) {
  if (_log.shouldLog(Log.DEBUG))
    boolean ok = _context.tunnelManager().addAlias(dest, settings, pcfg.getDestination());
    if (!ok) {
      _log.error("Add alias failed");
origin: i2p/i2p.i2p

/**
 *  Immediately send a fake leaseset
 */
@Override
protected void startCreateSessionJob(SessionConfig config) {
  long exp = _context.clock().now() + 10*60*1000;
  LeaseSet ls = new LeaseSet();
  Lease lease = new Lease();
  lease.setGateway(Hash.FAKE_HASH);
  TunnelId id = new TunnelId(1);
  lease.setTunnelId(id);
  Date date = new Date(exp);
  lease.setEndDate(date);
  ls.addLease(lease);
  _runner.requestLeaseSet(config.getDestination().calculateHash(), ls, exp, null, null);
}
origin: i2p/i2p.i2p

  return;
Destination dest = cfg.getDestination();
Destination ndest = ls.getDestination();
if (!dest.equals(ndest)) {
net.i2p.data.i2cpSessionConfiggetDestination

Javadoc

Retrieve the destination for which this session is supposed to connect

Popular methods of SessionConfig

  • <init>
  • setOptions
    Configure the session with the given options; keys and values 255 bytes (not chars) max each Default
  • getCreationDate
    Determine when this session was authorized by the destination (so we can prevent replay attacks)
  • getOptions
    Retrieve any configuration options for the session
  • getSignature
  • setSignature
  • signSessionConfig
    Sign the structure using the supplied private key
  • tooOld
    Misnamed, could be too old or too far in the future.
  • getBytes
  • getOfflineExpiration
    Get the offline expiration
  • getOfflineSignature
  • getTransientSigningPublicKey
  • getOfflineSignature,
  • getTransientSigningPublicKey,
  • readBytes,
  • setOfflineSignature,
  • verifySignature,
  • writeBytes

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • JFrame (javax.swing)
  • JLabel (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now