Changeset 129188f for core/java


Ignore:
Timestamp:
Mar 19, 2018 5:00:44 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2a30bfe
Parents:
bdff474d
Message:

PortMapper?: Add convenience methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/PortMapper.java

    rbdff474d r129188f  
    116116
    117117    /**
     118     *  Is the service registered?
     119     *
     120     *  @since 0.9.34
     121     */
     122    public boolean isRegistered(String service) {
     123        return _dir.containsKey(service);
     124    }
     125
     126    /**
    118127     *  Remove the service
    119128     */
    120129    public void unregister(String service) {
    121130        _dir.remove(service);
     131    }
     132
     133    /**
     134     *  Remove the service,
     135     *  only if it is registered with the supplied port.
     136     *
     137     *  @since 0.9.34
     138     */
     139    public void unregister(String service, int port) {
     140        // not synched
     141        if (getPort(service) == port)
     142            _dir.remove(service);
    122143    }
    123144
Note: See TracChangeset for help on using the changeset viewer.