Android Open Source - SanDisk-HQME-SDK Hqme Error






From Project

Back to project page SanDisk-HQME-SDK.

License

The source code is released under:

Apache License

If you think the Android project SanDisk-HQME-SDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/** 
* This reference code is an implementation of the IEEE P2200 standard.  It is not
* a contribution to the IEEE P2200 standard.
* /*from w ww. ja  va 2 s. c o m*/
* Copyright (c) 2011 SanDisk Corporation.  All rights reserved.
* 
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use
* this file except in compliance with the License.  You may obtain a copy of the
* License at
* 
*        http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied.
* 
* See the License for the specific language governing permissions and limitations
* under the License.
*/

package com.hqme.cm;

import java.util.HashMap;
import java.util.Map;

public enum HqmeError
{  
    // Error codes
    STATUS_SUCCESS          (1,   "Succcess"),
    ERR_INVALID_ARGUMENT        (-1, "One or more arguments passed as parameters of method were invalid.  As an example, null is passed where an object is expected, or a value passed as a parameter exceeds the expected range of values."),
    ERR_NOT_FOUND                (-2, "An object, object within a database, or other construct which is to be operated on by the invoked method could not be found."),
    ERR_TIMEOUT                 (-3, "The expected duration of an invoked method has been exceeded."),
    ERR_PENDING_OPERATION       (-4, "The invoked method could not be executed due to a previously pending operation.  This may occur when a shared resource requires access which is taken by another pending operation."),
    ERR_IO                      (-5, "A method which depends on an Input/Ouput device has encountered an error.  As an example, a hardware failure would result in this error being returned."),
    ERR_NOT_SUPPORTED           (-6, "The method, or operation, feature, or function is not supported by this implementation."),
    ERR_PERMISSION_DENIED       (-7, "The caller which invoked the method does not have the appropriate permissions to execute the method."),
    ERR_VSD_UNAVAILABLE           (-8, "The invoked method could not access the VSD required to complete the method successfully."),

    ERR_INVALID_REQUEST_ID       (-9, "The requestId passed as an argument could not be found in the request queue."),
    ERR_CANCEL_FAILED            (-10, "The QueueRequest could not be canceled.  As an example, the application may try to cancel a request that completes before the cancellation is executed."),
    ERR_SUSPEND_FAILED            (-11, "The QueueRequest could not be suspended.  As an example, the application may try to suspend a request that completes before the cancellation is executed."),
    ERR_RESUME_FAILED            (-12, "The QueueRequest could not be resumed.  As an example, the application may try to resume a request that has an erroneous property or other setting which prohibits the request from resuming."),

    ERR_INVALID_POLICY           (-13, "This error is encountered when one or more rules comprising the Policy was not recognized or a property value could not be parsed properly."),
    ERR_INVALID_PROPERTY         (-14, "This error is encountered when a property key is not recognized or property value could not be parsed properly."),
    ERR_GENERAL                 (-15, "An unidentified error occurred when attempting to execute the method.  This could be a database error, out of memory condition, or other general system failure."),
    
    ERR_UNKNOWN                     (-1234567890, "This error code is undefined.");

    private static final Map<Integer, HqmeError> codeMap = new HashMap<Integer, HqmeError>();
    static {
        for (HqmeError type : HqmeError.values()) {
            codeMap.put(type.code, type);
        }
    }

    public static HqmeError fromInt(int i) {
        HqmeError type = codeMap.get(Integer.valueOf(i));
        if (type == null)
            return HqmeError.ERR_UNKNOWN;
        return type;
    }

    private final int code; 
    private final String description; 

    private HqmeError(int code, String description) { 
        this.code = code; 
        this.description = description; 
    } 
 
    public String getDescription() { 
        return description; 
    } 
 
    public int getCode() { 
        return code; 
    } 
}




Java Source Code List

com.hqme.cm.Account.java
com.hqme.cm.EventsNotify.java
com.hqme.cm.HqmeError.java
com.hqme.cm.OriginACL.java
com.hqme.cm.Permission.java
com.hqme.cm.Property.java
com.hqme.cm.QueueRequestState.java
com.hqme.cm.ReqEvents.java
com.hqme.cm.VSDEvent.java
com.hqme.cm.VSDFunctionGroups.java
com.hqme.cm.VSDProperties.java
com.hqme.cm.cache.PlaybackTokens.java
com.hqme.cm.cache.StreamingServer.java
com.hqme.cm.cache.UntenCacheService.java
com.hqme.cm.cache.UntenMedia.java
com.hqme.cm.core.CmApplication.java
com.hqme.cm.core.DeviceDescription.java
com.hqme.cm.core.HQMEProvider.java
com.hqme.cm.core.HQME.java
com.hqme.cm.core.Package.java
com.hqme.cm.core.Policy.java
com.hqme.cm.core.ProtocolException.java
com.hqme.cm.core.ProtocolHandlerInputStream.java
com.hqme.cm.core.ProtocolHandler.java
com.hqme.cm.core.ProtocolManager.java
com.hqme.cm.core.ProtocolPluginHttp.java
com.hqme.cm.core.ProtocolPlugin.java
com.hqme.cm.core.QueueRequestObject.java
com.hqme.cm.core.QueueRequestProperties.java
com.hqme.cm.core.RULE_AVAILABLE_SPACE.java
com.hqme.cm.core.RULE_BANDWIDTH_LIMIT.java
com.hqme.cm.core.RULE_CHARGING_STATE.java
com.hqme.cm.core.RULE_CONNECTION_TYPE.java
com.hqme.cm.core.RULE_DOWNLOAD_LIMIT.java
com.hqme.cm.core.RULE_EXPIRE.java
com.hqme.cm.core.RULE_FREE_SPACE.java
com.hqme.cm.core.RULE_FUNCTIONGROUPS.java
com.hqme.cm.core.RULE_MANDATORY_TIME.java
com.hqme.cm.core.RULE_MAX_SIZE.java
com.hqme.cm.core.RULE_POWER_LEVEL.java
com.hqme.cm.core.RULE_PRIORITY.java
com.hqme.cm.core.RULE_ROAMING.java
com.hqme.cm.core.RULE_SCHEDULE.java
com.hqme.cm.core.RULE_TIME.java
com.hqme.cm.core.Record.java
com.hqme.cm.core.RuleBase.java
com.hqme.cm.core.RuleCollection.java
com.hqme.cm.core.Rule.java
com.hqme.cm.core.StorageManager.java
com.hqme.cm.core.WorkOrderManager.java
com.hqme.cm.core.WorkOrder.java
com.hqme.cm.core.policyParser.Expression.java
com.hqme.cm.core.policyParser.HqmePolicyException.java
com.hqme.cm.core.policyParser.LogicalExpression.java
com.hqme.cm.core.policyParser.NegateExpression.java
com.hqme.cm.core.policyParser.Operator.java
com.hqme.cm.core.policyParser.PolicyElementParser.java
com.hqme.cm.core.policyParser.PolicyExpression.java
com.hqme.cm.core.policyParser.Precedence.java
com.hqme.cm.core.policyParser.Token.java
com.hqme.cm.core.policyParser.Tokenizer.java
com.hqme.cm.sample.HqmeClientActivity.java
com.hqme.cm.sample.HqmeClientReceiver.java
com.hqme.cm.util.CmClientUtil.java
com.hqme.cm.util.CmDate.java
com.hqme.cm.util.CmNumber.java
com.hqme.cm.util.CmProperties.java
com.hqme.cm.util.CmUri.java