001/*
002 * JPPF.
003 * Copyright (C) 2005-2015 JPPF Team.
004 * http://www.jppf.org
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019package org.jppf.client;
020
021import org.jppf.client.event.ClientConnectionStatusHandler;
022import org.jppf.management.JPPFSystemInformation;
023
024/**
025 * Interface for a client connection to a JPPF driver.
026 * @author Laurent Cohen
027 */
028public interface JPPFClientConnection extends ClientConnectionStatusHandler, AutoCloseable {
029  /**
030   * Get the priority assigned to this connection.
031   * @return a priority as an int value.
032   */
033  int getPriority();
034
035  /**
036   * Shutdown this connection and release all the resources it is using.
037   */
038  @Override
039  void close();
040
041  /**
042   * Determine whether this connection was closed.
043   * @return <code>true</code> if the connection is closed, <code>false</code> otherwise.
044   */
045  boolean isClosed();
046
047  /**
048   * Get the name assigned to this client connection.
049   * @return the name as a string.
050   */
051  String getName();
052
053  /**
054   * Determines if this connection is over SSL.
055   * @return <code>true</code> if this is an SSL connection, <code>false</code> otherwise.
056   */
057  boolean isSSLEnabled();
058
059  /**
060   * Get the driver's host name or ip address.
061   * @return the host as a stirng.
062   */
063  String getHost();
064
065  /**
066   * Get the port number on which the dirver is listeneing for connections.
067   * @return the port number as an int.
068   */
069  int getPort();
070
071  /**
072   * Get the unique identifier of the remote driver.
073   * @return the uuid as a string.
074   */
075  String getDriverUuid();
076
077  /**
078   * Get the system information for the remote driver this connection refers to.
079   * @return a {@link JPPFSystemInformation} instance.
080   */
081  JPPFSystemInformation getSystemInfo();
082
083  /**
084   * Get the unique ID for this connection and its two channels.
085   * @return the id as a string.
086   */
087  String getConnectionUuid();
088
089  /**
090   * Get the pool this connection belongs to.
091   * @return a {@link JPPFConnectionPool} instance.
092   */
093  JPPFConnectionPool getConnectionPool();
094}