| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| WsSpace |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * ============================================================================ | |
| 3 | * | |
| 4 | * File: WsSpace.java | |
| 5 | *---------------------------------------------------------------------------- | |
| 6 | * | |
| 7 | * Copyright 2008 Erlend Nossum | |
| 8 | * | |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 10 | * you may not use this file except in compliance with the License. | |
| 11 | * You may obtain a copy of the License at | |
| 12 | * | |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 14 | * | |
| 15 | * Unless required by applicable law or agreed to in writing, software | |
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 18 | * See the License for the specific language governing permissions and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * Description: See javadoc below | |
| 22 | * | |
| 23 | * Created: Mar 4, 2008 | |
| 24 | * ============================================================================ | |
| 25 | */ | |
| 26 | ||
| 27 | package org.semispace.ws; | |
| 28 | ||
| 29 | import javax.jws.WebService; | |
| 30 | ||
| 31 | /** | |
| 32 | * Proxy interface for SemiSpace. Everything | |
| 33 | * defined as string is supplied as XML, instead of | |
| 34 | * Objects. Otherwise it is equal to the SemiSpace | |
| 35 | * interface. | |
| 36 | */ | |
| 37 | @WebService | |
| 38 | public interface WsSpace { | |
| 39 | /** | |
| 40 | * Put XML structured data into space with given lifetime | |
| 41 | * @param contents XML data | |
| 42 | */ | |
| 43 | public void write( String contents, long timeToLiveMs ); | |
| 44 | /** | |
| 45 | * Supply an XML template, which will be matched on | |
| 46 | * <b>the first</b>. In other words, the following template | |
| 47 | * will be matched on <i>firstname</i> only: | |
| 48 | * <pre> | |
| 49 | * <person> | |
| 50 | * <firstname>Erlend</firstname> | |
| 51 | * <projects> | |
| 52 | * <project>SemiSpace</project> | |
| 53 | * </projects> | |
| 54 | * </pre> | |
| 55 | * The entry is left in the space | |
| 56 | * @param template XML template | |
| 57 | * @param queryLifeMs Life of query in milliseconds. Notice that | |
| 58 | * you will want to repeatedly read instead of having | |
| 59 | * a very long timeout (i.e. more than 30 seconds) | |
| 60 | */ | |
| 61 | public String read( String template, long queryLifeMs ); | |
| 62 | /** | |
| 63 | * Read without any timeout; You get an answer immediately | |
| 64 | * @see #read(String, long) | |
| 65 | */ | |
| 66 | public String readIfExists( String template ); | |
| 67 | /** | |
| 68 | * Same as read, except that the entry is removed from the space. | |
| 69 | * @see #read(String, long) | |
| 70 | */ | |
| 71 | public String take( String template, long queryLifeMs ); | |
| 72 | /** | |
| 73 | * @see #take(String, long) | |
| 74 | */ | |
| 75 | public String takeIfExists( String template ); | |
| 76 | } |