• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VangavException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vangav.backend.exceptions.VangavException的典型用法代码示例。如果您正苦于以下问题:Java VangavException类的具体用法?Java VangavException怎么用?Java VangavException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VangavException类属于com.vangav.backend.exceptions包,在下文中一共展示了VangavException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: CycleLog

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * Constructor - CycleLog
 * @param plannedStartTime
 * @param actualStartTime
 * @param plannedEndTime
 * @return new CycleLog Object
 */
protected CycleLog (
  long plannedStartTime,
  long actualStartTime,
  long plannedEndTime) {
  
  this.plannedStartTime = plannedStartTime;
  this.actualStartTime = actualStartTime;
  this.plannedEndTime = plannedEndTime;
  this.actualEndTime = this.actualStartTime;
  
  this.nonFatalVangavExceptions = new ArrayList<VangavException>();
  this.nonFatalExceptions = new ArrayList<Exception>();
  
  this.finished = false;
  this.succeeded = false;
  this.failureException = null;
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:25,代码来源:CycleLog.java


示例2: checkInstanceOf

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkInstanceOf
 * @param object: the object to be checked
 * @param type: expected class type
 * @param exceptionType: exception type to throw
 *          (bad request or code exception)
 * @throws VangavException
 * */
public static void checkInstanceOf (
  Object object,
  Class<?> type,
  ExceptionType exceptionType) throws Exception {
  
  if (object.getClass().equals(type) == false) {
    
    throw VangavException.exceptionFactory(
      41,
      1,
      "Wrong class type ["
      + object.getClass().getName()
      + "] expecting ["
      + type.getName()
      + "]",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:28,代码来源:ArgumentsInl.java


示例3: checkNotNull

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkNotNull
 * @param name: name of the object to be checked
 * @param object: object to be checked
 * @param exceptionType: exception type to throw
 *          (bad request or code exception)
 * @throws VangavException
 * */
public static void checkNotNull (
  String name,
  Object object,
  ExceptionType exceptionType) throws Exception {
  
  if (object == null) {
    
    throw VangavException.exceptionFactory(
      41,
      2,
      name
      + " can't be null",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:25,代码来源:ArgumentsInl.java


示例4: checkNotEmpty

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkNotEmpty
 * @param name
 * @param string
 * @param exceptionType
 * @throws Exception if param string is null or empty
 */
public static void checkNotEmpty (
  String name,
  String string,
  ExceptionType exceptionType) throws Exception {
  
  checkNotNull(name, string, exceptionType);
  
  if (string.length() == 0) {
    
    throw VangavException.exceptionFactory(
      41,
      3,
      name
      + " can't be empty",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:26,代码来源:ArgumentsInl.java


示例5: checkIntWithinRange

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkIntWithinRange
 * @param name: name of the integer to be checked
 * @param value: value of the integer to be checked
 * @param min: minimum valid value
 * @param max: maximum valid value
 * @param exceptionType: exception type to throw
 *          (bad request or code exception)
 * @throws VangavException
 * */
public static void checkIntWithinRange (
  String name,
  int value,
  int min,
  int max,
  ExceptionType exceptionType) throws Exception {
  
  if (value < min || value > max) {
    
    throw VangavException.exceptionFactory(
      41,
      12,
      name
      + " value ["
      + value
      + "] min ["
      + min
      + "] max ["
      + max
      + "] is out of range",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:35,代码来源:ArgumentsInl.java


示例6: checkIntGreaterThanOrEqual

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkIntGreaterThanOrEqual
 * @param name: name of the integer to be checked
 * @param value: value of the integer to be checked
 * @param minLimit: minimum valid value
 * @param exceptionType: exception type to throw
 *          (bad request or code exception)
 * @throws VangavException
 * */
public static void checkIntGreaterThanOrEqual (
  String name,
  int value,
  int minLimit,
  ExceptionType exceptionType) throws Exception {
  
  if (value < minLimit) {
    
    throw VangavException.exceptionFactory(
      41,
      13,
      name
      + " value ["
      + value
      + "] min limit ["
      + minLimit
      + "] is less than the minimum limit",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:31,代码来源:ArgumentsInl.java


示例7: checkLongGreaterThanOrEqual

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkLongGreaterThanOrEqual
 * @param name: name of the long to be checked
 * @param value: value of the long to be checked
 * @param minLimit: minimum valid value
 * @param exceptionType: exception type to throw
 *          (bad request or code exception)
 * @throws VangavException
 * */
public static void checkLongGreaterThanOrEqual (
  String name,
  long value,
  long minLimit,
  ExceptionType exceptionType) throws Exception {
  
  if (value < minLimit) {
    
    throw VangavException.exceptionFactory(
      41,
      14,
      name
      + " value ["
      + value
      + "] min limit ["
      + minLimit
      + "] is less than the minimum limit",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:31,代码来源:ArgumentsInl.java


示例8: checkDoubleHasValue

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkDoubleHasValue
 * throws an exception is param value is NAN or infinite
 * @param name
 * @param value
 * @param exceptionType
 * @throws Exception
 */
public static void checkDoubleHasValue (
  String name,
  double value,
  ExceptionType exceptionType) throws Exception {
  
  if (Double.isNaN(value) || Double.isInfinite(value) ) {
   
    throw VangavException.exceptionFactory(
      41,
      15,
      name
      + " double ["
      + value
      + "] has no value",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:27,代码来源:ArgumentsInl.java


示例9: Request

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * Constructor Request
 * @param request (play framework request)
 * @param requestJsonBody
 * @param responseBody
 * @param controllerName
 * @return new Request Object
 * @throws Exception
 */
public Request (
  play.mvc.Http.Request request,
  RequestJsonBody requestJsonBody,
  ResponseBody responseBody,
  String controllerName) throws Exception {
  
  this.startTime = System.currentTimeMillis();
  this.startCalendar =
    CalendarAndDateOperationsInl.getCalendarFromUnixTime(this.startTime);
  this.endTime = this.startTime;
  this.execTime = 0;
  
  this.requestId = UUID.randomUUID();
  this.header = new RequestHeader(request);
  this.body = requestJsonBody;
  this.response = responseBody;
  this.dispatcher = new Dispatcher();
  
  this.controllerName = controllerName;
  this.userId = this.body.getUserId();
  this.isThrottled = false;
  
  this.state = RequestState.OK;
  this.vangavExceptions = new ArrayList<VangavException>();
  this.exceptions = new ArrayList<Exception>();
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:36,代码来源:Request.java


示例10: checkIpV4

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * checkIpV4
 * throws an exception if param ip isn't a valid IP V4
 * @param name
 * @param ip
 * @param exceptionType
 * @throws Exception
 */
public static void checkIpV4 (
  String name,
  String ip,
  ExceptionType exceptionType) throws Exception {
  
  try {
    
    String [] ipSplit = ip.split("\\.");
    int currValue;
    
    for (int i = 0; i < 4; i ++) {
      
      currValue = Integer.parseInt(ipSplit[i] );
      
      checkIntWithinRange(
        "",
        currValue,
        0,
        255,
        exceptionType);
    }
  } catch (Exception e) {
    
    throw VangavException.exceptionFactory(
      41,
      16,
      name
      + " Invalid IP V4 ["
      + ip
      + "]",
      exceptionType,
      ExceptionClass.ARGUMENT);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:43,代码来源:ArgumentsInl.java


示例11: endCallWithExceptions

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * endCallWithExceptions
 * used instead of endCall in case an exception got thrown during processing
 * invoked at the end of each call from ControllerCall's run method to
 *   complete a controller's call log
 * @param e
 */
protected void endCallWithExceptions (Exception e) {
  
  this.requestToResponseTimeInMilliSeconds =
    (int) (System.currentTimeMillis() - this.startTime);
  
  this.responseHttpStatusCode = -2;
  this.response = ErrorResponse.getDefaultErrorResponse();
  
  this.threwExceptionsDuringCall = true;
  this.thrownException = VangavException.getExceptionStackTrace(e);
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:19,代码来源:ControllerCallLog.java


示例12: getNonFatalVangavExceptions

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * getNonFatalVangavExceptions
 * @return this cycle's non-fatal vangav exceptions
 * @throws Exception
 */
public ArrayList<VangavException> getNonFatalVangavExceptions (
  ) throws Exception {
  
  return this.nonFatalVangavExceptions;
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:11,代码来源:CycleLog.java


示例13: getNonFatalExceptionsAsString

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * getNonFatalExceptionsAsString
 * @return this cycle's non fatal exceptions in string form for the toString
 *           method
 */
private ArrayList<String> getNonFatalExceptionsAsString () {
  
  ArrayList<String> result = new ArrayList<String>();
  
  try {
    
    for (Exception exception : this.nonFatalExceptions) {
      
      if (exception instanceof VangavException) {
        
        result.add(((VangavException)exception).toString() );
      } else {
        
        result.add(VangavException.getExceptionStackTrace(exception) );
      }
    }
  } catch (Exception e) {
    
    result.add("Failed to continue because of an exception");
  }
  
  return result;
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:29,代码来源:CycleLog.java


示例14: getFailureExceptionAsString

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * getFailureExceptionAsString
 * @return this cycle's failure exception in string form for the toString
 *           method
 */
private String getFailureExceptionAsString () {
  
  if (this.failureException == null) {
    
    return "no failure exception";
  }
  
  if (this.failureException instanceof VangavException) {
    
    return ((VangavException)this.failureException).toString();
  } else {
    
    return VangavException.getExceptionStackTrace(this.failureException);
  }
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:21,代码来源:CycleLog.java


示例15: getAllExceptionsAsString

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * getAllExceptionsAsString
 * @return both VangavException and Exception exceptions' stack traces as
 *           as a String
 * @throws Exception
 */
public String getAllExceptionsAsString () throws Exception {
  
  StringBuffer stringBuffer = new StringBuffer();
  
  stringBuffer.append("VANGAV EXCEPTIONS\n\n");
  
  for (VangavException vangavException : this.vangavExceptions) {
    
    stringBuffer.append(vangavException.toString() );
    stringBuffer.append("\n\n");
  }
  
  stringBuffer.append("\n\nEXCEPTIONS\n\n");
  
  for (Exception exception : this.exceptions) {
    
    stringBuffer.append(VangavException.getExceptionStackTrace(exception) );
    stringBuffer.append("\n\n");
  }
  
  return stringBuffer.toString();
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:29,代码来源:Request.java


示例16: getTheLastVangavException

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * getTheLastVangavException
 * @return the last thrown VangavException (i.e.: the fatal exception that
 *           caused this request to fail) and null if vangav exceptions' list
 *           is empty
 * @throws Exception
 */
public VangavException getTheLastVangavException () throws Exception {
  
  if (this.vangavExceptions.isEmpty() == true) {
    
    return null;
  }
  
  return this.vangavExceptions.get(this.vangavExceptions.size() - 1);
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:17,代码来源:Request.java


示例17: addNonFatalVangavException

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * addNonFatalVangavException
 * used to add a VangavException that occurs during processing a cycle but
 *   doesn't cause it to fail
 * @param ve
 * @throws Exception
 */
public void addNonFatalVangavException (
  VangavException ve) throws Exception {
  
  this.nonFatalVangavExceptions.add(ve);
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:13,代码来源:CycleLog.java


示例18: ResponseBodyError

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * Constructor ResponseBodyError
 * @param vangavException
 * @return new ResponseBodyError Object
 * @throws Exception
 */
public ResponseBodyError (VangavException vangavException) throws Exception {
  
  this(vangavException, UUID.fromString(kDefaultErrorTraceId) );
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:11,代码来源:ResponseBodyError.java


示例19: addVangavException

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * addVangavException
 * when exceptions happen they are added to the request object to be used
 *   for response, analysis, logging, etc ...
 * @param vangavException
 */
public void addVangavException (
  VangavException vangavException) throws Exception {
  
  this.vangavExceptions.add(vangavException);
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:12,代码来源:Request.java


示例20: getVangavExceptions

import com.vangav.backend.exceptions.VangavException; //导入依赖的package包/类
/**
 * getVangavExceptions
 * @return arraylist of Vangav Exceptions that occured during the processing
 *           of this request
 */
public ArrayList<VangavException> getVangavExceptions () throws Exception {
  
  return this.vangavExceptions;
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:10,代码来源:Request.java



注:本文中的com.vangav.backend.exceptions.VangavException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PropertyAccessor类代码示例发布时间:2022-05-22
下一篇:
Java Sampler类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap