?? configurator.java
字號:
* A {@link net.jxta.ext.config.Transport} is a networking binding. * * @return {@link java.util.List} of {@link net.jxta.ext.config.Transport} */ public List getTransports() { return this.transports != null ? (List)((ArrayList)this.transports).clone() : Collections.EMPTY_LIST; } /** * Clear and resets the {@link net.jxta.ext.config.Transport} value. * * @param transport {@link net.jxta.ext.config.Transport} value. */ public void setTransport(Transport transport) { List t = new ArrayList(); t.add(transport); setTransports(t); } /** * Clears and resets the {@link net.jxta.ext.config.Transport}. * * @param transports {@link net.jxta.ext.config.Transport} */ public void setTransports(List transports) { if (this.transports != null) { this.transports.clear(); } addTransports(transports); } /** * Add a {@link net.jxta.ext.config.Transport}. * * @param transport {@link net.jxta.ext.config.Transport} */ public void addTransport(Transport transport) { addTransports(Collections.singletonList(transport)); } /** * Adds a {@link java.util.List} of {@link net.jxta.ext.config.Transport}. * * @param transports {@link net.jxta.ext.config.Transport} */ public void addTransports(List transports) { for (Iterator i = transports.iterator(); i.hasNext(); ) { Transport t = (Transport)i.next(); if (t != null && (this.transports == null || ! this.transports.contains(t))) { if (this.transports == null) { this.transports = new ArrayList(); } this.transports.add(t); } } } /** * Remove a {@link net.jxta.ext.config.Transport}. * * @param transport {@link net.jxta.ext.config.Transport} * @return removed {@link net.jxta.ext.config.Transport} */ public Transport removeTransport(Transport transport) { Object o = null; if (this.transports != null) { int i = this.transports.indexOf(transport); if (i > -1) { o = this.transports.remove(i); if (this.transports.size() == 0) { this.transports = null; } } } return (Transport)o; } /** * Remove all {@link net.jxta.ext.config.Transport}. */ public void clearTransports() { if (this.transports != null) { this.transports.clear(); this.transports = null; } } // xxx: ?is this needed? /** * Accessor to the security enabler. * * <p>The security enabler specifies whether or not security is enabled. * * @return security enabler */ public boolean isSecurity() { return this.isSecurity; } /** * Specify the security enabler value. * * @param isEnabled the security enabler value */ public void setSecurity(boolean isEnabled) { this.isSecurity = isEnabled; } /** * Accessor to the principal attribute. * * <p>The principal is used to specify the associated {@link java.net.cert.Certificate} * principal. * * @return the configuration principal */ public String getPrincipal() { return this.principal; } /** * Accessor to the password information. * * @return the password */ public String getPassword() { return this.password; } /** * Specify the configuration principal and password. * * @param principal configuration principal * @param password configuration password */ public void setSecurity(String principal, String password) { this.principal = (principal != null && principal.trim().length() > 0 ? principal.trim() : null); this.password = (password != null && password.trim().length() > 0 ? password.trim() : null); } /** * Accessor to the Root Certificate address. * * <p>The Root Certificate is used to sign all subsequent certificates. * * @return the Root Certificate address */ public URI getRootCertificateAddress() { return this.rootCertificateAddress; } /** * Specify the Root Certificate address. * * @param rootCertificateAddress the Root Certificate address */ public void setRootCertificateAddress(URI rootCertificateAddress) { this.rootCertificateAddress = rootCertificateAddress; } /** * Accessor to the Root Certificate. * * <p>The Root Certificate is used to sign all subsequent cerficiates. * * @return the Root Certificate */ public Certificate getRootCertificate() { return this.pse.getCertificate(); } /** * Accessor to the Base64 encoded Root Certificate. * * @return Base64 encoded Root Certificate */ public String getRootCertificateBase64() { String s = null; try { s = this.pse.getCert(); } catch (Exception e) { if (LOG.isEnabledFor(Level.ERROR)) { LOG.error("can't get root cert"); } } return s; } /** * Specify the Root Certificate. * * @param rootCertificate the Root Certificate */ public void setRootCertificate(Certificate rootCertificate) { this.pse.setCertificate((X509Certificate) rootCertificate); } /** * Specify the Root Certificate in Base64 encoded format. * * @param rootCertificate the Root Certificate in Base64 encoded format. */ public void setRootCertificateBase64(String rootCertificate) { if (rootCertificate != null) { this.pse.setCert(rootCertificate); } } /** * Accessor to the {@link net.jxta.ext.config.ProxyAddress}. * * <p>A {@link net.jxta.ext.config.ProxyAddress} is used to optionally negotiate HTTP communications. * * @return {@link net.jxta.ext.config.ProxyAddress} address as a {link java.net.URI} */ public URI getPeerProxyAddress() { return this.peerProxy; } /** * Specify a {@link net.jxta.ext.config.ProxyAddress}. * * @param peerProxyAddress the {@link net.jxta.ext.config.ProxyAddress} address * @throws ConfiguratorException if the address scheme is not "HTTP" * or the port is invalid */ public void setPeerProxyAddress(URI peerProxyAddress) throws ConfiguratorException { if (Util.validateAddress(peerProxyAddress, true).trim().length() == 0) { this.peerProxy = peerProxyAddress; } else { throw new ConfiguratorException("invalid proxy", new IllegalArgumentException("invalid proxy uri: " + peerProxyAddress)); } } /** * Accessor to the Endpoint outgoing queue size. * * <p>A queue size specifies the overall message buffer size when exceeded * messages are dropped. * * @return Endpoint queue size */ public int getEndpointOutgoingQueueSize() { return this.endpointQueueSize; } /** * Specify the outgoing Endpoint queue size. * * @param size the outgoing Endpoint queue size */ public void setEndpointOutgoingQueueSize(int size) { this.endpointQueueSize = size; } /** * Accessor to the {@link net.jxta.impl.proxy.ProxyService} enabler. * * <p>The {@link net.jxta.impl.proxy.ProxyService} enables gatewaying primarily * for use with limited devices. * * @return the {@link net.jxta.impl.proxy.ProxyService} */ public boolean isProxy() { return this.isProxyEnabled; } /** * Specify the {@link net.jxta.impl.proxy.ProxyService} enabler. * * @param isEnabled the {@link net.jxta.impl.proxy.ProxyService} enabler */ public void setProxy(boolean isEnabled) { this.isProxyEnabled = isEnabled; } /** * Accessor to the configuration Infrastructure {@link net.jxta.peergroup.PeerGroupID}. * * <p>A {@link net.jxta.peergroup.PeerGroupID} used to specify unique networks. * * @return {@link net.jxta.peergroup.PeerGroupID} */ public PeerGroupID getInfrastructurePeerGroupId() { return this.infrastructureGroupId; } /** * Specify the Infrastructure {@link net.jxta.peergroup.PeerGroupID}. * * @param pgid {@link net.jxta.peergroup.PeerGroupID} */ public void setInfrastructurePeerGroupId(PeerGroupID pgid) { this.infrastructureGroupId = pgid; } /** * Accessor to the Infrastructure {@link net.jxta.peergroup.PeerGroup} name. * * <p>A Infrastructure PeerGroup name specifies a toolable meta value. * * @return PeerGroup name */ public String getInfrastructurePeerGroupName() { return this.infrastructureGroupName; } /** * Specify the Infrastructure {@link net.jxta.peergroup.PeerGroup} name. * * @param name PeerGroup name */ public void setInfrastructurePeerGroupName(String name) { name = name != null ? name.trim() : name; this.infrastructureGroupName = name != null && name.length() > 0 ? name : null; } /** * Accessor to the Infrastructure {@link net.jxta.peergroup.PeerGroup} description. * * <p>A Infrastructure PeerGroup description specifies a toolable meta value. * * @return PeerGroup description */ public String getInfrastructurePeerGroupDescription() { return this.infrastructureGroupDescription; } /** * Specify the Infrastructure {@link net.jxta.peergroup.PeerGroup} description. * * @param description PeerGroup description */ public void setInfrastructurePeerGroupDescription(String description) { description = description != null ? description.trim() : description; this.infrastructureGroupDescription = description != null && description.length() > 0 ? description : null; } /** * Accessor to the RendezVous Bootstrap address. * * <p>A RendezVous Bootstrap address is used to establish initial, aka * "seeding," RendezVous addresses, in the form of {@link java.net.URI}. * * @return the RendezVous Bootstrap address in the form of a * {@link java.net.URI} */ public URI getRendezVousBootstrapAddress() { //return this.rendezVousBootstrap; URI[] u = this.rdvConfig != null ?
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -