/*
* Copyright (C) 2005-2012 BetaCONCEPT Limited
*
* This file is part of Astroboa.
*
* Astroboa is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Astroboa is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Astroboa. If not, see <http://www.gnu.org/licenses/>.
*/
package org.betaconceptframework.astroboa.api.service.secure;
import java.util.concurrent.Future;
import org.betaconceptframework.astroboa.api.model.io.SerializationConfiguration;
import org.betaconceptframework.astroboa.api.model.io.SerializationReport;
import org.betaconceptframework.astroboa.api.model.query.criteria.ContentObjectCriteria;
import org.betaconceptframework.astroboa.api.security.AstroboaCredentials;
import org.betaconceptframework.astroboa.api.security.CmsRole;
import org.betaconceptframework.astroboa.api.service.SerializationService;
/**
* Secure Serialization Service API.
*
* <p>
* It contains the same methods provided by
* {@link SerializationService} with the addition that each method requires
* an authentication token as an extra parameter, in order to ensure
* that client has been successfully logged in an Astroboa repository and
* therefore has been granted access to further use Astroboa services
* </p>
*
* @author Gregory Chomatas (gchomatas@betaconcept.com)
* @author Savvas Triantafyllou (striantafyllou@betaconcept.com)
*
*/
public interface SerializationServiceSecure {
/**
* Same semantics with {@link SerializationService#serializeContentObjects()}
* augmented with the requirement of providing an authentication token.
*
*<p>
* This method is executed only if user has role
* {@link CmsRole#ROLE_ADMIN} upon connected Astroboa repository.
* Information about user's roles is available through provided authentication
* token.
*</p>
*
* @param objectCriteria Criteria to control which objects to serialize
* @param serializationConfiguration Configuration to control various aspects of the export process
* @param authenticationToken A token provided during client login ({@link RepositoryServiceSecure#login(String, AstroboaCredentials, String)}) to an Astroboa repository.
*
* @return A report about serialization progress.
*/
Future<SerializationReport> serializeObjects(ContentObjectCriteria objectCriteria, SerializationConfiguration serializationConfiguration, String authenticationToken);
/**
* Same semantics with {@link SerializationService#serializeRepository()}
* augmented with the requirement of providing an authentication token.
*
*<p>
* This method is executed only if user has role
* {@link CmsRole#ROLE_ADMIN} upon connected Astroboa repository.
* Information about user's roles is available through provided authentication
* token.
*</p>
*
* @param serializeBinaryContent <code>true</code> to serialize binary content, i.e. serialize binary properties,
* <code>false</code> otherwise.
* @param authenticationToken A token provided during client login ({@link RepositoryServiceSecure#login(String, AstroboaCredentials, String)}) to an Astroboa repository.
*
* @return A report about serialization progress.
*/
Future<SerializationReport> serializeRepository(SerializationConfiguration serializationConfiguration, String authenticationToken);
/**
* Same semantics with {@link SerializationService#serializeRepositoryUsers()}
* augmented with the requirement of providing an authentication token.
*
*<p>
* This method is executed only if user has role
* {@link CmsRole#ROLE_ADMIN} upon connected Astroboa repository.
* Information about user's roles is available through provided authentication
* token.
*</p>
*
* @param authenticationToken A token provided during client login ({@link RepositoryServiceSecure#login(String, AstroboaCredentials, String)}) to an Astroboa repository.
*
* @return A report about serialization progress.
*/
Future<SerializationReport> serializeRepositoryUsers(String authenticationToken);
/**
* Same semantics with {@link SerializationService#serializeTaxonomies()}
* augmented with the requirement of providing an authentication token.
*
*<p>
* This method is executed only if user has role
* {@link CmsRole#ROLE_ADMIN} upon connected Astroboa repository.
* Information about user's roles is available through provided authentication
* token.
*</p>
*
* @param authenticationToken A token provided during client login ({@link RepositoryServiceSecure#login(String, AstroboaCredentials, String)}) to an Astroboa repository.
*
* @return A report about serialization progress.
*/
Future<SerializationReport> serializeTaxonomies(String authenticationToken);
/**
* Same semantics with {@link SerializationService#serializeOrganizationSpace()}
* augmented with the requirement of providing an authentication token.
*
*<p>
* This method is executed only if user has role
* {@link CmsRole#ROLE_ADMIN} upon connected Astroboa repository.
* Information about user's roles is available through provided authentication
* token.
*</p>
*
* @param authenticationToken A token provided during client login ({@link RepositoryServiceSecure#login(String, AstroboaCredentials, String)}) to an Astroboa repository.
*
* @return A report about serialization progress.
*/
Future<SerializationReport> serializeOrganizationSpace(String authenticationToken);
}