⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 relayconfigadv.java

📁 JXTA&#8482 is a set of open, generalized peer-to-peer (P2P) protocols that allow any networked devi
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
    }    /**     * If true then this peer will act as a relay client.     *     * @param enabled If true then this peer will act as a relay client.     */    public void setClientEnabled(boolean enabled) {        clientEnabled = enabled;    }    /**     * Return the maximum number of relay clients.     *     * @return The maximum number of relay clients or <code>-1</code> for     *         default value.     */    public int getMaxRelays() {        return maxRelays;    }    /**     * Sets the maximum number of relay clients.     *     * @param newvalue The maximum number of relay clients or <code>-1</code>     *                 for default value or <code>-1</code> for default value.     */    public void setMaxRelays(int newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Max Relays must be > 0");        }        maxRelays = newvalue;    }    /**     * The interval in relative milliseconds of leases accepted by clients.     *     * @return The interval in relative milliseconds of leases accepted by     *         clients or <code>-1</code> for default value.     */    public long getClientLeaseDuration() {        return maxClientLeaseDuration;    }    /**     * Sets interval in relative milliseconds of leases accepted by clients.     *     * @param newvalue The interval in relative milliseconds of leases accepted     *                 by clients or <code>-1</code> for default value.     */    public void setClientLeaseDuration(long newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Lease Duration must be > 0");        }        maxClientLeaseDuration = newvalue;    }    /**     * The interval in relative milliseconds of at which clients will poll for     * messengers     *     * @return The interval in relative milliseconds of at which clients will     *         poll for messengers or <code>-1</code> for default value.     */    public long getMessengerPollInterval() {        return messengerPollInterval;    }    /**     * Sets interval in relative milliseconds of at which clients will poll for     * messengers.     *     * @param newvalue The interval in relative milliseconds of at which clients     *                 will poll for messengers or <code>-1</code> for default value.     */    public void setMessengerPollInterval(long newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Poll interval must be > 0");        }        messengerPollInterval = newvalue;    }    /**     * If true then this peer will use only seed rendezvous when configured as     * an edge peer.     *     * @return If true then this peer will use only seed rendezvous when configured as     *         an edge peer.     */    public boolean getUseOnlySeeds() {        return useOnlySeeds;    }    /**     * Set whether this peer will use only seed rendezvous when configured as     * an edge peer.     *     * @param onlySeeds If true then this peer will use only seed rendezvous when configured as     *                  an edge peer.     */    public void setUseOnlySeeds(boolean onlySeeds) {        useOnlySeeds = onlySeeds;    }    public EndpointAddress[] getSeedRelays() {        return seedRelays.toArray(new EndpointAddress[seedRelays.size()]);    }    public void addSeedRelay(EndpointAddress addr) {        if (null == addr) {            throw new IllegalArgumentException("addr may not be null");        }        seedRelays.add(addr);    }    public void addSeedRelay(String addr) {        if (null == addr) {            throw new IllegalArgumentException("addr may not be null");        }        seedRelays.add(new EndpointAddress(addr));    }    public boolean removeSeedRelay(EndpointAddress addr) {        if (null == addr) {            throw new IllegalArgumentException("addr may not be null");        }        return seedRelays.remove(addr);    }    public void clearSeedRelays() {        seedRelays.clear();    }    public URI[] getSeedingURIs() {        return seedingURIs.toArray(new URI[seedingURIs.size()]);    }    public void addSeedingURI(URI addr) {        if (null == addr) {            throw new IllegalArgumentException("addr may not be null");        }        seedingURIs.add(addr);    }    public void addSeedingURI(String addr) {        if (null == addr) {            throw new IllegalArgumentException("addr may not be null");        }        seedingURIs.add(URI.create(addr));    }    public boolean removeSeedingURI(URI addr) {        if (null == addr) {            throw new IllegalArgumentException("addr may not be null");        }        return seedingURIs.remove(addr);    }    public void clearSeedingURIs() {        seedingURIs.clear();    }    /**     * If true then this peer will act as a relay server.     *     * @return If true then this peer will act as a relay server.     */    public boolean isServerEnabled() {        return serverEnabled;    }    /**     * If true then this peer will act as a relay server.     *     * @param enabled If true then this peer will act as a relay server.     */    public void setServerEnabled(boolean enabled) {        serverEnabled = enabled;    }    /**     * Return the maximum number of relay clients.     *     * @return The maximum number of relay clients or <code>-1</code> for     *         default value.     */    public int getMaxClients() {        return maxClients;    }    /**     * Sets he maximum number of relay clients.     *     * @param newvalue The maximum number of relay clients or <code>-1</code>     *                 for default value.     */    public void setMaxClients(int newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Max Clients must be > 0");        }        maxClients = newvalue;    }    /**     * Return the client message queue length size.     *     * @return The client message queue length size or <code>-1</code> for default value.     */    public int getClientMessageQueueSize() {        return maxClientMessageQueue;    }    /**     * Sets the client message queue length size.     *     * @param newvalue The client message queue length size or <code>-1</code>     *                 for default value.     */    public void setClientMessageQueueSize(int newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Client Message Queue Size must be > 0");        }        maxClientMessageQueue = newvalue;    }    /**     * The interval in relative milliseconds of leases offered by servers.     *     * @return The interval in relative milliseconds of leases offered by servers.     */    public long getServerLeaseDuration() {        return maxServerLeaseDuration;    }    /**     * Sets interval in relative milliseconds of leases  offered by servers.     *     * @param newvalue The interval in relative milliseconds of leases offered     *                 by servers or <code>-1</code> for default value.     */    public void setServerLeaseDuration(long newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Lease Duration must be >= 0");        }        maxServerLeaseDuration = newvalue;    }    /**     * The interval in relative milliseconds after which a client is assumed to     * no longer be connected if it fails to request messages.     *     * @return The interval in relative milliseconds after which a client is     *         assumed to no longer be connected if it fails to request messages or     *         <code>-1</code> for default value.     */    public long getStallTimeout() {        return stallTimeout;    }    /**     * Sets interval in relative milliseconds after which a client is assumed to     * no longer be connected if it fails to request messages.     *     * @param newvalue The interval in relative milliseconds after which a     *                 client is  assumed to no longer be connected if it fails to request     *                 messages or <code>-1</code> for default value.     */    public void setStallTimeout(long newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Stall timeout must be > 0");        }        stallTimeout = newvalue;    }    /**     * The interval in relative milliseconds at which relay server will     * announce its presence.     *     * @return The interval in relative milliseconds at which relay server will     *         broadcast its presence or <code>-1</code> for default value.     */    public long getAnnounceInterval() {        return announceInterval;    }    /**     * Sets interval in relative milliseconds at which relay server will     * announce its presence  or <code>-1</code> for default value.     *     * @param newvalue The interval in relative milliseconds at which relay server will     *                 announce its presence.     */    public void setAnnounceInterval(long newvalue) {        if ((-1 != newvalue) && (newvalue <= 0)) {            throw new IllegalArgumentException("Announce Interval must be > 0");        }        announceInterval = newvalue;    }    /**     * Return ACL URI if set     *     * @return ACL URI if set, null otherwise     */    public URI getAclUri() {        return aclURI;    }    /**     * Sets ACL URI     *     * @param uri URI if set, null otherwise     */    public void setAclUri(URI uri) {        aclURI = uri;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -