//------------------------------------------------------------------------------
// <copyright file="SessionAttachInfo.java" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
// <summary>
//      The structure as the parameter to attach a session.
// </summary>
//------------------------------------------------------------------------------

package com.microsoft.hpc.scheduler.session;

import com.microsoft.hpc.exceptions.ArgumentException;
import com.microsoft.hpc.exceptions.ArgumentNullException;
import com.microsoft.hpc.exceptions.SR;

/**
 * The structure as the parameter to attach a session
 * 
 */
public class SessionAttachInfo
{
    /**
     * headnode name
     */
    private String headnode;
    
    /**
     * session id
     */
    private int id;
    
    /**
     * Username needed for SetHttps
     */
    private String username = HpcJava.user;
    
    /**
     * Password needed for SetHttps
     */
    private String password = HpcJava.pass;
    
    /**
     * Initializes a new instance of the SessionAttachInfo class
     * @param headNode the headnode name
     * @param id the session Id
     */
    public SessionAttachInfo(String headNode, int id)
    {
        if (headNode == null || headNode == "")
        {
            throw new ArgumentException(SR.HeadnodeCantBeNull);
        }
        this.headnode = headNode;
        this.id = id;
    }
    
    /**
     * Initializes a new instance of the SessionAttachInfo class
     * @param headNode the headnode name
     * @param id the session Id
     * @param username your username
     * @param password your password
     */
    public SessionAttachInfo(String headNode, int id, String username, String password)
    {
        if (headNode == null || headNode == "")
        {
            throw new ArgumentNullException("headNode");
        }
        this.headnode = headNode;
        this.id = id;
        this.username = username;
        this.password = password;
    }
    
    /**
     * Gets the headnode name
     * @return headnode
     */
    public String getHeadnode()
    {
        return headnode;
    }
    
    /**
     * Gets the session id
     * @return session id
     */
    public int getId()
    {
        return id;
    }
    
    /**
     * Gets the username
     */
    public String getUsername()
    {
        return this.username;
    }
    
    /**
     * Gets the password
     */
    public String getPassword()
    {
        return this.password;
    }
    
    /**
     * Sets the username
     */
    public void setUsername(String username)
    {
        this.username = username;
    }
    
    /**
     * Sets the password
     */
    public void setPassword(String password)
    {
        this.password = password;
    }
    
    
}
