[OLINGO-841] CleanUp Server API

This commit is contained in:
Christian Amend 2015-12-18 13:42:53 +01:00
parent d1055fd8ef
commit d4902f725b
158 changed files with 517 additions and 515 deletions

View File

@ -21,10 +21,10 @@ package org.apache.olingo.server.api;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveType; import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider;
import org.apache.olingo.commons.api.ex.ODataRuntimeException;
import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.server.api.debug.DebugResponseHelper; import org.apache.olingo.server.api.debug.DebugResponseHelper;
import org.apache.olingo.server.api.deserializer.DeserializerException; import org.apache.olingo.server.api.deserializer.DeserializerException;

View File

@ -226,7 +226,7 @@ public class ODataRequest {
* @param protocol * @param protocol
* @see #getProtocol() * @see #getProtocol()
*/ */
public void setProtocol(String protocol) { public void setProtocol(final String protocol) {
this.protocol = protocol; this.protocol = protocol;
} }

View File

@ -115,7 +115,6 @@ public class ODataResponse {
return values == null || values.isEmpty() ? null : values.get(0); return values == null || values.isEmpty() ? null : values.get(0);
} }
/** /**
* Sets the content (body). * Sets the content (body).
* @param content the content as {@link InputStream} * @param content the content as {@link InputStream}

View File

@ -28,8 +28,8 @@ import org.apache.olingo.server.api.deserializer.batch.ODataResponsePart;
* <p>Provides methods to process {@link ODataRequest}s and {@link BatchRequestPart}s * <p>Provides methods to process {@link ODataRequest}s and {@link BatchRequestPart}s
* in the context of a batch request.</p> * in the context of a batch request.</p>
* *
* <p>Within a {@link org.apache.olingo.server.api.processor.BatchProcessor BatchProcessor} * <p>Within a {@link org.apache.olingo.server.api.processor.BatchProcessor BatchProcessor} implementation
* implementation BatchRequestParts should be passed to {@link #handleBatchRequest(BatchRequestPart)}. * BatchRequestParts should be passed to {@link #handleBatchRequest(BatchRequestPart)}.
* Only if the BatchRequestPart represents a change set, the request will be delegated to * Only if the BatchRequestPart represents a change set, the request will be delegated to
* {@link org.apache.olingo.server.api.processor.BatchProcessor#processChangeSet(BatchFacade, java.util.List)}. * {@link org.apache.olingo.server.api.processor.BatchProcessor#processChangeSet(BatchFacade, java.util.List)}.
* Otherwise the requests will be directly executed.</p> * Otherwise the requests will be directly executed.</p>

View File

@ -46,7 +46,7 @@ public class DebugInformation {
return request; return request;
} }
public void setRequest(ODataRequest request) { public void setRequest(final ODataRequest request) {
this.request = request; this.request = request;
} }
@ -59,7 +59,7 @@ public class DebugInformation {
return applicationResponse; return applicationResponse;
} }
public void setApplicationResponse(ODataResponse applicationResponse) { public void setApplicationResponse(final ODataResponse applicationResponse) {
this.applicationResponse = applicationResponse; this.applicationResponse = applicationResponse;
} }
@ -72,7 +72,7 @@ public class DebugInformation {
return uriInfo; return uriInfo;
} }
public void setUriInfo(UriInfo uriInfo) { public void setUriInfo(final UriInfo uriInfo) {
this.uriInfo = uriInfo; this.uriInfo = uriInfo;
} }
@ -85,7 +85,7 @@ public class DebugInformation {
return exception; return exception;
} }
public void setException(Exception exception) { public void setException(final Exception exception) {
this.exception = exception; this.exception = exception;
} }
@ -98,7 +98,7 @@ public class DebugInformation {
return serverEnvironmentVariables; return serverEnvironmentVariables;
} }
public void setServerEnvironmentVariables(Map<String, String> serverEnvironmentVariables) { public void setServerEnvironmentVariables(final Map<String, String> serverEnvironmentVariables) {
this.serverEnvironmentVariables = serverEnvironmentVariables; this.serverEnvironmentVariables = serverEnvironmentVariables;
} }
@ -111,7 +111,7 @@ public class DebugInformation {
return runtimeInformation; return runtimeInformation;
} }
public void setRuntimeInformation(List<RuntimeMeasurement> runtimeInformation) { public void setRuntimeInformation(final List<RuntimeMeasurement> runtimeInformation) {
this.runtimeInformation = runtimeInformation; this.runtimeInformation = runtimeInformation;
} }

View File

@ -33,8 +33,7 @@ public interface DebugSupport {
/** /**
* Initializes the debug support implementation. * Initializes the debug support implementation.
* Is called before {@link #isUserAuthorized()} and * Is called before {@link #isUserAuthorized()} and {@link #createDebugResponse(String, DebugInformation)}.
* {@link #createDebugResponse(String, DebugInformation)}.
* @param odata * @param odata
*/ */
void init(OData odata); void init(OData odata);

View File

@ -29,7 +29,7 @@ public class DefaultDebugSupport implements DebugSupport {
private OData odata; private OData odata;
@Override @Override
public void init(OData odata) { public void init(final OData odata) {
this.odata = odata; this.odata = odata;
} }
@ -39,7 +39,7 @@ public class DefaultDebugSupport implements DebugSupport {
} }
@Override @Override
public ODataResponse createDebugResponse(String debugFormat, DebugInformation debugInfo) { public ODataResponse createDebugResponse(final String debugFormat, final DebugInformation debugInfo) {
// Check if debugFormat is supported by the library // Check if debugFormat is supported by the library
if (DebugSupport.ODATA_DEBUG_JSON.equalsIgnoreCase(debugFormat) if (DebugSupport.ODATA_DEBUG_JSON.equalsIgnoreCase(debugFormat)
|| DebugSupport.ODATA_DEBUG_HTML.equalsIgnoreCase(debugFormat) || DebugSupport.ODATA_DEBUG_HTML.equalsIgnoreCase(debugFormat)

View File

@ -35,7 +35,7 @@ public class RuntimeMeasurement {
* Sets the class name. * Sets the class name.
* @param className the name of the class that is measured * @param className the name of the class that is measured
*/ */
public void setClassName(String className) { public void setClassName(final String className) {
this.className = className; this.className = className;
} }
@ -51,7 +51,7 @@ public class RuntimeMeasurement {
* Sets the method name. * Sets the method name.
* @param methodName the name of the method that is measured * @param methodName the name of the method that is measured
*/ */
public void setMethodName(String methodName) { public void setMethodName(final String methodName) {
this.methodName = methodName; this.methodName = methodName;
} }
@ -68,7 +68,7 @@ public class RuntimeMeasurement {
* @param timeStarted the start time in nanoseconds * @param timeStarted the start time in nanoseconds
* @see System#nanoTime() * @see System#nanoTime()
*/ */
public void setTimeStarted(long timeStarted) { public void setTimeStarted(final long timeStarted) {
this.timeStarted = timeStarted; this.timeStarted = timeStarted;
} }
@ -86,7 +86,7 @@ public class RuntimeMeasurement {
* @param timeStopped the stop time in nanoseconds * @param timeStopped the stop time in nanoseconds
* @see System#nanoTime() * @see System#nanoTime()
*/ */
public void setTimeStopped(long timeStopped) { public void setTimeStopped(final long timeStopped) {
this.timeStopped = timeStopped; this.timeStopped = timeStopped;
} }

View File

@ -42,8 +42,8 @@ public interface ODataDeserializer {
DeserializerResult entity(InputStream stream, EdmEntityType edmEntityType) throws DeserializerException; DeserializerResult entity(InputStream stream, EdmEntityType edmEntityType) throws DeserializerException;
/** /**
* Deserializes an entity collection stream into an * Deserializes an entity collection stream into an {@link org.apache.olingo.commons.api.data.EntityCollection
* {@link org.apache.olingo.commons.api.data.EntityCollection EntityCollection} object. * EntityCollection} object.
* @param stream * @param stream
* @param edmEntityType * @param edmEntityType
* @return {@link DeserializerResult#getEntityCollection()} * @return {@link DeserializerResult#getEntityCollection()}

View File

@ -20,8 +20,8 @@ package org.apache.olingo.server.api.deserializer.batch;
/** /**
* Options for the batch deserializer. * Options for the batch deserializer.
* @see org.apache.olingo.server.api.deserializer.FixedFormatDeserializer * @see org.apache.olingo.server.api.deserializer.FixedFormatDeserializer #parseBatchRequest(java.io.InputStream,
* #parseBatchRequest(java.io.InputStream, String, BatchOptions) * String, BatchOptions)
*/ */
public final class BatchOptions { public final class BatchOptions {
private boolean isStrict = true; private boolean isStrict = true;

View File

@ -59,7 +59,10 @@ public interface Preferences {
/** Whether the preference <code>odata.track-changes</code> has been set. */ /** Whether the preference <code>odata.track-changes</code> has been set. */
public boolean hasTrackChanges(); public boolean hasTrackChanges();
public enum Return { REPRESENTATION, MINIMAL } public enum Return {
REPRESENTATION, MINIMAL
}
/** /**
* Gets the value of the preference <code>return</code> or <code>null</code> if not set * Gets the value of the preference <code>return</code> or <code>null</code> if not set
* or the value is not valid. * or the value is not valid.

View File

@ -70,7 +70,7 @@ public final class PreferencesApplied {
return result.toString(); return result.toString();
} }
private boolean isSafe(String key) { private boolean isSafe(final String key) {
if (SAFE_PREFERENCE_NAMES.isEmpty()) { if (SAFE_PREFERENCE_NAMES.isEmpty()) {
SAFE_PREFERENCE_NAMES.add(PreferenceName.ALLOW_ENTITY_REFERENCES.getName()); SAFE_PREFERENCE_NAMES.add(PreferenceName.ALLOW_ENTITY_REFERENCES.getName());
SAFE_PREFERENCE_NAMES.add(PreferenceName.CALLBACK.getName()); SAFE_PREFERENCE_NAMES.add(PreferenceName.CALLBACK.getName());

View File

@ -19,9 +19,9 @@
package org.apache.olingo.server.api.processor; package org.apache.olingo.server.api.processor;
import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.server.api.ODataServerError;
import org.apache.olingo.server.api.ODataRequest; import org.apache.olingo.server.api.ODataRequest;
import org.apache.olingo.server.api.ODataResponse; import org.apache.olingo.server.api.ODataResponse;
import org.apache.olingo.server.api.ODataServerError;
/** /**
* Processor which is called if any error/exception occurs inside the library or another processor. * Processor which is called if any error/exception occurs inside the library or another processor.

View File

@ -32,3 +32,4 @@
* in order to overwrite the default behavior. * in order to overwrite the default behavior.
*/ */
package org.apache.olingo.server.api.processor; package org.apache.olingo.server.api.processor;

View File

@ -18,7 +18,6 @@
*/ */
package org.apache.olingo.server.api.serializer; package org.apache.olingo.server.api.serializer;
/** /**
* Thrown for invalid batch payloads. * Thrown for invalid batch payloads.
*/ */

View File

@ -21,6 +21,7 @@ package org.apache.olingo.server.api.uri.queryoption.search;
public interface SearchUnary extends SearchExpression { public interface SearchUnary extends SearchExpression {
SearchUnaryOperatorKind getOperator(); SearchUnaryOperatorKind getOperator();
SearchTerm getOperand(); SearchTerm getOperand();
} }