Project

General

Profile

« Previous | Next » 

Revision 1798

Added by Jing Tao over 20 years ago

Implement logout method.

View differences:

src/edu/ucsb/nceas/metacat/client/MetacatClient.java
90 90
    }
91 91

  
92 92
    /**
93
     *  Method used to log out a metacat server. When Metacat server will end
94
     *  the session when this call is invoken.
95
     *
96
     *  @throws MetacatInaccessibleException when the metacat server can not be
97
     *                                    reached or does not respond
98
     */
99
    public void logout() throws MetacatInaccessibleException, MetacatException
100
    {
101
        Properties prop = new Properties();
102
        prop.put("action", "logout");
103
        prop.put("qformat", "xml"); 
104
       
105
        String response = null;
106
        try {
107
            response = sendDataForString(prop);
108
        } catch (Exception e) {
109
            throw new MetacatInaccessibleException(e.getMessage());
110
        }
111
        
112
        if (response.indexOf("<logout>") == -1) {
113
            throw new MetacatException(response);
114
        }
115
    }
116
    
117
    
118
    /**
93 119
     * Read an XML document from the metacat server session, accessed by docid,
94 120
     * and returned as a Reader.
95 121
     *

Also available in: Unified diff