% 
% Licensed to the Apache Software Foundation (ASF) under one
% or more contributor license agreements.  See the NOTICE file
% distributed with this work for additional information
% regarding copyright ownership.  The ASF licenses this file
% to you under the Apache License, Version 2.0 (the
% "License"); you may not use this file except in compliance
% with the License.  You may obtain a copy of the License at
% 
%   http://www.apache.org/licenses/LICENSE-2.0
% 
% Unless required by applicable law or agreed to in writing,
% software distributed under the License is distributed on an
% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
% KIND, either express or implied.  See the License for the
% specific language governing permissions and limitations
% under the License.
% 
    
    \subsection{\varWebServer~(\varWS)}    
    
    There is one \varWebServer~per \varDUCC~cluster.
        
    The duties of the \varWebServer~are:
    \textit{
      \input{part5/c05-WS.tex}
    }
        
    The \varWebServer~provides complimentary functionality for operation of the
    \varDUCC~system.
    It comprises:   

    \begin{description}
      \item monitor publications and files produced by:
      \begin{itemize}
        \item the \varOR
        \item the \varRM
        \item the \varSM
        \item the \varPM
        \item each \varAgent
      \end{itemize}
      \item provide user and administrator web pages to:
      \begin{itemize}
        \item permit authorized users to submit, cancel and monitor distributed analytics;
        \item login and logout
        \item monitor and control Jobs
        \item monitor and control Services
        \item monitor and control Reservations
        \item monitor and control \varDUCC~Administration
        \item monitor and control \varDUCC~Classes
        \item monitor and control \varDUCC~Daemons
        \item monitor and control \varDUCC~\varNodesMachinesComputers
        \item display help
        \item display manuals
        \item control preferences
        \item perform queries and filter results
      \end{itemize}
    \item provide runtime functionality to:
      \begin{itemize}
      \item automatically cancel \varJobs, \varReservations and \varServices based upon client inactivity;
      \item manage user authentication, sessions, and cookies
      \item provide user customizable views
      \item provide one-click access to deployed JVMs via jConsole
      \end{itemize}
    \end{description}
           
    The \varWebServer~is subdivided into several responsibility areas:

    \begin{itemize}
      \item ws
      \item config
      \item event
      \item jConsole
      \item registry
      \item server
      \item types
      \item utils
      \item root
    \end{itemize} 
    
    \subsubsection{ws}
    
    \begin{itemize}
      \item Boot
      \begin{description}
      \item Initialize cache of Jobs, Reservation and Services from checkpoint and historical data repositories.
      \end{description}
      \item Daemons Data
      \begin{description}
      \item Track DUCC daemons: status, name, boot time, host name, host ip, PID, publication size and max, heartbeat last and max, and JConsole URL.
      \end{description}
      \item Ducc Data
      \begin{description}
      \item Track Jobs, Reservation and Services from \varOrchestrator~publications.
      \end{description}
      \item Machines Data
     \begin{description}
      \item Track machines: status, machine name, machine IP, reserve size, memory size, alied PIDs, DUCC shares total and inuse, heartbeat last
      \end{description}
    \end{itemize} 
    
    \subsubsection{config}
         
    \subsubsection{event}
         
    \subsubsection{jConsole}
    
    JConsoleWrapper provides the facility to one-click on a \varDUCC~\varWebServer page
    and be taken to the JConsole for the corresponding process.
    
    \subsubsection{registry}
    
    Manage user and administrator access to the Services Registry, comprising service and meta data.    
    \subsubsection{server}
    
    \begin{itemize}
      \item As User
      Employ \varSetUid~program to act on behalf of the user as the user, such as for writing
      log files.
      \item Cookies
      \item Handler
      \item Json Format
      \item Classic Format
      \item Web Monitor
      \item Web Properties
      \item Web Server
      \item Web Sessions
      Manage user sessions with the \varWebServer~allowing privileged actions in the
      role of a user or an administrator.
      Provide login and logout facilities.
    \end{itemize} 
         
    \subsubsection{types}
    
    \subsubsection{util}
    
    \subsubsection{root}
