[OLINGO-659] Minor API/JavaDoc enhancements

This commit is contained in:
Michael Bolz 2015-08-21 12:48:40 +02:00
parent f2ca7119e1
commit dbf649e0b1
96 changed files with 434 additions and 344 deletions

View File

@ -31,7 +31,7 @@ import org.apache.olingo.client.api.EdmEnabledODataClient;
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
import org.apache.olingo.client.core.ODataClientFactory;
import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.commons.api.format.ContentType;

View File

@ -19,7 +19,7 @@
package org.apache.olingo.ext.proxy.api;
import java.util.List;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
public class ODataFlushException extends ODataRuntimeException {

View File

@ -19,7 +19,7 @@
package org.apache.olingo.ext.proxy.api;
import org.apache.olingo.client.api.communication.request.ODataRequest;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
public class ODataResponseError {

View File

@ -29,7 +29,7 @@ import org.apache.olingo.client.api.communication.request.ODataStreamedRequest;
import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
import org.apache.olingo.client.api.communication.response.ODataResponse;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.ext.proxy.AbstractService;
import org.apache.olingo.ext.proxy.api.ODataFlushException;
import org.apache.olingo.ext.proxy.api.ODataResponseError;

View File

@ -69,7 +69,7 @@ import org.apache.olingo.client.api.domain.ClientValue;
import org.apache.olingo.client.api.edm.xml.Reference;
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
import org.apache.olingo.client.core.ODataClientFactory;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;

View File

@ -50,7 +50,7 @@ import org.apache.olingo.client.api.domain.ClientObjectFactory;
import org.apache.olingo.client.api.http.HttpClientException;
import org.apache.olingo.client.api.uri.URIBuilder;
import org.apache.olingo.client.core.communication.request.batch.ODataChangesetResponseItem;
import org.apache.olingo.commons.api.ODataPreferenceNames;
import org.apache.olingo.commons.api.format.PreferenceName;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.format.ContentType;
@ -317,7 +317,7 @@ public class BatchClientITCase extends AbstractTestITCase {
// Fetch result
final ODataBatchResponse response = payload.getResponse();
assertEquals(HttpStatusCode.ACCEPTED.getStatusCode(), response.getStatusCode());
assertEquals(ODataPreferenceNames.CONTINUE_ON_ERROR.toString(),
assertEquals(PreferenceName.CONTINUE_ON_ERROR.getName(),
response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
final Iterator<ODataBatchResponseItem> bodyIterator = response.getBody();

View File

@ -25,8 +25,8 @@ import java.net.URI;
import java.util.Map;
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
import org.apache.olingo.commons.api.format.ContentType;
import org.junit.Test;

View File

@ -109,7 +109,7 @@ public class MetadataTestITCase extends AbstractTestITCase {
final EdmAnnotation description = core.getAnnotation(descriptionTerm);
assertNotNull(description);
// assertEquals("Core terms needed to write vocabularies",
// description.getExpression().asConstant().getValue().asPrimitive().toString());
// description.getExpression().asConstant().getValue().asPrimitive().getName());
assertEquals("Core terms needed to write vocabularies",
description.getExpression().asConstant().getValueAsString());

View File

@ -21,7 +21,7 @@ package org.apache.olingo.client.api;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.format.ContentType;

View File

@ -20,8 +20,8 @@ package org.apache.olingo.client.api.communication;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.StatusLine;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataError;
/**
* Represents a client error in OData.

View File

@ -19,7 +19,7 @@
package org.apache.olingo.client.api.communication;
import org.apache.http.StatusLine;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
/**
* Represents a server error in OData.

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.client.api.communication.header;
import org.apache.olingo.commons.api.ODataPreferenceNames;
import org.apache.olingo.commons.api.format.PreferenceName;
/**
* Values of the Prefer header.
@ -31,7 +31,7 @@ public class ODataPreferences {
* @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
*/
public String returnContent() {
return PreferenceNames.returnContent.toString();
return PreferenceName.RETURN.getName();
}
/**
@ -40,7 +40,7 @@ public class ODataPreferences {
* @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
*/
public String returnNoContent() {
return PreferenceNames.returnNoContent.toString();
return PreferenceName.RETURN_NO_CONTENT.getName();
}
/**
@ -49,7 +49,7 @@ public class ODataPreferences {
* @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
*/
public String keyAsSegment() {
return PreferenceNames.keyAsSegment.toString();
return PreferenceName.KEY_AS_SEGMENT.getName();
}
/**
@ -70,7 +70,7 @@ public class ODataPreferences {
* @return preference.
*/
public String allowEntityReferences() {
return ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString();
return PreferenceName.ALLOW_ENTITY_REFERENCES.getName();
}
/**
@ -133,7 +133,7 @@ public class ODataPreferences {
* @return preference.
*/
public String callback(final String url) {
return ODataPreferenceNames.CALLBACK.toString() + ";url=\"" + url + "\"";
return PreferenceName.CALLBACK.getName() + ";url=\"" + url + "\"";
}
/**
@ -154,7 +154,7 @@ public class ODataPreferences {
* @return preference.
*/
public String continueOnError() {
return ODataPreferenceNames.CONTINUE_ON_ERROR.toString();
return PreferenceName.CONTINUE_ON_ERROR.getName();
}
/**
@ -201,7 +201,7 @@ public class ODataPreferences {
* @return preference.
*/
public String includeAnnotations(final String value) {
return ODataPreferenceNames.INCLUDE_ANNOTATIONS.toString() + "=" + value;
return PreferenceName.INCLUDE_ANNOTATIONS.getName() + "=" + value;
}
/**
@ -234,7 +234,7 @@ public class ODataPreferences {
* @return preference.
*/
public String maxPageSize(final int size) {
return ODataPreferenceNames.MAX_PAGE_SIZE.toString() + "=" + size;
return PreferenceName.MAX_PAGE_SIZE.getName() + "=" + size;
}
/**
@ -259,7 +259,7 @@ public class ODataPreferences {
* @return preference.
*/
public String trackChanges() {
return ODataPreferenceNames.TRACK_CHANGES.toString();
return PreferenceName.TRACK_CHANGES.getName();
}
/**
@ -294,7 +294,7 @@ public class ODataPreferences {
* @return preference.
*/
public String respondAsync() {
return ODataPreferenceNames.RESPOND_ASYNC.toString();
return PreferenceName.RESPOND_ASYNC.getName();
}
/**
@ -314,7 +314,7 @@ public class ODataPreferences {
* @return preference.
*/
public String wait(final int value) {
return ODataPreferenceNames.WAIT.toString() + "=" + value;
return PreferenceName.WAIT.getName() + "=" + value;
}
/**
@ -344,7 +344,7 @@ public class ODataPreferences {
* @return preference.
*/
public String returnMinimal() {
return ODataPreferenceNames.RETURN.toString() + "=minimal";
return PreferenceName.RETURN.getName() + "=minimal";
}
/**
@ -374,25 +374,6 @@ public class ODataPreferences {
* @return preference.
*/
public String returnRepresentation() {
return ODataPreferenceNames.RETURN.toString() + "=representation";
}
/** Preferences not in the OData 4.0 standard. */
private static enum PreferenceNames {
returnContent("return-content"),
returnNoContent("return-no-content"),
keyAsSegment("KeyAsSegment");
private final String preferenceName;
private PreferenceNames(final String preferenceName) {
this.preferenceName = preferenceName;
}
@Override
public String toString() {
return preferenceName;
}
return PreferenceName.RETURN.getName() + "=representation";
}
}

View File

@ -31,7 +31,7 @@ public class HttpClientException extends RuntimeException {
/**
* Constructs a new client-side runtime exception with the specified cause and a detail message of
* {@code (cause==null ? null : cause.toString())} (which typically contains the class and detail message of
* {@code (cause==null ? null : cause.getName())} (which typically contains the class and detail message of
* {@code cause}). This constructor is useful for runtime exceptions that are little more than wrappers for other
* throwables.
*

View File

@ -20,7 +20,7 @@ package org.apache.olingo.client.api.serialization;
import java.io.InputStream;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.EntityCollection;
import org.apache.olingo.commons.api.data.Property;

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.client.api.serialization;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
public class ODataDeserializerException extends ODataException {

View File

@ -25,7 +25,7 @@ import org.apache.olingo.client.api.domain.ClientEntity;
import org.apache.olingo.client.api.domain.ClientEntitySet;
import org.apache.olingo.client.api.domain.ClientProperty;
import org.apache.olingo.client.api.domain.ClientServiceDocument;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.data.ResWrap;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.provider.CsdlSchema;

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.client.api.serialization;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
public class ODataSerializerException extends ODataException {

View File

@ -24,8 +24,8 @@ import org.apache.http.StatusLine;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.communication.ODataServerErrorException;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.client.api.serialization.ODataDeserializerException;

View File

@ -39,7 +39,7 @@ import org.apache.olingo.client.api.communication.request.ODataRequest;
import org.apache.olingo.client.api.communication.request.ODataStreamer;
import org.apache.olingo.client.api.communication.response.ODataResponse;
import org.apache.olingo.client.api.http.HttpClientException;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.api.http.HttpMethod;

View File

@ -22,7 +22,7 @@ import org.apache.http.client.methods.HttpUriRequest;
import org.apache.olingo.client.api.EdmEnabledODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -43,7 +43,7 @@ import org.apache.olingo.client.core.communication.request.batch.ODataBatchContr
import org.apache.olingo.client.core.communication.request.batch.ODataBatchLineIteratorImpl;
import org.apache.olingo.client.core.communication.request.batch.ODataBatchUtilities;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;
import org.apache.olingo.commons.api.edm.provider.CsdlAction;

View File

@ -40,8 +40,8 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.serialization.ODataDeserializer;
import org.apache.olingo.client.api.serialization.ODataDeserializerException;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ODataPropertyType;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.data.PropertyType;
import org.apache.olingo.commons.api.data.AbstractODataObject;
import org.apache.olingo.commons.api.data.Annotation;
import org.apache.olingo.commons.api.data.ComplexValue;
@ -63,7 +63,6 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.geo.Geospatial;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
import com.fasterxml.aalto.stax.InputFactoryImpl;
@ -222,7 +221,7 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria
valuable.setValue(valueType, values);
}
private ODataPropertyType guessPropertyType(final XMLEventReader reader, final EdmTypeInfo typeInfo)
private PropertyType guessPropertyType(final XMLEventReader reader, final EdmTypeInfo typeInfo)
throws XMLStreamException {
XMLEvent child = null;
@ -235,24 +234,24 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria
}
}
final ODataPropertyType type;
final PropertyType type;
if (child == null) {
type = typeInfo == null || typeInfo.isPrimitiveType() ? ODataPropertyType.PRIMITIVE : ODataPropertyType.ENUM;
type = typeInfo == null || typeInfo.isPrimitiveType() ? PropertyType.PRIMITIVE : PropertyType.ENUM;
} else {
if (child.isStartElement()) {
if (Constants.NS_GML.equals(child.asStartElement().getName().getNamespaceURI())) {
type = ODataPropertyType.PRIMITIVE;
type = PropertyType.PRIMITIVE;
} else if (elementQName.equals(child.asStartElement().getName())) {
type = ODataPropertyType.COLLECTION;
type = PropertyType.COLLECTION;
} else {
type = ODataPropertyType.COMPLEX;
type = PropertyType.COMPLEX;
}
} else if (child.isCharacters()) {
type = typeInfo == null || typeInfo.isPrimitiveType()
? ODataPropertyType.PRIMITIVE
: ODataPropertyType.ENUM;
? PropertyType.PRIMITIVE
: PropertyType.ENUM;
} else {
type = ODataPropertyType.EMPTY;
type = PropertyType.EMPTY;
}
}
@ -294,9 +293,9 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria
valuable.setType(typeInfo.internal());
}
final ODataPropertyType propType = typeInfo == null ? guessPropertyType(reader, typeInfo) :
typeInfo.isCollection() ? ODataPropertyType.COLLECTION :
typeInfo.isPrimitiveType() ? ODataPropertyType.PRIMITIVE : ODataPropertyType.COMPLEX;
final PropertyType propType = typeInfo == null ? guessPropertyType(reader, typeInfo) :
typeInfo.isCollection() ? PropertyType.COLLECTION :
typeInfo.isPrimitiveType() ? PropertyType.PRIMITIVE : PropertyType.COMPLEX;
if (nullAttr == null) {
switch (propType) {
@ -324,10 +323,10 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria
valuable.setValue(ValueType.PRIMITIVE, StringUtils.EMPTY);
}
} else {
valuable.setValue(propType == ODataPropertyType.PRIMITIVE ? ValueType.PRIMITIVE :
propType == ODataPropertyType.ENUM ? ValueType.ENUM :
propType == ODataPropertyType.COMPLEX ? ValueType.COMPLEX :
propType == ODataPropertyType.COLLECTION ? ValueType.COLLECTION_PRIMITIVE : ValueType.PRIMITIVE,
valuable.setValue(propType == PropertyType.PRIMITIVE ? ValueType.PRIMITIVE :
propType == PropertyType.ENUM ? ValueType.ENUM :
propType == PropertyType.COMPLEX ? ValueType.COMPLEX :
propType == PropertyType.COLLECTION ? ValueType.COLLECTION_PRIMITIVE : ValueType.PRIMITIVE,
null);
}
}

View File

@ -35,7 +35,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.serialization.ODataSerializer;
import org.apache.olingo.client.api.serialization.ODataSerializerException;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.data.AbstractODataObject;
import org.apache.olingo.commons.api.data.Annotation;
import org.apache.olingo.commons.api.data.ComplexValue;

View File

@ -32,7 +32,7 @@ import org.apache.olingo.client.core.data.JSONServiceDocumentDeserializer;
import org.apache.olingo.client.core.data.XMLServiceDocumentDeserializer;
import org.apache.olingo.client.core.edm.ClientCsdlXMLMetadata;
import org.apache.olingo.client.core.edm.xml.ClientCsdlEdmx;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.data.Delta;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.EntityCollection;

View File

@ -34,8 +34,8 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.serialization.ODataDeserializer;
import org.apache.olingo.client.api.serialization.ODataDeserializerException;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ODataPropertyType;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.data.PropertyType;
import org.apache.olingo.commons.api.data.Annotatable;
import org.apache.olingo.commons.api.data.Annotation;
import org.apache.olingo.commons.api.data.ComplexValue;
@ -188,32 +188,32 @@ public class JsonDeserializer implements ODataDeserializer {
}
}
private Map.Entry<ODataPropertyType, EdmTypeInfo> guessPropertyType(final JsonNode node) {
ODataPropertyType type;
private Map.Entry<PropertyType, EdmTypeInfo> guessPropertyType(final JsonNode node) {
PropertyType type;
String typeExpression = null;
if (node.isValueNode() || node.isNull()) {
type = ODataPropertyType.PRIMITIVE;
type = PropertyType.PRIMITIVE;
typeExpression = guessPrimitiveTypeKind(node).getFullQualifiedName().toString();
} else if (node.isArray()) {
type = ODataPropertyType.COLLECTION;
type = PropertyType.COLLECTION;
if (node.has(0) && node.get(0).isValueNode()) {
typeExpression = "Collection(" + guessPrimitiveTypeKind(node.get(0)) + ')';
}
} else if (node.isObject()) {
if (node.has(Constants.ATTR_TYPE)) {
type = ODataPropertyType.PRIMITIVE;
type = PropertyType.PRIMITIVE;
typeExpression = "Edm.Geography" + node.get(Constants.ATTR_TYPE).asText();
} else {
type = ODataPropertyType.COMPLEX;
type = PropertyType.COMPLEX;
}
} else {
type = ODataPropertyType.EMPTY;
type = PropertyType.EMPTY;
}
final EdmTypeInfo typeInfo = typeExpression == null ? null :
new EdmTypeInfo.Builder().setTypeExpression(typeExpression).build();
return new SimpleEntry<ODataPropertyType, EdmTypeInfo>(type, typeInfo);
return new SimpleEntry<PropertyType, EdmTypeInfo>(type, typeInfo);
}
private EdmPrimitiveTypeKind guessPrimitiveTypeKind(final JsonNode node) {
@ -336,15 +336,15 @@ public class JsonDeserializer implements ODataDeserializer {
EdmTypeInfo typeInfo = StringUtils.isBlank(valuable.getType()) ? null
: new EdmTypeInfo.Builder().setTypeExpression(valuable.getType()).build();
final Map.Entry<ODataPropertyType, EdmTypeInfo> guessed = guessPropertyType(node);
final Map.Entry<PropertyType, EdmTypeInfo> guessed = guessPropertyType(node);
if (typeInfo == null) {
typeInfo = guessed.getValue();
}
final ODataPropertyType propType = typeInfo == null ? guessed.getKey()
: typeInfo.isCollection() ? ODataPropertyType.COLLECTION
: typeInfo.isPrimitiveType() ? ODataPropertyType.PRIMITIVE
: node.isValueNode() ? ODataPropertyType.ENUM : ODataPropertyType.COMPLEX;
final PropertyType propType = typeInfo == null ? guessed.getKey()
: typeInfo.isCollection() ? PropertyType.COLLECTION
: typeInfo.isPrimitiveType() ? PropertyType.PRIMITIVE
: node.isValueNode() ? PropertyType.ENUM : PropertyType.COMPLEX;
switch (propType) {
case COLLECTION:

View File

@ -25,8 +25,8 @@ import java.util.Iterator;
import java.util.List;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;

View File

@ -22,7 +22,7 @@ import java.io.IOException;
import java.net.URI;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
import org.apache.olingo.commons.api.data.ResWrap;
import com.fasterxml.jackson.core.JsonParser;

View File

@ -35,7 +35,7 @@ import org.apache.olingo.client.api.edm.xml.XMLMetadata;
import org.apache.olingo.client.api.serialization.ODataDeserializerException;
import org.apache.olingo.client.api.serialization.ODataReader;
import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.EntityCollection;
import org.apache.olingo.commons.api.data.Property;

View File

@ -262,7 +262,7 @@ public final class URIUtils {
: obj.toString();
}
} catch (Exception e) {
LOG.warn("While escaping '{}', using toString()", obj, e);
LOG.warn("While escaping '{}', using getName()", obj, e);
if (obj == null) {
value = "null";
} else {

View File

@ -24,7 +24,7 @@ import static org.junit.Assert.assertNotNull;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.serialization.ODataDeserializerException;
import org.apache.olingo.client.core.AbstractTest;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.format.ContentType;
import org.junit.Test;

View File

@ -29,279 +29,279 @@ import org.apache.olingo.commons.api.format.ContentType;
public interface Constants {
// Other stuff
public final static String UTF8 = "UTF-8";
String UTF8 = "UTF-8";
public final static String METADATA = "$metadata";
String METADATA = "$metadata";
public final static Integer DEFAULT_PRECISION = 40;
Integer DEFAULT_PRECISION = 40;
public final static Integer DEFAULT_SCALE = 25;
Integer DEFAULT_SCALE = 25;
// Common Namespaces
public final static String NS_BASE = "http://docs.oasis-open.org/odata/ns/";
String NS_BASE = "http://docs.oasis-open.org/odata/ns/";
public final static String NS_DATASERVICES = "http://docs.oasis-open.org/odata/ns/data";
String NS_DATASERVICES = "http://docs.oasis-open.org/odata/ns/data";
public final static String NS_METADATA = "http://docs.oasis-open.org/odata/ns/metadata";
String NS_METADATA = "http://docs.oasis-open.org/odata/ns/metadata";
public final static String NS_SCHEME = "http://docs.oasis-open.org/odata/ns/scheme";
String NS_SCHEME = "http://docs.oasis-open.org/odata/ns/scheme";
public final static String NS_NAVIGATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/related/";
String NS_NAVIGATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/related/";
public final static String NS_ASSOCIATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/relatedlinks/";
String NS_ASSOCIATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/relatedlinks/";
public final static String NS_MEDIA_EDIT_LINK_REL = "http://docs.oasis-open.org/odata/ns/edit-media/";
String NS_MEDIA_EDIT_LINK_REL = "http://docs.oasis-open.org/odata/ns/edit-media/";
public final static String NS_DELTA_LINK_REL = "http://docs.oasis-open.org/odata/ns/delta";
String NS_DELTA_LINK_REL = "http://docs.oasis-open.org/odata/ns/delta";
// XML namespaces and prefixes
public final static String NS_ATOM = "http://www.w3.org/2005/Atom";
String NS_ATOM = "http://www.w3.org/2005/Atom";
public static final String NS_GEORSS = "http://www.georss.org/georss";
String NS_GEORSS = "http://www.georss.org/georss";
public static final String NS_GML = "http://www.opengis.net/gml";
String NS_GML = "http://www.opengis.net/gml";
public static final String NS_ATOM_TOMBSTONE = "http://purl.org/atompub/tombstones/1.0";
String NS_ATOM_TOMBSTONE = "http://purl.org/atompub/tombstones/1.0";
public static final String PREFIX_DATASERVICES = "d";
String PREFIX_DATASERVICES = "d";
public static final String PREFIX_METADATA = "m";
String PREFIX_METADATA = "m";
public static final String PREFIX_GEORSS = "georss";
String PREFIX_GEORSS = "georss";
public static final String PREFIX_GML = "gml";
String PREFIX_GML = "gml";
public final static String SRS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/";
String SRS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/";
// Link rel(s)
public static final String EDIT_LINK_REL = "edit";
String EDIT_LINK_REL = "edit";
public static final String SELF_LINK_REL = "self";
String SELF_LINK_REL = "self";
public static final String EDITMEDIA_LINK_REL = "edit-media";
String EDITMEDIA_LINK_REL = "edit-media";
public static final String NEXT_LINK_REL = "next";
String NEXT_LINK_REL = "next";
// XML elements and attributes
public static final String PROPERTIES = "properties";
String PROPERTIES = "properties";
public static final String ELEM_ELEMENT = "element";
String ELEM_ELEMENT = "element";
public final static String ATTR_TYPE = "type";
String ATTR_TYPE = "type";
public final static String ATTR_NULL = "null";
String ATTR_NULL = "null";
public static final String ATTR_XML_BASE = "base";
String ATTR_XML_BASE = "base";
public static final QName QNAME_ATTR_XML_BASE = new QName(XMLConstants.XML_NS_URI, ATTR_XML_BASE);
QName QNAME_ATTR_XML_BASE = new QName(XMLConstants.XML_NS_URI, ATTR_XML_BASE);
public static final String CONTEXT = "context";
String CONTEXT = "context";
public static final String ATTR_REL = "rel";
String ATTR_REL = "rel";
public static final String ATTR_TITLE = "title";
String ATTR_TITLE = "title";
public static final String ATTR_METADATA = "metadata";
String ATTR_METADATA = "metadata";
public static final String ATTR_HREF = "href";
String ATTR_HREF = "href";
public static final String ATTR_REF = "ref";
String ATTR_REF = "ref";
public static final String ATTR_TARGET = "target";
String ATTR_TARGET = "target";
public static final String ATTR_SRSNAME = "srsName";
String ATTR_SRSNAME = "srsName";
public static final QName QNAME_ATTR_SRSNAME = new QName(NS_GML, ATTR_SRSNAME);
QName QNAME_ATTR_SRSNAME = new QName(NS_GML, ATTR_SRSNAME);
public static final String ELEM_POINT = "Point";
String ELEM_POINT = "Point";
public static final String ELEM_MULTIPOINT = "MultiPoint";
String ELEM_MULTIPOINT = "MultiPoint";
public static final String ELEM_POINTMEMBERS = "pointMembers";
String ELEM_POINTMEMBERS = "pointMembers";
public static final QName QNAME_POINTMEMBERS = new QName(NS_GML, ELEM_POINTMEMBERS);
QName QNAME_POINTMEMBERS = new QName(NS_GML, ELEM_POINTMEMBERS);
public static final String ELEM_LINESTRING = "LineString";
String ELEM_LINESTRING = "LineString";
public static final QName QNAME_LINESTRING = new QName(NS_GML, ELEM_LINESTRING);
QName QNAME_LINESTRING = new QName(NS_GML, ELEM_LINESTRING);
public static final String ELEM_MULTILINESTRING = "MultiCurve";
String ELEM_MULTILINESTRING = "MultiCurve";
public static final String ELEM_LINESTRINGMEMBERS = "curveMembers";
String ELEM_LINESTRINGMEMBERS = "curveMembers";
public static final String ELEM_POLYGON = "Polygon";
String ELEM_POLYGON = "Polygon";
public static final QName QNAME_POLYGON = new QName(NS_GML, ELEM_POLYGON);
QName QNAME_POLYGON = new QName(NS_GML, ELEM_POLYGON);
public static final String ELEM_POLYGON_EXTERIOR = "exterior";
String ELEM_POLYGON_EXTERIOR = "exterior";
public static final QName QNAME_POLYGON_EXTERIOR = new QName(NS_GML, ELEM_POLYGON_EXTERIOR);
QName QNAME_POLYGON_EXTERIOR = new QName(NS_GML, ELEM_POLYGON_EXTERIOR);
public static final String ELEM_POLYGON_INTERIOR = "interior";
String ELEM_POLYGON_INTERIOR = "interior";
public static final QName QNAME_POLYGON_INTERIOR = new QName(NS_GML, ELEM_POLYGON_INTERIOR);
QName QNAME_POLYGON_INTERIOR = new QName(NS_GML, ELEM_POLYGON_INTERIOR);
public static final String ELEM_POLYGON_LINEARRING = "LinearRing";
String ELEM_POLYGON_LINEARRING = "LinearRing";
public static final String ELEM_MULTIPOLYGON = "MultiSurface";
String ELEM_MULTIPOLYGON = "MultiSurface";
public static final String ELEM_SURFACEMEMBERS = "surfaceMembers";
String ELEM_SURFACEMEMBERS = "surfaceMembers";
public static final String ELEM_GEOCOLLECTION = "MultiGeometry";
String ELEM_GEOCOLLECTION = "MultiGeometry";
public static final String ELEM_GEOMEMBERS = "geometryMembers";
String ELEM_GEOMEMBERS = "geometryMembers";
public static final QName QNAME_GEOMEMBERS = new QName(NS_GML, ELEM_GEOMEMBERS);
QName QNAME_GEOMEMBERS = new QName(NS_GML, ELEM_GEOMEMBERS);
public static final String ELEM_POS = "pos";
String ELEM_POS = "pos";
public static final String ELEM_PROPERTY = "property";
String ELEM_PROPERTY = "property";
public static final String ELEM_LINKS = "links";
String ELEM_LINKS = "links";
public static final String ELEM_URI = "uri";
String ELEM_URI = "uri";
public final static String ELEM_REASON = "reason";
String ELEM_REASON = "reason";
public static final String ELEM_DELETED_LINK = "deleted-link";
String ELEM_DELETED_LINK = "deleted-link";
public static final String ATTR_SOURCE = "source";
String ATTR_SOURCE = "source";
public static final String ATTR_RELATIONSHIP = "relationship";
String ATTR_RELATIONSHIP = "relationship";
public static final String ANNOTATION = "annotation";
String ANNOTATION = "annotation";
// JSON stuff
public final static String JSON_METADATA = "odata.metadata";
String JSON_METADATA = "odata.metadata";
public final static String JSON_TYPE = "@odata.type";
String JSON_TYPE = "@odata.type";
public final static String JSON_ID = "@odata.id";
String JSON_ID = "@odata.id";
public final static String JSON_READ_LINK = "@odata.readLink";
String JSON_READ_LINK = "@odata.readLink";
public final static String JSON_EDIT_LINK = "@odata.editLink";
String JSON_EDIT_LINK = "@odata.editLink";
public final static String JSON_CONTEXT = "@odata.context";
String JSON_CONTEXT = "@odata.context";
public final static String JSON_ETAG = "@odata.etag";
String JSON_ETAG = "@odata.etag";
public final static String JSON_MEDIA_ETAG = "@odata.mediaEtag";
String JSON_MEDIA_ETAG = "@odata.mediaEtag";
public final static String JSON_MEDIA_CONTENT_TYPE = "@odata.mediaContentType";
String JSON_MEDIA_CONTENT_TYPE = "@odata.mediaContentType";
public final static String JSON_MEDIA_READ_LINK = "@odata.mediaReadLink";
String JSON_MEDIA_READ_LINK = "@odata.mediaReadLink";
public final static String JSON_MEDIA_EDIT_LINK = "@odata.mediaEditLink";
String JSON_MEDIA_EDIT_LINK = "@odata.mediaEditLink";
public final static String JSON_METADATA_ETAG = "@odata.metadataEtag";
String JSON_METADATA_ETAG = "@odata.metadataEtag";
public final static String JSON_BIND_LINK_SUFFIX = "@odata.bind";
String JSON_BIND_LINK_SUFFIX = "@odata.bind";
public final static String JSON_ASSOCIATION_LINK = "@odata.associationLink";
String JSON_ASSOCIATION_LINK = "@odata.associationLink";
public final static String JSON_NAVIGATION_LINK = "@odata.navigationLink";
String JSON_NAVIGATION_LINK = "@odata.navigationLink";
public final static String JSON_COUNT = "@odata.count";
String JSON_COUNT = "@odata.count";
public final static String JSON_NEXT_LINK = "@odata.nextLink";
String JSON_NEXT_LINK = "@odata.nextLink";
public final static String JSON_DELTA_LINK = "@odata.deltaLink";
String JSON_DELTA_LINK = "@odata.deltaLink";
public final static String JSON_ERROR = "error";
String JSON_ERROR = "error";
public final static String JSON_NULL = "odata.null";
String JSON_NULL = "odata.null";
public final static String VALUE = "value";
String VALUE = "value";
public final static String JSON_URL = "url";
String JSON_URL = "url";
public final static String JSON_COORDINATES = "coordinates";
String JSON_COORDINATES = "coordinates";
public final static String JSON_GEOMETRIES = "geometries";
String JSON_GEOMETRIES = "geometries";
public final static String JSON_CRS = "crs";
String JSON_CRS = "crs";
public final static String JSON_NAME = "name";
String JSON_NAME = "name";
// Atom stuff
public final static String ATOM_ELEM_ENTRY = "entry";
String ATOM_ELEM_ENTRY = "entry";
public static final QName QNAME_ATOM_ELEM_ENTRY = new QName(NS_ATOM, ATOM_ELEM_ENTRY);
QName QNAME_ATOM_ELEM_ENTRY = new QName(NS_ATOM, ATOM_ELEM_ENTRY);
public final static String ATOM_ELEM_ENTRY_REF = "ref";
String ATOM_ELEM_ENTRY_REF = "ref";
public final static String ATOM_ATTR_ID = "id";
String ATOM_ATTR_ID = "id";
public final static QName QNAME_ATOM_ATTR_ID = new QName(ATOM_ATTR_ID);
QName QNAME_ATOM_ATTR_ID = new QName(ATOM_ATTR_ID);
public final static String ATOM_ELEM_FEED = "feed";
String ATOM_ELEM_FEED = "feed";
public static final QName QNAME_ATOM_ELEM_FEED = new QName(NS_ATOM, ATOM_ELEM_FEED);
QName QNAME_ATOM_ELEM_FEED = new QName(NS_ATOM, ATOM_ELEM_FEED);
public final static String ATOM_ELEM_CATEGORY = "category";
String ATOM_ELEM_CATEGORY = "category";
public static final QName QNAME_ATOM_ELEM_CATEGORY = new QName(NS_ATOM, ATOM_ELEM_CATEGORY);
QName QNAME_ATOM_ELEM_CATEGORY = new QName(NS_ATOM, ATOM_ELEM_CATEGORY);
public static final String ATOM_ELEM_COUNT = "count";
String ATOM_ELEM_COUNT = "count";
public final static String ATOM_ELEM_ID = "id";
String ATOM_ELEM_ID = "id";
public static final QName QNAME_ATOM_ELEM_ID = new QName(NS_ATOM, ATOM_ELEM_ID);
QName QNAME_ATOM_ELEM_ID = new QName(NS_ATOM, ATOM_ELEM_ID);
public static final String ATOM_ELEM_TITLE = "title";
String ATOM_ELEM_TITLE = "title";
public static final QName QNAME_ATOM_ELEM_TITLE = new QName(NS_ATOM, ATOM_ELEM_TITLE);
QName QNAME_ATOM_ELEM_TITLE = new QName(NS_ATOM, ATOM_ELEM_TITLE);
public static final String ATOM_ELEM_SUMMARY = "summary";
String ATOM_ELEM_SUMMARY = "summary";
public static final QName QNAME_ATOM_ELEM_SUMMARY = new QName(NS_ATOM, ATOM_ELEM_SUMMARY);
QName QNAME_ATOM_ELEM_SUMMARY = new QName(NS_ATOM, ATOM_ELEM_SUMMARY);
public static final String ATOM_ELEM_UPDATED = "updated";
String ATOM_ELEM_UPDATED = "updated";
public static final QName QNAME_ATOM_ELEM_UPDATED = new QName(NS_ATOM, ATOM_ELEM_UPDATED);
QName QNAME_ATOM_ELEM_UPDATED = new QName(NS_ATOM, ATOM_ELEM_UPDATED);
public final static String ATOM_ELEM_LINK = "link";
String ATOM_ELEM_LINK = "link";
public static final QName QNAME_ATOM_ELEM_LINK = new QName(NS_ATOM, ATOM_ELEM_LINK);
QName QNAME_ATOM_ELEM_LINK = new QName(NS_ATOM, ATOM_ELEM_LINK);
public final static String ATOM_ELEM_CONTENT = "content";
String ATOM_ELEM_CONTENT = "content";
public static final QName QNAME_ATOM_ELEM_CONTENT = new QName(NS_ATOM, ATOM_ELEM_CONTENT);
QName QNAME_ATOM_ELEM_CONTENT = new QName(NS_ATOM, ATOM_ELEM_CONTENT);
public static final String ATOM_ELEM_ACTION = "action";
String ATOM_ELEM_ACTION = "action";
public static final String ATOM_ELEM_INLINE = "inline";
String ATOM_ELEM_INLINE = "inline";
public static final String ATOM_ATTR_TERM = "term";
String ATOM_ATTR_TERM = "term";
public static final String ATOM_ATTR_SCHEME = "scheme";
String ATOM_ATTR_SCHEME = "scheme";
public static final String ATOM_ATTR_SRC = "src";
String ATOM_ATTR_SRC = "src";
public static final String ATOM_ATTR_ETAG = "etag";
String ATOM_ATTR_ETAG = "etag";
public static final String ATOM_ATTR_METADATAETAG = "metadata-etag";
String ATOM_ATTR_METADATAETAG = "metadata-etag";
public static final String ATOM_ELEM_DELETED_ENTRY = "deleted-entry";
String ATOM_ELEM_DELETED_ENTRY = "deleted-entry";
// error stuff
public static final String ERROR_CODE = "code";
String ERROR_CODE = "code";
public static final String ERROR_MESSAGE = "message";
String ERROR_MESSAGE = "message";
public static final String ERROR_TARGET = "target";
String ERROR_TARGET = "target";
public static final String ERROR_DETAILS = "details";
String ERROR_DETAILS = "details";
public static final String ERROR_INNERERROR = "innererror";
String ERROR_INNERERROR = "innererror";
// canonical functions to be applied via dynamic annotation <tt>Apply</tt>
public static final String CANONICAL_FUNCTION_CONCAT = "odata.concat";
String CANONICAL_FUNCTION_CONCAT = "odata.concat";
public static final String CANONICAL_FUNCTION_FILLURITEMPLATE = "odata.fillUriTemplate";
String CANONICAL_FUNCTION_FILLURITEMPLATE = "odata.fillUriTemplate";
public static final String CANONICAL_FUNCTION_URIENCODE = "odata.uriEncode";
String CANONICAL_FUNCTION_URIENCODE = "odata.uriEncode";
String MEDIA_EDIT_LINK_TYPE = "*/*";
String ENTITY_NAVIGATION_LINK_TYPE = ContentType.APPLICATION_ATOM_XML_ENTRY.toContentTypeString();

View File

@ -16,9 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.commons.api;
package org.apache.olingo.commons.api.data;
public enum ODataPropertyType {
/**
* Enumeration for all OData property types.
*/
public enum PropertyType {
/**
* Primitive (including geospatial).
@ -40,5 +43,4 @@ public enum ODataPropertyType {
* Empty type (possibly, no type information could be retrieved).
*/
EMPTY
}

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.commons.api.edm;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
public class EdmPrimitiveTypeException extends ODataException {

View File

@ -85,7 +85,7 @@ public final class SRID implements Serializable {
// return value == null ? dimension == Dimension.GEOMETRY
// ? "0"
// : "4326"
// : value.toString();
// : value.getName();
}
private boolean isVariable() {

View File

@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
public abstract class CsdlAbstractEdmProvider implements CsdlEdmProvider {

View File

@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
public interface CsdlEdmProvider {

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.commons.api;
package org.apache.olingo.commons.api.ex;
import java.util.List;
import java.util.Map;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.commons.api;
package org.apache.olingo.commons.api.ex;
/**
* OData details for example <tt>{ "error": {..., "details":[
@ -66,6 +66,12 @@ public class ODataErrorDetail {
return target;
}
/**
* Set the error target.
*
* @param target the error target
* @return this ODataErrorDetail instance (fluent builder)
*/
public ODataErrorDetail setTarget(final String target) {
this.target = target;
return this;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.commons.api;
package org.apache.olingo.commons.api.ex;
public class ODataException extends Exception {

View File

@ -16,20 +16,39 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.commons.api;
package org.apache.olingo.commons.api.ex;
/**
* Core runtime exception for OData.
*/
public class ODataRuntimeException extends RuntimeException {
private static final long serialVersionUID = 5492375572049190883L;
/**
* Create with <code>message</code>.
*
* @param msg message text for exception
*/
public ODataRuntimeException(final String msg) {
super(msg);
}
/**
* Create with <code>message</code> for and <code>cause</code> of exception.
*
* @param msg message text for exception
* @param cause cause of exception
*/
public ODataRuntimeException(final String msg, final Exception cause) {
super(msg, cause);
}
/**
* Create with <code>cause</code> of exception.
*
* @param cause cause of exception
*/
public ODataRuntimeException(final Exception cause) {
super(cause);
}

View File

@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.commons.api;
package org.apache.olingo.commons.api.format;
/**
* Names of preferences defined in the OData standard.
*/
public enum ODataPreferenceNames {
public enum PreferenceName {
ALLOW_ENTITY_REFERENCES("odata.allow-entityreferences"),
CALLBACK("odata.callback"),
@ -31,16 +31,23 @@ public enum ODataPreferenceNames {
TRACK_CHANGES("odata.track-changes"),
RETURN("return"),
RESPOND_ASYNC("respond-async"),
WAIT("wait");
WAIT("wait"),
RETURN_CONTENT("return-content"),
RETURN_NO_CONTENT("return-no-content"),
KEY_AS_SEGMENT("KeyAsSegment");
private final String preferenceName;
ODataPreferenceNames(final String preferenceName) {
PreferenceName(final String preferenceName) {
this.preferenceName = preferenceName;
}
public String getName() {
return preferenceName;
}
@Override
public String toString() {
return preferenceName;
return getName();
}
}

View File

@ -23,6 +23,9 @@ import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
/**
* Helper class which is only used within this package (<code>AcceptType</code> and <code>ContentType</code> handling).
*/
final class TypeUtil {
static final String MEDIA_TYPE_WILDCARD = "*";
@ -37,7 +40,7 @@ final class TypeUtil {
private TypeUtil() { /* static helper class */}
/** Creates a parameter map with predictable order. */
protected static Map<String, String> createParameterMap() {
static Map<String, String> createParameterMap() {
return new TreeMap<String, String>(new Comparator<String>() {
@Override
public int compare(final String o1, final String o2) {
@ -58,10 +61,10 @@ final class TypeUtil {
* depending on its definition within the media type registry.
* </p>
*
* @param parameters
* @param parameterMap
* @param parameters as <code>;</code> separated <code>key=value</code> pairs
* @param parameterMap map to which all parsed parameters are added
*/
protected static void parseParameters(final String parameters, final Map<String, String> parameterMap) {
static void parseParameters(final String parameters, final Map<String, String> parameterMap) {
if (parameters != null) {
for (String parameter : parameters.split(TypeUtil.PARAMETER_SEPARATOR)) {
final String[] keyValue = parseParameter(parameter);
@ -70,7 +73,21 @@ final class TypeUtil {
}
}
protected static String[] parseParameter(final String parameter) {
/**
* Valid input is one <code>key=value</code> pair without spaces between key and value.
* <p>
* See RFC 7231:
* The type, subtype, and parameter name tokens are case-insensitive.
* Parameter values might or might not be case-sensitive, depending on
* the semantics of the parameter name. The presence or absence of a
* parameter might be significant to the processing of a media-type,
* depending on its definition within the media type registry.
* </p>
*
* @param parameter as <code>key=value</code> pair
* @return <code>key</code> as first array value (as lower case) and <code>value</code> as second array value
*/
static String[] parseParameter(final String parameter) {
if (parameter.isEmpty()) {
throw new IllegalArgumentException("An empty parameter is not allowed.");
}
@ -84,11 +101,23 @@ final class TypeUtil {
return keyValue;
}
protected static void validateParameterNameAndValue(final String parameterName, final String parameterValue)
/**
* Validate that parameter name and parameter value are valid .
*
* @param parameterName must be <code>not null</code>, <code>not empty</code> and <code>contains no whitespace
* characters</code>
* @param parameterValue must be <code>not null</code>, <code>not empty</code> and <code>not start with a whitespace
* character</code>
* @throws IllegalArgumentException if one of the above requirements are not met
*/
static void validateParameterNameAndValue(final String parameterName, final String parameterValue)
throws IllegalArgumentException {
if (parameterName == null || parameterName.isEmpty() || parameterName.indexOf(WHITESPACE_CHAR) >= 0) {
throw new IllegalArgumentException("Illegal parameter name '" + parameterName + "'.");
}
if (parameterValue == null || parameterValue.isEmpty()) {
throw new IllegalArgumentException("Value parameter is NULL or empty.");
}
if (Character.isWhitespace(parameterValue.charAt(0))) {
throw new IllegalArgumentException("Value of parameter '" + parameterName + "' starts with whitespace.");
}

View File

@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
/**
* Contains all the format related objects (also related to http headers <coder>Prefer</coder>, <code>Accepted</code>
* and <code>Content-Type</code>) which are used for handling of an OData responses and OData requests.
*/
package org.apache.olingo.commons.api.format;

View File

@ -81,7 +81,7 @@ public enum HttpStatusCode {
* @return the status code info
*/
public String getInfo() {
return toString();
return info;
}
/**
@ -91,7 +91,6 @@ public enum HttpStatusCode {
*/
@Override
public String toString() {
return info;
return getInfo();
}
}

View File

@ -0,0 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
/**
* Contains all the http related objects which are used for handling of an OData responses and OData requests.
*/
package org.apache.olingo.commons.api.http;

View File

@ -100,6 +100,9 @@ public class ContentTypeTest {
@Test
public void testParse() {
assertNull(ContentType.parse("a"));
assertNull(ContentType.parse("a/b;c"));
assertNull(ContentType.parse("a/b;c="));
assertNull(ContentType.parse("a/b;c= "));
}
@Test(expected = IllegalArgumentException.class)

View File

@ -24,7 +24,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmActionImport;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;

View File

@ -25,7 +25,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.EdmAction;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmAnnotations;

View File

@ -216,7 +216,7 @@ public final class EdmDateTimeOffset extends SingletonPrimitiveType {
if (value instanceof Date) {
// Although java.util.Date, as stated in its documentation,
// "is intended to reflect coordinated universal time (UTC)",
// its toString() method uses the default time zone. And so do we.
// its getName() method uses the default time zone. And so do we.
dateTimeValue = Calendar.getInstance();
dateTimeValue.setTime((Date) value);
} else if (value instanceof Calendar) {

View File

@ -21,7 +21,7 @@ package org.apache.olingo.server.api;
import java.util.Collection;
import java.util.List;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider;

View File

@ -20,7 +20,7 @@ package org.apache.olingo.server.api;
import java.util.Locale;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.http.HttpStatusCode;
/**

View File

@ -25,7 +25,7 @@ import java.util.MissingFormatArgumentException;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
/**
* Abstract superclass of all translatable server exceptions.

View File

@ -22,8 +22,8 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
/**
* Server error.

View File

@ -25,7 +25,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.olingo.commons.api.ODataPreferenceNames;
import org.apache.olingo.commons.api.format.PreferenceName;
import org.apache.olingo.server.api.prefer.Preferences.Return;
/**
@ -72,14 +72,14 @@ public final class PreferencesApplied {
private boolean isSafe(String key) {
if(SAFE_PREFERENCE_NAMES.isEmpty()) {
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString());
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.CALLBACK.toString());
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.CONTINUE_ON_ERROR.toString());
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.MAX_PAGE_SIZE.toString());
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.TRACK_CHANGES.toString());
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.RETURN.toString());
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.RESPOND_ASYNC.toString());
SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.WAIT.toString());
SAFE_PREFERENCE_NAMES.add(PreferenceName.ALLOW_ENTITY_REFERENCES.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.CALLBACK.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.CONTINUE_ON_ERROR.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.MAX_PAGE_SIZE.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.TRACK_CHANGES.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.RETURN.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.RESPOND_ASYNC.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.WAIT.getName());
}
return SAFE_PREFERENCE_NAMES.contains(key);
}
@ -105,49 +105,49 @@ public final class PreferencesApplied {
/** Sets <code>odata.allow-entityreferences</code>. */
public Builder allowEntityReferences() {
add(ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString(), null);
add(PreferenceName.ALLOW_ENTITY_REFERENCES.getName(), null);
return this;
}
/** Sets <code>odata.callback</code>. */
public Builder callback() {
add(ODataPreferenceNames.CALLBACK.toString(), null);
add(PreferenceName.CALLBACK.getName(), null);
return this;
}
/** Sets <code>odata.continue-on-error</code>. */
public Builder continueOnError() {
add(ODataPreferenceNames.CONTINUE_ON_ERROR.toString(), null);
add(PreferenceName.CONTINUE_ON_ERROR.getName(), null);
return this;
}
/** Sets the value of the applied preference <code>odata.maxpagesize</code>. */
public Builder maxPageSize(final Integer maxPageSize) {
add(ODataPreferenceNames.MAX_PAGE_SIZE.toString(), Integer.toString(maxPageSize));
add(PreferenceName.MAX_PAGE_SIZE.getName(), Integer.toString(maxPageSize));
return this;
}
/** Sets <code>odata.track-changes</code>. */
public Builder trackChanges() {
add(ODataPreferenceNames.TRACK_CHANGES.toString(), null);
add(PreferenceName.TRACK_CHANGES.getName(), null);
return this;
}
/** Sets the value of the applied preference <code>return</code>. */
public Builder returnRepresentation(final Return returnRepresentation) {
add(ODataPreferenceNames.RETURN.toString(), returnRepresentation.name().toLowerCase(Locale.ROOT));
add(PreferenceName.RETURN.getName(), returnRepresentation.name().toLowerCase(Locale.ROOT));
return this;
}
/** Sets <code>odata.respond-async</code>. */
public Builder respondAsync() {
add(ODataPreferenceNames.RESPOND_ASYNC.toString(), null);
add(PreferenceName.RESPOND_ASYNC.getName(), null);
return this;
}
/** Sets the value of the applied preference <code>wait</code>. */
public Builder waitPreference(final Integer wait) {
add(ODataPreferenceNames.WAIT.toString(), Integer.toString(wait));
add(PreferenceName.WAIT.getName(), Integer.toString(wait));
return this;
}

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.api.uri.queryoption.expression;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
/**
* Exception class used by the {@link ExpressionVisitor} to throw exceptions while traversing the expression tree

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.core;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.server.api.OData;
import org.apache.olingo.server.api.ODataHttpHandler;
import org.apache.olingo.server.api.ServiceMetadata;

View File

@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAction;
import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;

View File

@ -27,7 +27,7 @@ import static org.junit.Assert.assertTrue;
import java.io.FileReader;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAction;
import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;

View File

@ -189,9 +189,9 @@ public class ServiceDispatcherTest {
Mockito.verify(handler).read(arg1.capture(), arg2.capture());
DataRequest request = arg1.getValue();
// Need toString on ContextURL class
// Need getName on ContextURL class
// assertEquals("",
// request.getContextURL(request.getOdata()).toString());
// request.getContextURL(request.getOdata()).getName());
assertEquals("application/json;odata.metadata=minimal", request.getResponseContentType()
.toContentTypeString());
}
@ -209,9 +209,9 @@ public class ServiceDispatcherTest {
Mockito.verify(handler).read(arg1.capture(), arg2.capture());
DataRequest request = arg1.getValue();
// Need toString on ContextURL class
// Need getName on ContextURL class
// assertEquals("",
// request.getContextURL(request.getOdata()).toString());
// request.getContextURL(request.getOdata()).getName());
assertEquals("text/plain", request.getResponseContentType().toContentTypeString());
}
});

View File

@ -34,7 +34,7 @@ import java.util.Map.Entry;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpMethod;
import org.apache.olingo.server.api.OData;

View File

@ -23,7 +23,7 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpMethod;
import org.apache.olingo.server.api.ODataRequest;

View File

@ -31,7 +31,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpStatusCode;

View File

@ -23,7 +23,7 @@ import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.server.api.deserializer.batch.BatchDeserializerException;
import org.apache.olingo.server.api.deserializer.batch.BatchOptions;
import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart;

View File

@ -23,7 +23,7 @@ import java.util.Collection;
import java.util.Locale;
import java.util.Map;
import org.apache.olingo.commons.api.ODataPreferenceNames;
import org.apache.olingo.commons.api.format.PreferenceName;
import org.apache.olingo.server.api.prefer.Preferences;
/**
@ -46,15 +46,15 @@ public class PreferencesImpl implements Preferences {
}
public boolean hasAllowEntityReferences() {
return preferences.containsKey(ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString());
return preferences.containsKey(PreferenceName.ALLOW_ENTITY_REFERENCES.getName());
}
public URI getCallback() {
if (preferences.containsKey(ODataPreferenceNames.CALLBACK.toString())
&& preferences.get(ODataPreferenceNames.CALLBACK.toString()).getParameters() != null
&& preferences.get(ODataPreferenceNames.CALLBACK.toString()).getParameters().get(URL) != null) {
if (preferences.containsKey(PreferenceName.CALLBACK.getName())
&& preferences.get(PreferenceName.CALLBACK.getName()).getParameters() != null
&& preferences.get(PreferenceName.CALLBACK.getName()).getParameters().get(URL) != null) {
try {
return URI.create(preferences.get(ODataPreferenceNames.CALLBACK.toString()).getParameters().get(URL));
return URI.create(preferences.get(PreferenceName.CALLBACK.getName()).getParameters().get(URL));
} catch (final IllegalArgumentException e) {
return null;
}
@ -63,20 +63,20 @@ public class PreferencesImpl implements Preferences {
}
public boolean hasContinueOnError() {
return preferences.containsKey(ODataPreferenceNames.CONTINUE_ON_ERROR.toString());
return preferences.containsKey(PreferenceName.CONTINUE_ON_ERROR.getName());
}
public Integer getMaxPageSize() {
return getNonNegativeIntegerPreference(ODataPreferenceNames.MAX_PAGE_SIZE.toString());
return getNonNegativeIntegerPreference(PreferenceName.MAX_PAGE_SIZE.getName());
}
public boolean hasTrackChanges() {
return preferences.containsKey(ODataPreferenceNames.TRACK_CHANGES.toString());
return preferences.containsKey(PreferenceName.TRACK_CHANGES.getName());
}
public Return getReturn() {
if (preferences.containsKey(ODataPreferenceNames.RETURN.toString())) {
final String value = preferences.get(ODataPreferenceNames.RETURN.toString()).getValue();
if (preferences.containsKey(PreferenceName.RETURN.getName())) {
final String value = preferences.get(PreferenceName.RETURN.getName()).getValue();
if (Return.REPRESENTATION.toString().toLowerCase(Locale.ROOT).equals(value)) {
return Return.REPRESENTATION;
} else if (Return.MINIMAL.toString().toLowerCase(Locale.ROOT).equals(value)) {
@ -87,11 +87,11 @@ public class PreferencesImpl implements Preferences {
}
public boolean hasRespondAsync() {
return preferences.containsKey(ODataPreferenceNames.RESPOND_ASYNC.toString());
return preferences.containsKey(PreferenceName.RESPOND_ASYNC.getName());
}
public Integer getWait() {
return getNonNegativeIntegerPreference(ODataPreferenceNames.WAIT.toString());
return getNonNegativeIntegerPreference(PreferenceName.WAIT.getName());
}
private Integer getNonNegativeIntegerPreference(final String name) {

View File

@ -31,7 +31,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.http.HttpContentType;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpStatusCode;

View File

@ -21,8 +21,8 @@ package org.apache.olingo.server.core.serializer.json;
import java.io.IOException;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataError;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataError;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
import org.apache.olingo.server.api.serializer.SerializerException;
import com.fasterxml.jackson.core.JsonGenerator;

View File

@ -31,7 +31,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
import org.apache.olingo.commons.api.data.ComplexValue;
import org.apache.olingo.commons.api.data.ContextURL;
import org.apache.olingo.commons.api.data.Entity;

View File

@ -25,7 +25,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.EdmEntityType;
import org.apache.olingo.server.api.uri.UriInfo;
import org.apache.olingo.server.api.uri.UriInfoAll;

View File

@ -30,7 +30,7 @@ import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.atn.PredictionMode;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.server.api.uri.UriInfo;
import org.apache.olingo.server.api.uri.UriInfoKind;

View File

@ -29,7 +29,7 @@ import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.IOUtils;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.server.api.OData;
import org.apache.olingo.server.api.ODataResponse;
import org.apache.olingo.server.api.debug.DebugInformation;

View File

@ -29,7 +29,7 @@ import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.EdmActionImport;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmEntitySet;

View File

@ -30,7 +30,7 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmComplexType;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
@ -125,24 +125,24 @@ public class EdmProviderImplTest {
try {
localEdm.getUnboundAction(fqn);
} catch (EdmException e) {
assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage());
assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage());
}
try {
localEdm.getUnboundFunction(fqn, null);
} catch (EdmException e) {
assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage());
assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage());
}
try {
localEdm.getBoundAction(fqn, fqn, true);
} catch (EdmException e) {
assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage());
assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage());
}
try {
localEdm.getBoundFunction(fqn, fqn, true, null);
} catch (EdmException e) {
assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage());
assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage());
}
}

View File

@ -27,7 +27,7 @@ import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAction;
import org.apache.olingo.commons.api.edm.EdmActionImport;

View File

@ -24,7 +24,7 @@ import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.EdmComplexType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;

View File

@ -27,7 +27,7 @@ import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.data.ComplexValue;
import org.apache.olingo.commons.api.data.ContextURL;
import org.apache.olingo.commons.api.data.Property;

View File

@ -26,7 +26,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.server.api.OData;
import org.apache.olingo.server.api.ODataServerError;

View File

@ -32,7 +32,7 @@ import java.util.Collections;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmComplexType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;

View File

@ -25,7 +25,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.olingo.commons.api.ODataErrorDetail;
import org.apache.olingo.commons.api.ex.ODataErrorDetail;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.server.api.OData;
import org.apache.olingo.server.api.ODataServerError;

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.tecsvc.async;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.server.api.ODataApplicationException;
import org.apache.olingo.server.api.ODataLibraryException;

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.tecsvc.async;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpStatusCode;

View File

@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.tecsvc.processor.queryoptions.options;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
public class SystemQueryOptionsRuntimeException extends ODataRuntimeException {

View File

@ -22,7 +22,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAction;
import org.apache.olingo.commons.api.edm.provider.CsdlParameter;

View File

@ -21,7 +21,7 @@ package org.apache.olingo.server.tecsvc.provider;
import java.util.ArrayList;
import java.util.Arrays;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;

View File

@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer;

View File

@ -22,7 +22,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;
import org.apache.olingo.commons.api.edm.provider.CsdlAction;

View File

@ -20,7 +20,7 @@ package org.apache.olingo.server.tecsvc.provider;
import java.util.Arrays;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;

View File

@ -20,7 +20,7 @@ package org.apache.olingo.server.tecsvc.provider;
import java.util.Arrays;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember;

View File

@ -23,7 +23,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlFunction;
import org.apache.olingo.commons.api.edm.provider.CsdlParameter;

View File

@ -21,7 +21,7 @@ package org.apache.olingo.server.tecsvc.provider;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.provider.CsdlAction;
import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;

View File

@ -33,7 +33,7 @@ import java.util.Collections;
import java.util.Locale;
import org.apache.commons.io.IOUtils;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;

View File

@ -24,7 +24,7 @@ import static org.junit.Assert.assertNotNull;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmEntityType;
import org.apache.olingo.commons.core.edm.EdmProviderImpl;

View File

@ -21,7 +21,7 @@ package org.apache.olingo.server.core.uri.testutil;
import java.util.Arrays;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;

View File

@ -30,7 +30,7 @@ import org.apache.http.impl.conn.BasicClientConnectionManager;
import org.apache.http.params.CoreProtocolPNames;
import org.apache.olingo.commons.api.http.HttpMethod;
import org.apache.olingo.client.core.http.AbstractHttpClientFactory;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
/**
* Shows how to customize the way how the underlying network socket are managed by the HTTP component; the specific

View File

@ -21,7 +21,7 @@ package org.apache.olingo.server.sample.data;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.EntityCollection;
import org.apache.olingo.commons.api.data.Property;

View File

@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.olingo.commons.api.ODataException;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;