// project exists ? if yes return
String projectKey = new Project.KeyBuilder().withProjectId( projectMetadata.getId() ).withNamespace(
new Namespace( projectMetadata.getNamespace(), new Repository( repositoryId ) ) ).build();
Project project = getProjectEntityManager().get( projectKey );
if ( project != null )
{
return;
}
String namespaceKey = new Namespace.KeyBuilder().withRepositoryId( repositoryId ).withNamespace(
projectMetadata.getNamespace() ).build();
Namespace namespace = getNamespaceEntityManager().get( namespaceKey );
if ( namespace == null )
{
namespace = updateOrAddNamespace( repositoryId, projectMetadata.getNamespace() );
}
project = new Project( projectKey, projectMetadata.getId(), namespace );
try
{
getProjectEntityManager().put( project );
}