Project

General

Profile

Revision 5764

Added by berkley over 9 years ago

new class

View differences:

src/edu/ucsb/nceas/metacat/dataone/HealthService.java
1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2000 Regents of the University of California and the
4
 *              National Center for Ecological Analysis and Synthesis
5
 *
6
 *   '$Author: $'
7
 *     '$Date: 2009-06-13 15:28:13 +0300  $'
8
 *
9
 * This program is free software; you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation; either version 2 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
 */
23

  
24
package edu.ucsb.nceas.metacat.dataone;
25

  
26
import java.io.IOException;
27

  
28
import javax.servlet.http.HttpServletRequest;
29
import javax.servlet.http.HttpServletResponse;
30

  
31
import org.dataone.service.mn.MemberNodeHealth;
32
import org.omg.CORBA.portable.OutputStream;
33

  
34
/**
35
 * @author berkley
36
 *
37
 */
38
public class HealthService implements MemberNodeHealth
39
{    
40
    HttpServletRequest request;
41
    HttpServletResponse response;
42
    
43
    public HealthService(HttpServletRequest request, HttpServletResponse response)
44
    {
45
        this.request = request;
46
        this.response = response;
47
    }
48
    
49
    public void ping()
50
    {
51
        response.setStatus(200);
52
        try
53
        {
54
            response.getOutputStream().write("OK".getBytes());
55
        }
56
        catch (IOException e)
57
        {
58
            System.out.println("ERROR getting ping response: " + e.getMessage());
59
            e.printStackTrace();
60
            response.setStatus(500);
61
        }
62
    }
63
    
64
    public void getObjectStatistics()
65
    {
66
        
67
    }
68
    
69
    public void getOperationStatistics()
70
    {
71
        
72
    }
73
    
74
    public void getStatus()
75
    {
76
        
77
    }
78
}

Also available in: Unified diff