/*
 * Copyright 2006 Web Cohesion
 *
 * 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 com.ifyouwannabecool.api;

import com.ifyouwannabecool.domain.persona.Persona;

import javax.jws.WebService;
import java.util.Collection;

import org.codehaus.enunciate.rest.annotations.*;

/**
 * The persona services is used to perform actions on the data associated with a persona.
 *
 @author Ryan Heaton
 */
@WebService
@RESTEndpoint
public interface PersonaService {

  /**
   * Reads a persona.
   *
   @param personaId The id of the persona to read.
   @return The persona.
   */
  @Verb VerbType.read )
  @Noun "persona" )
  Persona readPersona(@ProperNoun String personaId);

  /**
   * Reads a set of personas.
   *
   @param personaIds The ids of the personas.
   @return The personas.
   */
  Collection<Persona> readPersonas(String... personaIds);

  /**
   * Store a persona.
   *
   @param persona The persona to store.
   */
  void storePersona(Persona persona);

  /**
   * Delete a persona.
   *
   @param personaId The id of the persona to delete.
   @return Whether the persona was successfully deleted.
   @throws PermissionDeniedException If you don't have permission to delete the persona.
   */
  boolean deletePersona(String personaIdthrows PermissionDeniedException;

}