org.apache.directory.server.protocol.shared
Class AbstractProtocolService

java.lang.Object
  extended by org.apache.directory.server.protocol.shared.AbstractProtocolService
All Implemented Interfaces:
ProtocolService
Direct Known Subclasses:
DirectoryBackedService, NtpServer

public abstract class AbstractProtocolService
extends java.lang.Object
implements ProtocolService

An abstract base class for a ProtocolService. The start/stop methods have not been implemented.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
AbstractProtocolService()
           
 
Method Summary
 DatagramAcceptor getDatagramAcceptor()
          If this protocol service supports UDP transport then this gets the non-null MINA DatagramAcceptor it uses.
 DirectoryService getDirectoryService()
          Gets the DirectoryService assigned to this ProtocolService.
 java.lang.String getIpAddress()
          Gets the IP address of this service.
 int getIpPort()
          Gets the IP port for this service.
 java.lang.String getServiceId()
          Gets the instance identifier for this ProtocolService.
 java.lang.String getServiceName()
          Gets a descriptive name for the kind of service this represents.
 SocketAcceptor getSocketAcceptor()
          If this protocol service support TCP transport then this gets the MINA SocketAcceptor it uses.
 java.util.Set<TransportProtocol> getTransportProtocols()
          Gets the transport protocols used by this service.
 boolean isEnabled()
          Services can be enabled or disabled.
 boolean isStarted()
          Gets whether or not this service has been started.
 void setDatagramAcceptor(DatagramAcceptor datagramAcceptor)
          If this protocol service supports UDP transport then this sets the MINA DatagramAcceptor it uses.
 void setDirectoryService(DirectoryService directoryService)
          Sets the DirectoryService assigned to this ProtocolService.
 void setEnabled(boolean enabled)
          Sets whether or not this ProtocolService is enabled.
 void setIpAddress(java.lang.String ipAddress)
          Gets the IP address of this service.
 void setIpPort(int ipPort)
          Sets the IP port for this service.
 void setServiceId(java.lang.String serviceId)
          Sets the instance identifier for this ProtocolService.
 void setServiceName(java.lang.String name)
          Sets the descriptive name for the kind of service this represents.
 void setSocketAcceptor(SocketAcceptor socketAcceptor)
          If this protocol service support TCP transport then this sets the MINA SocketAcceptor it uses.
protected  void setStarted(boolean started)
           
 void setTransportProtocols(java.util.Set<TransportProtocol> transportProtocols)
          Sets the transport protocols used by this service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.server.protocol.shared.ProtocolService
start, stop
 

Constructor Detail

AbstractProtocolService

public AbstractProtocolService()
Method Detail

getDirectoryService

public DirectoryService getDirectoryService()
Description copied from interface: ProtocolService
Gets the DirectoryService assigned to this ProtocolService.

Specified by:
getDirectoryService in interface ProtocolService
Returns:
the directory service core assigned to this service

setDirectoryService

public void setDirectoryService(DirectoryService directoryService)
Description copied from interface: ProtocolService
Sets the DirectoryService assigned to this ProtocolService.

Specified by:
setDirectoryService in interface ProtocolService
Parameters:
directoryService - the directory service core assigned to this service

isStarted

public boolean isStarted()
Description copied from interface: ProtocolService
Gets whether or not this service has been started.

Specified by:
isStarted in interface ProtocolService
Returns:
true if the service has started, false otherwise

setStarted

protected void setStarted(boolean started)

isEnabled

public boolean isEnabled()
Description copied from interface: ProtocolService
Services can be enabled or disabled. If enabled they will be started, if not they will not.

Specified by:
isEnabled in interface ProtocolService
Returns:
true if this service is to be started, false otherwise

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: ProtocolService
Sets whether or not this ProtocolService is enabled.

Specified by:
setEnabled in interface ProtocolService
Parameters:
enabled - true to enable, false to disable

getServiceId

public java.lang.String getServiceId()
Description copied from interface: ProtocolService
Gets the instance identifier for this ProtocolService.

Specified by:
getServiceId in interface ProtocolService
Returns:
the identifier for the service instance

setServiceId

public void setServiceId(java.lang.String serviceId)
Description copied from interface: ProtocolService
Sets the instance identifier for this ProtocolService.

Specified by:
setServiceId in interface ProtocolService
Parameters:
serviceId - an identifier for the service instance

getServiceName

public java.lang.String getServiceName()
Description copied from interface: ProtocolService
Gets a descriptive name for the kind of service this represents. This name is constant across instances of this ProtocolService.

Specified by:
getServiceName in interface ProtocolService
Returns:
a descriptive name for the kind of this service

setServiceName

public void setServiceName(java.lang.String name)
Description copied from interface: ProtocolService
Sets the descriptive name for the kind of service this represents. This name is constant across instances of this ProtocolService.

Specified by:
setServiceName in interface ProtocolService
Parameters:
name - a descriptive name for the kind of this service

getIpAddress

public java.lang.String getIpAddress()
Description copied from interface: ProtocolService
Gets the IP address of this service.

Specified by:
getIpAddress in interface ProtocolService
Returns:
the IP address for this service.

setIpAddress

public void setIpAddress(java.lang.String ipAddress)
Description copied from interface: ProtocolService
Gets the IP address of this service.

Specified by:
setIpAddress in interface ProtocolService
Parameters:
ipAddress - the Internet Protocol address for this service.

getIpPort

public int getIpPort()
Description copied from interface: ProtocolService
Gets the IP port for this service.

Specified by:
getIpPort in interface ProtocolService
Returns:
the IP port for this service

setIpPort

public void setIpPort(int ipPort)
Description copied from interface: ProtocolService
Sets the IP port for this service.

Specified by:
setIpPort in interface ProtocolService
Parameters:
ipPort - the ip port for this service

getTransportProtocols

public java.util.Set<TransportProtocol> getTransportProtocols()
Description copied from interface: ProtocolService
Gets the transport protocols used by this service. At this point services which support more than one transport are configured to bind to that transport on the same port.

Specified by:
getTransportProtocols in interface ProtocolService
Returns:
the transport protocols used by this service

setTransportProtocols

public void setTransportProtocols(java.util.Set<TransportProtocol> transportProtocols)
Description copied from interface: ProtocolService
Sets the transport protocols used by this service.

Specified by:
setTransportProtocols in interface ProtocolService
Parameters:
transportProtocols - the transport protocols to be used by this service

getDatagramAcceptor

public DatagramAcceptor getDatagramAcceptor()
Description copied from interface: ProtocolService
If this protocol service supports UDP transport then this gets the non-null MINA DatagramAcceptor it uses.

Specified by:
getDatagramAcceptor in interface ProtocolService
Returns:
the MINA DatagramAcceptor used for UDP transports

setDatagramAcceptor

public void setDatagramAcceptor(DatagramAcceptor datagramAcceptor)
Description copied from interface: ProtocolService
If this protocol service supports UDP transport then this sets the MINA DatagramAcceptor it uses.

Specified by:
setDatagramAcceptor in interface ProtocolService
Parameters:
datagramAcceptor - the MINA DatagramAcceptor used for UDP transport

getSocketAcceptor

public SocketAcceptor getSocketAcceptor()
Description copied from interface: ProtocolService
If this protocol service support TCP transport then this gets the MINA SocketAcceptor it uses.

Specified by:
getSocketAcceptor in interface ProtocolService
Returns:
the MINA SocketAcceptor used for TCP transport

setSocketAcceptor

public void setSocketAcceptor(SocketAcceptor socketAcceptor)
Description copied from interface: ProtocolService
If this protocol service support TCP transport then this sets the MINA SocketAcceptor it uses.

Specified by:
setSocketAcceptor in interface ProtocolService
Parameters:
socketAcceptor - the MINA SocketAcceptor used for TCP transport


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.