ConnectionHandlerDescriptor.java revision 998747bfaaa3c6b28bbfaf0e282e6c0ccbf46bc0
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS
*/
/**
* This class is used to represent a Listener and is aimed to be used by the
* classes in the ListenersTableModel class.
*/
public class ConnectionHandlerDescriptor
{
/**
* Enumeration used to represent the state of the listener.
*/
public enum State
{
/**
* The listener is enabled.
*/
/**
* The listener is disabled.
*/
/**
* The state of the listener is unknown.
*/
};
/**
* Enumeration used to represent the Protocol of the listener.
*
*/
public enum Protocol
{
/**
* LDAP protocol.
*/
/**
* LDAP accepting Start TLS protocol.
*/
/**
* LDAP secure protocol.
*/
/**
* HTTP protocol.
*/
/**
* HTTP secure protocol.
*/
/**
* JMX protocol.
*/
/**
* JMX secure protocol.
*/
/**
* LDIF protocol.
*/
/**
* SNMP protocol.
*/
/**
* Replication protocol. Even if in the configuration is not considered
* as a listener, we display it on the table.
*/
/**
* Secure replication protocol.
*/
/**
* Admin connector protocol.
*/
/**
* Other protocol.
*/
private LocalizableMessage displayMessage;
{
this.displayMessage = displayMessage;
}
/**
* Returns the display LocalizableMessage to be used for the protocol.
* @return the display LocalizableMessage to be used for the protocol.
*/
public LocalizableMessage getDisplayMessage()
{
return displayMessage;
}
}
private int port;
private int hashCode;
/**
* Constructor for the connection handler..
* @param addresses the list of InetAdresses of the listener.
* @param port the port of the connection handler.
* @param protocol the protocol of the listener.
* @param state the state of the connection handler (enabled, disabled, etc.).
* @param name the name of the listener.
* @param monitoringEntries the LDAP entries containing the monitoring
* information.
*/
{
{
}
}
/**
* Returns the address port representation of the listener.
* @return the address port representation of the listener.
*/
{
return addresses;
}
/**
* Returns the protocol of the listener.
* @return the protocol of the listener.
*/
public Protocol getProtocol()
{
return protocol;
}
/**
* Returns the state of the listener.
* @return the state of the listener.
*/
{
return state;
}
/**
* Returns the monitoring entries.
* @return the monitoring entries.
*/
{
return monitoringEntries;
}
/**
* Sets the monitoring entries.
* @param monitoringEntries the monitoring entries.
*/
{
}
/**
* {@inheritDoc}
*/
public int hashCode()
{
return hashCode;
}
/**
* {@inheritDoc}
*/
{
return toString;
}
/**
* {@inheritDoc}
*/
{
boolean equals = false;
if (o == this)
{
equals = true;
}
else if (o instanceof ConnectionHandlerDescriptor)
{
if (equals)
{
// Compare monitoring entries
}
}
return equals;
}
/**
* Returns the port of the connection handler.
* @return the port of the connection handler.
*/
public int getPort()
{
return port;
}
/**
* Returns the name of the connection handler.
* @return the name of the connection handler.
*/
{
return name;
}
}