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
XBean

Field Summary
protected  java.util.Set<Transport> transports
          The service transports.
 
Constructor Summary
AbstractProtocolService()
           
 
Method Summary
 void addTransports(Transport... transports)
          Add underlying transports
 org.apache.mina.transport.socket.DatagramAcceptor getDatagramAcceptor(Transport udpTransport)
          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 getServiceId()
          Gets the instance identifier for this ProtocolService.
 java.lang.String getServiceName()
          Gets a descriptive name for the kind of service this represents.
 org.apache.mina.transport.socket.SocketAcceptor getSocketAcceptor(Transport tcpTransport)
          If this protocol service support TCP transport then this gets the MINA SocketAcceptor it uses.
 Transport[] getTransports()
           
 boolean isEnabled()
          Services can be enabled or disabled.
 boolean isStarted()
          Gets whether or not this service has been started.
 void setDirectoryService(DirectoryService directoryService)
          Sets the DirectoryService assigned to this ProtocolService.
 void setEnabled(boolean enabled)
          Sets whether or not this ProtocolService is enabled.
 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.
protected  void setStarted(boolean started)
           
 void setTransports(Transport... transports)
          Set the underlying transports
 
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
 

Field Detail

transports

protected java.util.Set<Transport> transports
The service transports. We may have more than one

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
XBean Property
hidden="true"

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)
Parameters:
started - The state of this server
XBean Property
hidden="true"

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)
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
XBean Property
hidden="true"

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:
The server name

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 - The server name
XBean Property
hidden="true" Set the current server's name.

getTransports

public Transport[] getTransports()
Returns:
the transport

setTransports

public void setTransports(Transport... transports)
Set the underlying transports

Parameters:
transport - The transports

addTransports

public void addTransports(Transport... transports)
Add underlying transports

Parameters:
transport - The transports

getDatagramAcceptor

public org.apache.mina.transport.socket.DatagramAcceptor getDatagramAcceptor(Transport udpTransport)
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

getSocketAcceptor

public org.apache.mina.transport.socket.SocketAcceptor getSocketAcceptor(Transport tcpTransport)
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


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