blob: b6a248a659a1b76d4f5f025bf2583ea10032254b [file] [log] [blame]
/* $Id$
*
* Copyright 2007-2008 Cisco Systems Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
module org.apache.etch.examples.distmap
/**
* The DistributedHashTable example program implements a simple service
* for modifying a distributed hash table.
*/
service DistributedHashTable
{
/**
* Puts a value in the hash table.
*
* @param key the key for the value.
* @param value the value of the key.
* @return the old value of the key, or null if this is a new entry.
*/
object putObject(string key, object value)
/**
* Gets a value from the hash table.
*
* @param key the key for the value.
* @return the value of the key, or null if there is no entry for the key.
*/
object getObject(string key)
/**
* Removes the value from the hash table.
*
* @param key the key for the value.
* @return the old value of the key, or null if there was no entry for
* the key.
*/
object removeObject(string key)
/**
* An entry in the hash table.
* @param key the key for the value.
* @param value the value of the key.
*/
struct Entry(string key, object value)
/**
* Gets all entries in the hash table.
*
* @return an array of all the entries in the hash table.
*/
Entry[] getAll()
/**
* Gets the number of entries in the hash table.
* @return size of the hash table.
*/
int size()
}