Revision 2683
Added by sgarg over 18 years ago
MetacatClient.java | ||
---|---|---|
102 | 102 |
} |
103 | 103 |
return response; |
104 | 104 |
} |
105 |
|
|
106 |
/** |
|
107 |
* Method used to log in to a metacat server. Implementations will need |
|
108 |
* to cache a cookie value to make the session persistent. Each time a |
|
109 |
* call is made to one of the other methods (e.g., read), the cookie will |
|
110 |
* need to be passed back to the metacat server along with the request. |
|
111 |
* |
|
112 |
* @param username the username of the user, like an LDAP DN |
|
113 |
* @param password the password for that user for authentication |
|
114 |
* @return the response string from metacat in XML format |
|
115 |
* @throws MetacatAuthException when the username/password could |
|
116 |
* not be authenticated |
|
117 |
*/ |
|
118 |
public String getloggedinuserinfo() throws MetacatInaccessibleException |
|
119 |
{ |
|
120 |
Properties prop = new Properties(); |
|
121 |
prop.put("action", "getloggedinuserinfo"); |
|
122 |
prop.put("qformat", "xml"); |
|
105 | 123 |
|
124 |
String response = null; |
|
125 |
try { |
|
126 |
response = sendDataForString(prop, null, null, 0); |
|
127 |
} catch (Exception e) { |
|
128 |
throw new MetacatInaccessibleException(e.getMessage()); |
|
129 |
} |
|
130 |
|
|
131 |
return response; |
|
132 |
} |
|
133 |
|
|
106 | 134 |
/** |
107 | 135 |
* Method used to log out a metacat server. The Metacat server will end |
108 | 136 |
* the session when this call is invoked. |
Also available in: Unified diff
Added support in the metacat client for the new function added to MetaCatServlet