001/* 002 * Copyright 2016 The AppAuth for Android Authors. All Rights Reserved. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 005 * in compliance with the License. You may obtain a copy of the License at 006 * 007 * http://www.apache.org/licenses/LICENSE-2.0 008 * 009 * Unless required by applicable law or agreed to in writing, software distributed under the 010 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 011 * express or implied. See the License for the specific language governing permissions and 012 * limitations under the License. 013 */ 014 015package net.openid.appauth; 016 017import android.net.Uri; 018 019import org.json.JSONObject; 020 021/** 022 * A base request for session management models 023 * {@link AuthorizationRequest} 024 * {@link EndSessionRequest} 025 */ 026public interface AuthorizationManagementRequest { 027 028 /** 029 * Produces a JSON representation of the request for persistent storage or local transmission 030 * (e.g. between activities). 031 */ 032 JSONObject jsonSerialize(); 033 034 /** 035 * Produces a JSON string representation of the request for persistent storage or 036 * local transmission (e.g. between activities). This method is just a convenience wrapper 037 * for {@link #jsonSerialize()}, converting the JSON object to its string form. 038 */ 039 String jsonSerializeString(); 040 041 /** 042 * An opaque value used by the client to maintain state between the request and callback. 043 */ 044 String getState(); 045 046 /** 047 * Produces a request URI, that can be used to dispatch the request. 048 */ 049 Uri toUri(); 050}