f53aca9756b8ebc1f19abb29b5552bd1c1966917
[vfc/nfvo/wfengine.git] / winery / org.eclipse.winery.repository.client / src / main / java / org / eclipse / winery / repository / client / IWineryRepositoryClient.java
1 /*******************************************************************************
2  * Copyright (c) 2012-2013 University of Stuttgart.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * and the Apache License 2.0 which both accompany this distribution,
6  * and are available at http://www.eclipse.org/legal/epl-v10.html
7  * and http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Contributors:
10  *     Oliver Kopp - initial API and implementation
11  *******************************************************************************/
12 package org.eclipse.winery.repository.client;
13
14 import org.eclipse.winery.common.interfaces.IWineryRepository;
15
16 public interface IWineryRepositoryClient extends IWineryRepository {
17         
18         /**
19          * Adds an URI to the list of known repositories
20          * 
21          * SIDE EFFECT: If currently no primary repository is defined, the given
22          * repository is used as primary repository
23          * 
24          * @param uri the URI of the repository
25          */
26         void addRepository(String uri);
27         
28         /**
29          * Get the currently defined primary repository
30          */
31         String getPrimaryRepository();
32         
33         /**
34          * Sets the primary repository
35          * 
36          * SIDE EFFECT: If the repository is not known as general repository (via
37          * addRepository), the given repository is added to the list of known
38          * repositories
39          * 
40          * @param uri
41          */
42         void setPrimaryRepository(String uri);
43         
44         /**
45          * Checks whether the primary repository is available to be used. Typically,
46          * this method should return "true". In case of network or server failures,
47          * the result is "false". Note that the availability may change over time
48          * and also a repository might become unavailable during querying it.
49          * 
50          * This method also returns "false" if no primary repository is set. For
51          * instance, this is the case of no repository is registered at the client.
52          * 
53          * @return true if the repository is reachable over network, false otherwise
54          */
55         boolean primaryRepositoryAvailable();
56 }