Package org.jitterbit.util.net

Examples of org.jitterbit.util.net.Port


     *            the port to connect to. If <code>port <= 0</code>, the port number will not be
     *            considered when connecting to this location.
     */
    @Override
    public void setPort(Port port) {
        Port old;
        synchronized (getDataLock()) {
            old = portSupport.setPort(port);
        }
        firePropertyChange(PORT_PROPERTY, old, port);
    }
View Full Code Here


        return isPortNumberValid();
    }

    private boolean isPortNumberValid() {
        String s = this.port.get();
        Port port = Port.valueOf(s);
        return port != Port.DEFAULT && port != Port.INVALID;
    }
View Full Code Here

            errors.add(MISSING_SERVER);
        }
    }

    private void validatePort() {
        Port port = location.getPort();
        if (port == Port.INVALID) {
            errors.add(INVALID_PORT);
        }
    }
View Full Code Here

     *            the <code>Port</code> through which the <code>PortAccessible</code> should be
     *            accessed
     * @return the old <code>Port</code>
     */
    public Port setPort(Port port) {
        Port old = getPort();
        if (Objects.equal(old, port)) {
            return port;
        }
        if (port != null) {
            data.setProperty(propertyName, port.getPort());
View Full Code Here

     * @return the port to use.
     */
    @Override
    public Port getPort() {
        synchronized (getDataLock()) {
            Port port = portSupport.getPort();
            // XXX: This is to be backwards compatible with FTP locations created in versions <
            // 1.3.0.71.
            // In that version FtpLocation implements PortAccessible, we use Port.DEFAULT to denote
            // a default port.
            if (port != null && port.getPort() == DEFAULT_PORT) {
                return Port.DEFAULT;
            }
            return port;
        }
    }
View Full Code Here

     * @param port
     *            the port to use.
     */
    @Override
    public void setPort(Port port) {
        Port old;
        synchronized (getDataLock()) {
            old = portSupport.setPort(port);
        }
        firePropertyChange(PROPERTY_PORT, old, port);
    }
View Full Code Here

        assertTrue(loc.getDriver() == null);
    }

    @Test
    public void ensureGetAndSetPortWorks() {
        Port newPort = Port.valueOf(1000);
        TestDataUtils.testGetterAndSetter(loc, DatabaseLocation.PORT_PROPERTY, "getPort", "setPort", Port.DEFAULT,
                        newPort);
        Port oldPort = newPort;
        newPort = Port.valueOf(-1);
        TestDataUtils.testGetterAndSetter(loc, DatabaseLocation.PORT_PROPERTY, "getPort", "setPort", oldPort, newPort);
        assertSame(Port.INVALID, loc.getPort());
        loc.setPort(null);
        assertSame(Port.DEFAULT, loc.getPort());
View Full Code Here

    public void ensureGetConnectionParamsWorks() {
        String server = "localhost";
        String db = "test";
        String user = "user";
        String password = "secret";
        Port port = Port.valueOf(5432);
        loc.setServer(server);
        loc.setDatabase(db);
        loc.setLogin(user);
        loc.setPassword(password);
        loc.setPort(port);
View Full Code Here

     *            the port to use. If <code>null</code>, this LDAP location will use a default
     *            port when connecting to the server.
     */
    @Override
    public void setPort(Port port) {
        Port old;
        synchronized (getDataLock()) {
            old = portSupport.setPort(port);
        }
        firePropertyChange(PORT_PROPERTY, old, port);
    }
View Full Code Here

    }

    private WsLdapConnectionParams getConnectionParamsForWs(LdapConnectionParameters params) {
        WsLdapConnectionParams wsParams = new WsLdapConnectionParams();
        wsParams.setServer(params.serverName);
        Port port = params.port;
        if (port != null) {
            wsParams.setPort(String.valueOf(port.getPort()));
        }
        wsParams.setUser(params.userName);
        wsParams.setPassword(params.password);
        wsParams.setSecurityLevel(params.securityLevel.getId());
        return wsParams;
View Full Code Here

TOP

Related Classes of org.jitterbit.util.net.Port

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.