org.apache.directory.server.protocol.shared
Interface ProtocolService

All Known Implementing Classes:
AbstractProtocolService, ChangePasswordServer, DirectoryBackedService, DnsServer, KdcServer, LdapService, NtpServer

public interface ProtocolService

Minimum functionality required by an ApacheDS protocol service.

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

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.
 void setTransportProtocols(java.util.Set<TransportProtocol> transportProtocols)
          Sets the transport protocols used by this service.
 void start()
          Starts this ProtocolService which binds acceptors on the protocol port.
 void stop()
          Stops this ProtocolService which unbinds acceptors on the protocol port.
 

Method Detail

stop

void stop()
          throws java.lang.Exception
Stops this ProtocolService which unbinds acceptors on the protocol port.

Throws:
java.lang.Exception - if there are problems stopping this service

start

void start()
           throws java.lang.Exception
Starts this ProtocolService which binds acceptors on the protocol port.

Throws:
java.lang.Exception - if there are problems starting this service

isStarted

boolean isStarted()
Gets whether or not this service has been started.

Returns:
true if the service has started, false otherwise

getDatagramAcceptor

DatagramAcceptor getDatagramAcceptor()
If this protocol service supports UDP transport then this gets the non-null MINA DatagramAcceptor it uses.

Returns:
the MINA DatagramAcceptor used for UDP transports

setDatagramAcceptor

void setDatagramAcceptor(DatagramAcceptor datagramAcceptor)
If this protocol service supports UDP transport then this sets the MINA DatagramAcceptor it uses.

Parameters:
datagramAcceptor - the MINA DatagramAcceptor used for UDP transport

getSocketAcceptor

SocketAcceptor getSocketAcceptor()
If this protocol service support TCP transport then this gets the MINA SocketAcceptor it uses.

Returns:
the MINA SocketAcceptor used for TCP transport

setSocketAcceptor

void setSocketAcceptor(SocketAcceptor socketAcceptor)
If this protocol service support TCP transport then this sets the MINA SocketAcceptor it uses.

Parameters:
socketAcceptor - the MINA SocketAcceptor used for TCP transport

isEnabled

boolean isEnabled()
Services can be enabled or disabled. If enabled they will be started, if not they will not.

Returns:
true if this service is to be started, false otherwise

setEnabled

void setEnabled(boolean enabled)
Sets whether or not this ProtocolService is enabled.

Parameters:
enabled - true to enable, false to disable

getServiceId

java.lang.String getServiceId()
Gets the instance identifier for this ProtocolService.

Returns:
the identifier for the service instance

setServiceId

void setServiceId(java.lang.String serviceId)
Sets the instance identifier for this ProtocolService.

Parameters:
serviceId - an identifier for the service instance

getServiceName

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

Returns:
a descriptive name for the kind of this service

setServiceName

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

Parameters:
name - a descriptive name for the kind of this service

getIpAddress

java.lang.String getIpAddress()
Gets the IP address of this service.

Returns:
the IP address for this service.

setIpAddress

void setIpAddress(java.lang.String ipAddress)
Gets the IP address of this service.

Parameters:
ipAddress - the Internet Protocol address for this service.

getIpPort

int getIpPort()
Gets the IP port for this service.

Returns:
the IP port for this service

setIpPort

void setIpPort(int ipPort)
Sets the IP port for this service.

Parameters:
ipPort - the ip port for this service
Throws:
java.lang.IllegalArgumentException - if the port number is not within a valid range

getTransportProtocols

java.util.Set<TransportProtocol> getTransportProtocols()
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.

Returns:
the transport protocols used by this service

setTransportProtocols

void setTransportProtocols(java.util.Set<TransportProtocol> transportProtocols)
Sets the transport protocols used by this service.

Parameters:
transportProtocols - the transport protocols to be used by this service

getDirectoryService

DirectoryService getDirectoryService()
Gets the DirectoryService assigned to this ProtocolService.

Returns:
the directory service core assigned to this service

setDirectoryService

void setDirectoryService(DirectoryService directoryService)
Sets the DirectoryService assigned to this ProtocolService.

Parameters:
directoryService - the directory service core assigned to this service


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