//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// This file is a part of the 'esoco-business' project.
// Copyright 2017 Elmar Sonnenschein, esoco GmbH, Flensburg, Germany
//
// Licensed 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.
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
package de.esoco.entity;

import de.esoco.lib.comm.Connection;
import de.esoco.lib.comm.HttpEndpoint;
import de.esoco.lib.comm.http.HttpRequestMethod;

import static de.esoco.lib.comm.CommunicationRelationTypes.HTTP_STATUS_CODE;
import static de.esoco.lib.expression.Functions.identity;


/********************************************************************
 * The HTTP endpoint for interaction with the {@link EntitySyncService} REST
 * service.
 *
 * @author eso
 */
public class EntitySyncEndpoint extends HttpEndpoint
{
	//~ Inner Classes ----------------------------------------------------------

	/********************************************************************
	 * The base class for request methods to the {@link EntitySyncEndpoint}.
	 *
	 * @author eso
	 */
	public static class EntitySyncRequest extends HttpRequest<String, String>
	{
		//~ Constructors -------------------------------------------------------

		/***************************************
		 * Creates a new instance.
		 *
		 * @param sMethodName The name of the request method
		 */
		public EntitySyncRequest(String sMethodName)
		{
			super(sMethodName,
				  null,
				  HttpRequestMethod.POST,
				  "/api/sync/",
				  identity(),
				  identity());
		}

		//~ Methods ------------------------------------------------------------

		/***************************************
		 * @see HttpRequest#processResponse(Connection, String)
		 */
		@Override
		protected String processResponse(
			Connection rConnection,
			String	   sRawResponse)
		{
			return rConnection.get(HTTP_STATUS_CODE).toString();
		}
	}
}

@@ -862,45 +862,8 @@
 y;%0A%0A
-import de.esoco.lib.comm.Connection;%0A
 impo
@@ -951,85 +951,8 @@
 d;%0A%0A
-import static de.esoco.lib.comm.CommunicationRelationTypes.HTTP_STATUS_CODE;%0A
 impo
@@ -1243,16 +1243,649 @@
 point%0A%7B%0A
+%09//~ Static methods ---------------------------------------------------------%0A%0A%09/***************************************%0A%09 * Returns a request method that will lock an entity with a certain global%0A%09 * ID.%0A%09 *%0A%09 * @return The request method%0A%09 */%0A%09public static EntitySyncRequest lockEntity()%0A%09%7B%0A%09%09return new EntitySyncRequest(%22request_lock%22);%0A%09%7D%0A%0A%09/***************************************%0A%09 * Returns a request method that will release a lock on an entity with a%0A%09 * certain global ID.%0A%09 *%0A%09 * @return The request method%0A%09 */%0A%09public static EntitySyncRequest releaseEntityLock()%0A%09%7B%0A%09%09return new EntitySyncRequest(%22release_lock%22);%0A%09%7D%0A%0A
 %09//~ Inn
@@ -2368,16 +2368,28 @@
  @param 
+sRequestUrl 
 sMethodN
@@ -2464,26 +2464,26 @@
 String s
-MethodName
+RequestUrl
 )%0A%09%09%7B%0A%09%09
@@ -2490,26 +2490,26 @@
 %09super(s
-MethodName
+RequestUrl
 ,%0A%09%09%09%09  
@@ -2562,16 +2562,30 @@
 i/sync/%22
+ + sRequestUrl
 ,%0A%09%09%09%09  
@@ -2616,358 +2616,8 @@
 ty()
-);%0A%09%09%7D%0A%0A%09%09//~ Methods ------------------------------------------------------------%0A%0A%09%09/***************************************%0A%09%09 * @see HttpRequest#processResponse(Connection, String)%0A%09%09 */%0A%09%09@Override%0A%09%09protected String processResponse(%0A%09%09%09Connection rConnection,%0A%09%09%09String%09   sRawResponse)%0A%09%09%7B%0A%09%09%09return rConnection.get(HTTP_STATUS_CODE).toString(
 );%0A%09

Implement an entity modification synchronization service