buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsProperties.java
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 629 541af5ee3ed9
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
     1 /*
       
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 package com.nokia.helium.diamonds;
       
    21 
       
    22 import java.util.Map;
       
    23 
       
    24 /**
       
    25  * Helper class for Diamonds properties need to connect.
       
    26  * 
       
    27  */
       
    28 public class DiamondsProperties {
       
    29     private Map<String, String> diamondsProperties;
       
    30 
       
    31     public DiamondsProperties(Map<String, String> configroperties) {
       
    32         diamondsProperties = configroperties;
       
    33     }
       
    34 
       
    35     /**
       
    36      * Gets the build id returned by Diamonds server.
       
    37      * 
       
    38      * @return build ID
       
    39      */
       
    40     public String getDiamondsBuildID() {
       
    41         return diamondsProperties.get("buildid");
       
    42     }
       
    43 
       
    44     /**
       
    45      * Sets the build id obtained from the server.
       
    46      * 
       
    47      * @param diamondsBuildID
       
    48      */
       
    49     public void setDiamondsBuildID(String diamondsBuildID) {
       
    50         diamondsProperties.put("buildid", diamondsBuildID);
       
    51     }
       
    52 
       
    53     /**
       
    54      * Returns the required property obtained from config
       
    55      * 
       
    56      * @param property
       
    57      *            for which the values needs to be obtained.
       
    58      * @return address of server
       
    59      */
       
    60     public String getProperty(String property) {
       
    61         // need to validate the properties while assigning in constructor
       
    62         return diamondsProperties.get(property);
       
    63     }
       
    64 }