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

public abstract class AbstractProtocolService
extends Object
implements ProtocolService

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

Author:
Apache Directory Project

Field Summary
protected  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.
 String getServiceId()
          Gets the instance identifier for this ProtocolService.
 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 setEnabled(boolean enabled)
          Sets whether or not this ProtocolService is enabled.
 void setServiceId(String serviceId)
          Sets the instance identifier for this ProtocolService.
 void setServiceName(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 Set<Transport> transports
The service transports. We may have more than one

Constructor Detail

AbstractProtocolService

public AbstractProtocolService()
Method Detail

isStarted

public boolean isStarted()
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

isEnabled

public boolean isEnabled()
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 String getServiceId()
Gets the instance identifier for this ProtocolService.

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

setServiceId

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

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

getServiceName

public String getServiceName()
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(String name)
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

getTransports

public Transport[] getTransports()
Returns:
the transport

setTransports

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

Parameters:
transports - The transports

addTransports

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

Parameters:
transports - 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-2013 The Apache Software Foundation. All Rights Reserved.