001 /*             
002 * ===========================================================================================
003 * = COPYRIGHT                    
004 *          PAX Computer Technology(Shenzhen) CO., LTD PROPRIETARY INFORMATION          
005 *   This software is supplied under the terms of a license agreement or nondisclosure  
006 *   agreement with PAX Computer Technology(Shenzhen) CO., LTD and may not be copied or 
007 *   disclosed except in accordance with the terms in that agreement.                   
008 *     Copyright (C) 2017-? PAX Computer Technology(Shenzhen) CO., LTD All rights reserved.
009 * Description: // Detail description about the function of this module,                
010 *             // interfaces with the other modules, and dependencies.          
011 * Revision History:            
012 * Date                  Author                 Action
013 * 2017-09-05            uni.w                                  Create
014 * ===========================================================================================
015 */
016 
017package com.pax.dal.pedkeyisolation;
018
019@Deprecated
020public interface ISlotAllocator {
021
022    /**
023     * <div class="zh"> 查找逻辑ID对应的物理ID, 如果此逻辑ID已分配,则直接返回, 如果未分配, 则返回错误。 </div>
024     * 
025     * <pre>
026     * <div class="en"> Find the physical ID that corresponding to the logical ID, and if this logical ID has been assigned, it returns directly and returns error
027     * if not assigned. </div>
028     * 
029     * @param logicalId
030     * @return <div class="zh"><0:失败 >0:已分配的物理ID</div> <div class="en"> <0:failed >0:the physical ID allocated </div>
031     * 
032     */
033    int find(int logicalId);
034
035    /**
036     * <div class="zh">预分配新的物理ID。</div>
037     * 
038     * <pre>
039     * <div class="en"> preallocate a new physical ID . </div>
040     * 
041     * @return <div class="zh"><0:失败 >0:预分配的物理ID</div> <div class="en"> <0:failed >0:the physical ID allocated </div>
042     */
043    int preallocate();
044
045    /**
046     * <div class="zh">分配物理ID。</div>
047     * 
048     * <pre>
049     * <div class="en"> allocate physical ID . </div>
050     * 
051     * @param logicalId
052     * @param physicalId
053     * @return <div class="zh"><0:失败 =0:成功</div> <div class="en"> <0:failed =0:success </div>
054     */
055    int setAllocated(int logicalId, int physicalId);
056
057    /**
058     * <div class="zh">释放物理ID, 如果logicalId 为0, 则释放此应用占用的所有物理ID, 如果logicalId > 0, 则释放指定的物理ID。</div>
059     * 
060     * <pre>
061     * <div class="en"> Release physical ID, and if logicalId is 0, then release all physical ID that this application occupies, and release the specified physical ID if logicalId > 0. </div>
062     * @param logicalId
063     * @return  <div class="zh"><0:失败 =0:成功</div> <div class="en"> <0:failed =0:success </div>
064     */
065    int deallocate(int logicalId);
066
067    /**
068     * <div class="zh">释放本机所有的物理ID</div>
069     * 
070     * <pre>
071     * <div class="en"> deallocate all physical ID . </div>
072     * 
073     * @return <div class="zh"><0:失败 =0:成功</div> <div class="en"> <0:failed =0:success </div>
074     */
075    int deallocateAll();
076
077    /**
078     * <div class="zh">修改密钥所有者。</div> <div class="en">Change the key owner.</div>
079     * 
080     * @param logicalId <div class="zh">逻辑索引。</div> <div class="en">The logical index.</div>
081     * 
082     * @param packageName <div class="zh">应用包名。</div> <div class="en">The package name.</div>
083     * 
084     * @return <div class="zh">结果吗。</div> <div class="en">The result code.</div>
085     */
086    int changeKeyOwner(int logicalId, String packageName);
087}