org.apache.directory.studio.apacheds.model
Class ServersHandler

java.lang.Object
  extended by org.apache.directory.studio.apacheds.model.ServersHandler

public class ServersHandler
extends java.lang.Object

This class implements the servers handler.

It is used to store all the servers used in the plugin.

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

Method Summary
 void addListener(ServersHandlerListener listener)
          Adds a listener to the servers handler.
 void addServer(Server server)
          Adds a server.
 boolean containsServer(Server server)
          Indicates if the server handler contains the given server.
static ServersHandler getDefault()
          Gets the default servers handler (singleton pattern).
 Server getServerById(java.lang.String id)
          Gets the server associated with the given id.
 java.util.List<Server> getServersList()
          Gets the servers list.
 boolean isNameAvailable(java.lang.String name)
          Indicates if the given is available (i.e.
 void loadServersFromStore()
          Loads the server from the file store.
 void removeListener(ServersHandlerListener listener)
          Removes a listener to the servers handler.
 void removeServer(Server server)
          Removes a server.
 void saveServersToStore()
          Saves the server to the file store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefault

public static ServersHandler getDefault()
Gets the default servers handler (singleton pattern).

Returns:
the default servers handler

addServer

public void addServer(Server server)
Adds a server.

Parameters:
server - the server to be added

removeServer

public void removeServer(Server server)
Removes a server.

Parameters:
server - the server to be removed

containsServer

public boolean containsServer(Server server)
Indicates if the server handler contains the given server.

Parameters:
server - the server
Returns:
true if the server hander contains the given server, false if not

addListener

public void addListener(ServersHandlerListener listener)
Adds a listener to the servers handler.

Parameters:
listener - the listener to add

removeListener

public void removeListener(ServersHandlerListener listener)
Removes a listener to the servers handler.

Parameters:
listener - the listener to remove

loadServersFromStore

public void loadServersFromStore()
Loads the server from the file store.


saveServersToStore

public void saveServersToStore()
Saves the server to the file store.


isNameAvailable

public boolean isNameAvailable(java.lang.String name)
Indicates if the given is available (i.e. not already taken by another server).

Parameters:
name - the name
Returns:
true if the name is available, false if not

getServersList

public java.util.List<Server> getServersList()
Gets the servers list.

Returns:
the servers list.

getServerById

public Server getServerById(java.lang.String id)
Gets the server associated with the given id.

Returns:
the server associated witht the given id.


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