package com.orangerhymelabs.orangedb.cassandra.database;

import java.util.List;

import com.orangerhymelabs.orangedb.persistence.Identifier;
import com.orangerhymelabs.orangedb.persistence.ResultCallback;
import com.strategicgains.syntaxe.ValidationEngine;

public class DatabaseService
{
	private DatabaseRepository databases;
	
	public DatabaseService(DatabaseRepository databaseRepository)
	{
		super();
		this.databases = databaseRepository;
	}

	public void create(Database entity, ResultCallback<Database> callback)
	{
		ValidationEngine.validateAndThrow(entity);
		databases.create(entity, callback);
	}

	public void read(String name, ResultCallback<Database> callback)
	{
		databases.read(new Identifier(name), callback);
	}

	public void readAll(ResultCallback<List<Database>> callback)
	{
		databases.readAll(callback);
	}

	public void update(Database entity, ResultCallback<Database> callback)
    {
		ValidationEngine.validateAndThrow(entity);
		databases.update(entity, callback);
    }

	public void delete(String name, ResultCallback<Database> callback)
    {
		databases.delete(new Identifier(name), callback);
    }
}

@@ -582,16 +582,21 @@
 s.create
+Async
 (entity,
@@ -599,32 +599,32 @@
 ity, callback);%0A
-
 %09%7D%0A%0A%09public void
@@ -696,16 +696,21 @@
 ses.read
+Async
 (new Ide
@@ -823,16 +823,21 @@
 .readAll
+Async
 (callbac
@@ -985,16 +985,21 @@
 s.update
+Async
 (entity,
@@ -1091,16 +1091,16 @@
 )%0A    %7B%0A
-
 %09%09databa
@@ -1109,16 +1109,21 @@
 s.delete
+Async
 (new Ide

Fix some compile issues in DatabaseService.