net.sf.tm.plugin
Class ServerStore

java.lang.Object
  extended bynet.sf.tm.plugin.ServerStore

public final class ServerStore
extends Object

Implementation of a persistence store for server objects. All modifications off the store are saved immediately.

The store is saved as a XMLMemento und the filename server.xml in the plugin directory.

Version:
$Id: ServerStore.java,v 1.9 2004/01/25 10:37:15 apataki Exp $
Author:
Andreas Pataki

Method Summary
 void add(TomcatServer server)
          Adds a new server to the store.
 boolean contains(TomcatServer server)
           
 TomcatServer get(int index)
           
static ServerStore getInstance()
           
 int getSize()
           
 Iterator iterator()
           
 void remove(TomcatServer server)
          Removes a server from the store.
 void set(TomcatServer server)
          Sets the given seren.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSize

public int getSize()
Returns:
the current size of the store

add

public void add(TomcatServer server)
Adds a new server to the store. The store will get saved.

Parameters:
server - New server

remove

public void remove(TomcatServer server)
Removes a server from the store. The store will get saved.

Parameters:
server - Server which shall be deleted.

contains

public boolean contains(TomcatServer server)
Parameters:
server - Server to look for
Returns:
true if the server is allready in the store

get

public TomcatServer get(int index)
Parameters:
index - Index of the server
Returns:
The server found at the given index

iterator

public Iterator iterator()
Returns:
Iterator of the server store

set

public void set(TomcatServer server)
Sets the given seren. The old entry is replaced by this new one.

Parameters:
server - Server to be updated

getInstance

public static ServerStore getInstance()
Returns:
singelton instance


Copyright © 2003-2004 Andreas Pataki. All Rights Reserved.