buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/SessionSet.java
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     1
/*
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     2
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     3
* All rights reserved.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     4
* This component and the accompanying materials are made available
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     6
* which accompanies this distribution, and is available
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     8
*
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     9
* Initial Contributors:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    11
*
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    12
* Contributors:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    13
*
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    14
* Description: 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    15
*
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    16
*/
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    17
 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    18
package com.nokia.helium.ccmtask.ant.types;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    19
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    20
import java.util.Vector;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    21
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    22
import org.apache.tools.ant.types.DataType;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    23
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    24
/**
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    25
 * This class implement an Ant Datatype that represents a set of
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    26
 * synergy sessions.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    27
 * @ant.type name="sessionset" category="SCM"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    28
 */
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    29
public class SessionSet extends DataType {
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    30
    private Vector<Session> sessions = new Vector<Session>();
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    31
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    32
    /**
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    33
     * Create and register a Session object. 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    34
     * @return a Session object.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    35
     */
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    36
    public Session createSession() {
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    37
        Session session = new Session();
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    38
        sessions.add(session);
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    39
        return session;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    40
    }
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    41
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    42
    /**
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    43
     * Returns an array of Session object.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    44
     * @returns an array of Session object
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    45
     */
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    46
    public Session[] getSessions() {
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    47
        Session[] result = new Session[sessions.size()];
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    48
        sessions.copyInto(result);
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    49
        return result; 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    50
    }
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    51
}
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    52