1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ============LICENSE_END=========================================================
19 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 *******************************************************************************/
22 package org.onap.dmaap.mr.client;
24 import java.io.IOException;
26 import com.att.nsa.apiClient.credentials.ApiCredential;
27 import com.att.nsa.apiClient.http.HttpException;
28 import com.att.nsa.apiClient.http.HttpObjectNotFoundException;
31 * A client for manipulating API keys.
35 public interface MRIdentityManager extends MRClient
40 public interface ApiKey
43 * Get the email address associated with the API key
44 * @return the email address on the API key or null
49 * Get the description associated with the API key
50 * @return the description on the API key or null
52 String getDescription ();
56 * Create a new API key on the UEB cluster. The returned credential instance
57 * contains the new API key and API secret. This is the only time the secret
58 * is available to the client -- there's no API for retrieving it later -- so
59 * your application must store it securely.
63 * @return a new credential
64 * @throws HttpException
65 * @throws MRApiException
68 ApiCredential createApiKey ( String email, String description ) throws HttpException, MRApiException, IOException;
71 * Get basic info about a known API key
73 * @return the API key's info or null if it doesn't exist
74 * @throws HttpObjectNotFoundException, HttpException, MRApiException
77 ApiKey getApiKey ( String apiKey ) throws HttpObjectNotFoundException, HttpException, MRApiException, IOException;
80 * Update the record for the API key used to authenticate this request. The UEB
81 * API requires that you authenticate with the same key you're updating, so the
82 * API key being changed is the one used for setApiCredentials.
84 * @param email use null to keep the current value
85 * @param description use null to keep the current value
87 * @throws HttpException
88 * @throws HttpObjectNotFoundException
90 void updateCurrentApiKey ( String email, String description ) throws HttpObjectNotFoundException, HttpException, IOException;
93 * Delete the *current* API key. After this call returns, the API key
94 * used to authenticate will no longer be valid.
97 * @throws HttpException
99 void deleteCurrentApiKey () throws HttpException, IOException;