Add Generic ExpiredLicenseException

closes elastic/elasticsearch#5

Original commit: elastic/x-pack-elasticsearch@712e40214a
This commit is contained in:
Areek Zillur 2014-11-12 18:25:50 -05:00
parent 039cf21180
commit b606be83f2
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.license.plugin.core;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.rest.RestStatus;
/**
* Exception to be thrown when a feature action requires a valid license
*/
public class ExpiredLicenseException extends ElasticsearchException {
public ExpiredLicenseException(String feature) {
super(feature + " license has expired");
}
@Override
public RestStatus status() {
return RestStatus.UNAUTHORIZED;
}
}