blob: 21d837e0505bd20787e981a2d4e0b4ba3bd7f4ac [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>UDDIErrorHelper.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">jUDDI Core Services</a> &gt; <a href="index.source.html" class="el_package">org.apache.juddi.v3.error</a> &gt; <span class="el_source">UDDIErrorHelper.java</span></div><h1>UDDIErrorHelper.java</h1><pre class="source lang-java linenums">/*
* Copyright 2001-2008 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
* 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 &quot;AS IS&quot; 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 org.apache.juddi.v3.error;
import org.apache.juddi.config.ResourceConfig;
import org.uddi.api_v3.DispositionReport;
import org.uddi.api_v3.Result;
import org.uddi.api_v3.ErrInfo;
/**
* @author &lt;a href=&quot;mailto:jfaath@apache.org&quot;&gt;Jeff Faath&lt;/a&gt;
*/
<span class="nc" id="L28">public class UDDIErrorHelper {</span>
/**
* E_assertionNotFound: (30000) Signifies that a particular publisher assertion cannot be identified in a save or delete operation.
*/
public static final int E_ASSERTION_NOT_FOUND = 30000;
/**
* E_authTokenExpired: (10110) Signifies that the authentication token information has timed out.
*/
public static final int E_AUTH_TOKEN_EXPIRED = 10110;
/**
* E_authTokenRequired: (10120) Signifies that an authentication token is missing or is invalid for an API call that requires authentication.
*/
public static final int E_AUTH_TOKEN_REQUIRED = 10120;
/**
* E_accountLimitExceeded: (10160) Signifies that a save request exceeded the quantity limits for a given data type. Account limits are established based on the relationship between an individual publisher and an individual node. See your UDDI node’s policy for account limits for details. Other nodes in the registry MAY NOT place additional restrictions on publishing limits established by a custodial node.
*/
public static final int E_ACCOUNT_LIMIT_EXCEEDED = 10160;
/**
* E_busy: (10400) Signifies that the request cannot be processed at the current time.
*/
public static final int E_BUSY = 10400;
/**
* NON UDDIv3 spec error
*/
public static final int E_CATEGORIZATION_NOT_ALLOWED = 20100;
/**
* E_fatalError: (10500) Signifies that a serious technical error has occurred while processing the request.
*/
public static final int E_FATAL_ERROR = 10500;
/**
* E_invalidKeyPassed: (10210) Signifies that the uddiKey value passed did not match with any known key values. The details on the invalid key SHOULD be included in the dispositionReport element.
*/
public static final int E_INVALID_KEY_PASSED = 10210;
/**
* E_invalidProjection: (20230) Signifies that an attempt was made to save a businessEntity containing a service projection where the serviceKey does not belong to the business designated by the businessKey. The serviceKey of at least one such businessService SHOULD be included in the dispositionReport.
*/
public static final int E_INVALID_PROJECTION = 20230;
/**
* NON UDDIv3 spec
*/
public static final int E_INVALID_CATEGORY = 20000;
/**
* E_invalidCompletionStatus: (30100) Signifies that one of the assertion status values passed is unrecognized. The completion status that caused the problem SHOULD be clearly indicated in the error text.
*/
public static final int E_INVALID_COMPLETION_STATUS = 30100;
public static final int E_INVALID_URL_PASSED = 10220;
/**
* E_invalidValue: (20200) This error code has multiple uses. This error code applies to the subscription APIs and the value set APIs. It can be used to indicate that a value that was passed in a keyValue attribute did not pass validation. This applies to checked value sets that are referenced using keyedReferences. The error text SHOULD clearly indicate the key and value combination that failed validation. It can also be used to indicate that a chunkToken supplied is invalid. This applies in both subscription and value set APIs. The error text SHOULD clearly indicate the reason for failure.
*/
public static final int E_INVALID_VALUE = 20200;
/**
* E_invalidCombination: (40500) Signifies conflicting find qualifiers have been specified. The find qualifiers that caused the problem SHOULD be clearly indicated in the error text.
*/
public static final int E_INVALID_COMBINATION = 40500;
public static final int E_KEY_RETIRED = 10310;
/**
* E_keyUnavailable: (40100) Signifies that the proposed key is in a partition that has already been assigned to some other publisher.
*/
public static final int E_KEY_UNAVAILABLE = 40100;
public static final int E_LANGUAGE_ERROR = 10060;
/**
* E_messageTooLarge: (30110) Signifies that the message is too large. The upper limit SHOULD be clearly indicated in the error text.
*/
public static final int E_MESSAGE_TOO_LARGE = 30110;
public static final int E_NAME_TOO_LONG = 10020;
public static final int E_OPERATOR_MISMATCH = 10130;
public static final int E_PUBLISHER_CANCELLED = 30220;
/**
* Signifies that a subscription cannot be renewed. The request has been denied due to either node or registry policy.
*/
public static final int E_REQUEST_DENIED = 30210;
public static final int E_SECRET_UNKNOWN = 30230;
public static final int E_SUCCESS = 0;
public static final int E_TOO_MANY_OPTIONS = 10030;
public static final int E_TRANSFER_ABORTED = 30200;
/**
* E_unrecognizedVersion: (10040) Signifies that the value of the namespace attribute is unsupported by the node being queried.
*/
public static final int E_UNRECOGNIZED_VERSION = 10040;
/**
* E_unknownUser: (10150) Signifies that the user ID and password pair passed in a get_authToken API is not known to the UDDI node or is not valid.
*/
public static final int E_UNKNOWN_USER = 10150;
/**
* E_unsupported: (10050) Signifies that the implementer does not support a feature or API.
*/
public static final int E_UNSUPPORTED = 10050;
/**
* E_userMismatch: (10140) Signifies that an attempt was made to use the publishing API to change data that is controlled by another party.
*/
public static final int E_USER_MISMATCH = 10140;
/**
* E_valueNotAllowed: (20210) Signifies that a value did not pass validation because of contextual issues. The value may be valid in some contexts, but not in the context used. The error text MAY contain information about the contextual problem.
*/
public static final int E_VALUE_NOT_ALLOWED = 20210;
/**
* E_unvalidatable: (20220) Signifies that an attempt was made to reference a value set in a keyedReference whose tModel is categorized with the unvalidatable categorization.
*/
public static final int E_UNVALIDATABLE = 20220;
public static final int E_REQUEST_TIMEOUT = 20240;
/**
* E_invalidTime: (40030) Signifies that the time period, the date/time, or the pair of date/time is invalid. The error structure signifies the condition that occurred and the error text clearly calls out the cause of the problem.
*/
public static final int E_INVALID_TIME = 40030;
/**
* E_resultSetTooLarge: (40300) Signifies that the UDDI node deems that a result set from an inquiry is too large, and requests to obtain the results are not honored, even using subsets. The inquiry that triggered this error should be refined and re-issued.
*/
public static final int E_RESULT_SET_TOO_LARGE = 40300;
/**
* E_tokenAlreadyExists: (40070) Signifies that one or more of the businessKey or tModelKey elements that identify entities to be transferred are not owned by the publisher identified by the authInfo element. The error text SHOULD clearly indicate which entity keys caused the error.
*/
public static final int E_TOKEN_ALREADY_EXISTS = 40070;
/**
* E_transferNotAllowed: (40600) Signifies that the transfer of one or more entities has been by either the custodial node or the target node because the transfer token has expired or an attempt was made to transfer an unauthorized entity.
*/
public static final int E_TRANSFER_NOT_ALLOWED = 40600;
public static final String lookupErrCode(int errno) {
<span class="pc bpc" id="L147" title="31 of 38 branches missed."> switch (errno) {</span>
<span class="nc" id="L148"> case E_ACCOUNT_LIMIT_EXCEEDED : return DispositionReport.E_ACCOUNT_LIMIT_EXCEEDED;</span>
<span class="nc" id="L149"> case E_ASSERTION_NOT_FOUND : return DispositionReport.E_ASSERTION_NOT_FOUND; </span>
<span class="nc" id="L150"> case E_AUTH_TOKEN_EXPIRED : return DispositionReport.E_AUTH_TOKEN_EXPIRED;</span>
<span class="fc" id="L151"> case E_AUTH_TOKEN_REQUIRED : return DispositionReport.E_AUTH_TOKEN_REQUIRED;</span>
<span class="nc" id="L152"> case E_BUSY : return DispositionReport.E_BUSY;</span>
<span class="nc" id="L153"> case E_CATEGORIZATION_NOT_ALLOWED : return DispositionReport.E_CATEGORIZATION_NOT_ALLOWED;</span>
<span class="fc" id="L154"> case E_FATAL_ERROR : return DispositionReport.E_FATAL_ERROR;</span>
<span class="nc" id="L155"> case E_INVALID_COMBINATION : return DispositionReport.E_INVALID_COMBINATION;</span>
<span class="nc" id="L156"> case E_INVALID_CATEGORY : return DispositionReport.E_INVALID_CATEGORY;</span>
<span class="nc" id="L157"> case E_INVALID_COMPLETION_STATUS : return DispositionReport.E_INVALID_COMPLETION_STATUS;</span>
<span class="fc" id="L158"> case E_INVALID_KEY_PASSED : return DispositionReport.E_INVALID_KEY_PASSED;</span>
<span class="nc" id="L159"> case E_KEY_UNAVAILABLE : return DispositionReport.E_KEY_UNAVAILABLE;</span>
<span class="nc" id="L160"> case E_INVALID_PROJECTION : return DispositionReport.E_INVALID_PROJECTION;</span>
<span class="nc" id="L161"> case E_INVALID_TIME : return DispositionReport.E_INVALID_TIME;</span>
<span class="nc" id="L162"> case E_INVALID_URL_PASSED : return DispositionReport.E_INVALID_URL_PASSED;</span>
<span class="fc" id="L163"> case E_INVALID_VALUE : return DispositionReport.E_INVALID_VALUE;</span>
<span class="nc" id="L164"> case E_KEY_RETIRED : return DispositionReport.E_KEY_RETIRED;</span>
<span class="nc" id="L165"> case E_LANGUAGE_ERROR : return DispositionReport.E_LANGUAGE_ERROR;</span>
<span class="nc" id="L166"> case E_MESSAGE_TOO_LARGE : return DispositionReport.E_MESSAGE_TOO_LARGE;</span>
<span class="nc" id="L167"> case E_NAME_TOO_LONG : return DispositionReport.E_NAME_TOO_LONG;</span>
<span class="nc" id="L168"> case E_OPERATOR_MISMATCH : return DispositionReport.E_OPERATOR_MISMATCH;</span>
<span class="nc" id="L169"> case E_PUBLISHER_CANCELLED : return DispositionReport.E_PUBLISHER_CANCELLED;</span>
<span class="nc" id="L170"> case E_REQUEST_DENIED : return DispositionReport.E_REQUEST_DENIED;</span>
<span class="nc" id="L171"> case E_REQUEST_TIMEOUT : return DispositionReport.E_REQUEST_TIMEOUT;</span>
<span class="nc" id="L172"> case E_RESULT_SET_TOO_LARGE : return DispositionReport.E_RESULT_SET_TOO_LARGE;</span>
<span class="nc" id="L173"> case E_SECRET_UNKNOWN : return DispositionReport.E_SECRET_UNKNOWN;</span>
<span class="nc" id="L174"> case E_SUCCESS : return DispositionReport.E_SUCCESS;</span>
<span class="nc" id="L175"> case E_TOO_MANY_OPTIONS : return DispositionReport.E_TOO_MANY_OPTIONS;</span>
<span class="nc" id="L176"> case E_TRANSFER_ABORTED : return DispositionReport.E_TRANSFER_ABORTED;</span>
<span class="fc" id="L177"> case E_UNKNOWN_USER : return DispositionReport.E_UNKNOWN_USER;</span>
<span class="nc" id="L178"> case E_UNRECOGNIZED_VERSION : return DispositionReport.E_UNRECOGNIZED_VERSION;</span>
<span class="nc" id="L179"> case E_UNSUPPORTED : return DispositionReport.E_UNSUPPORTED;</span>
<span class="nc" id="L180"> case E_UNVALIDATABLE : return DispositionReport.E_UNVALIDATABLE;</span>
<span class="fc" id="L181"> case E_USER_MISMATCH : return DispositionReport.E_USER_MISMATCH;</span>
<span class="fc" id="L182"> case E_VALUE_NOT_ALLOWED : return DispositionReport.E_VALUE_NOT_ALLOWED;</span>
<span class="nc" id="L183"> case E_TOKEN_ALREADY_EXISTS : return DispositionReport.E_TOKEN_ALREADY_EXISTS;</span>
<span class="nc" id="L184"> case E_TRANSFER_NOT_ALLOWED : return DispositionReport.E_TRANSFER_NOT_ALLOWED;</span>
<span class="nc" id="L185"> default : return null;</span>
}
}
public static final String lookupErrText(int errno) {
<span class="fc" id="L190"> String errCode = lookupErrCode(errno);</span>
<span class="pc bpc" id="L191" title="1 of 2 branches missed."> if (errCode == null)</span>
<span class="nc" id="L192"> return null;</span>
<span class="fc" id="L193"> return ResourceConfig.getGlobalMessage(errCode);</span>
}
public static final DispositionReport buildDispositionReport(int errNo) {
<span class="fc" id="L197"> DispositionReport dr = new DispositionReport();</span>
<span class="fc" id="L198"> Result res = new Result();</span>
<span class="fc" id="L199"> res.setErrno(errNo);</span>
<span class="fc" id="L201"> ErrInfo ei = new ErrInfo();</span>
<span class="fc" id="L202"> ei.setErrCode(lookupErrCode(errNo));</span>
<span class="fc" id="L203"> ei.setValue(lookupErrText(errNo));</span>
<span class="fc" id="L205"> res.setErrInfo(ei);</span>
<span class="fc" id="L207"> dr.getResult().add(res);</span>
<span class="fc" id="L209"> return dr;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html>