Package org.apache.wookie.exceptions

Examples of org.apache.wookie.exceptions.UnauthorizedAccessException


     if (instance == null){
       throw new ResourceNotFoundException();
     } else {
       // Check the API key matches
       String apiKey = request.getParameter("api_key");
       if (!instance.getApiKey().equals(apiKey)) throw new UnauthorizedAccessException();
       // Return the response XML
       checkProxy(request);
       String url = getUrl(request, instance);
       String locale = request.getParameter("locale");//$NON-NLS-1$
       response.setContentType(CONTENT_TYPE);
View Full Code Here


 
  // Implementation
 
  @Override
  public void show(String resourceId,HttpServletRequest request, HttpServletResponse response) throws UnauthorizedAccessException,ResourceNotFoundException, IOException{
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new ResourceNotFoundException();
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IParticipant[] participants = persistenceManager.findParticipants(instance);
    returnXml(ParticipantHelper.createXMLParticipantsDocument(participants), response);
View Full Code Here

   * @throws UnauthorizedAccessException
   */
  public static boolean create(HttpServletRequest request)
      throws ResourceDuplicationException, InvalidParametersException,
      UnauthorizedAccessException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();

    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
   
    HttpSession session = request.getSession(true);           
View Full Code Here

    return remove(request);
  }
  public static boolean remove(HttpServletRequest request)
      throws ResourceNotFoundException, UnauthorizedAccessException,
      InvalidParametersException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    HttpSession session = request.getSession(true);           
    String participantId = request.getParameter("participant_id"); //$NON-NLS-1$
    if(removeParticipantFromWidgetInstance(instance, participantId)){
View Full Code Here

  @Override
  protected void show(String resourceId, HttpServletRequest request,
      HttpServletResponse response) throws ResourceNotFoundException,
      UnauthorizedAccessException, IOException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new ResourceNotFoundException();
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    if (name == null || name.trim().equals("")) throw new ResourceNotFoundException();
    String value = null;
View Full Code Here

  }

  @Override
  protected boolean remove(String resourceId, HttpServletRequest request)
      throws ResourceNotFoundException,UnauthorizedAccessException,InvalidParametersException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    if (request.getParameter("value") != null) throw new InvalidParametersException();//$NON-NLS-1$
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    if (name == null || name.trim().equals("")) throw new InvalidParametersException();
View Full Code Here

   * @throws InvalidParametersException
   * @throws UnauthorizedAccessException
   */
  public static void createOrUpdate(HttpServletRequest request)
  throws InvalidParametersException,UnauthorizedAccessException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    String value = request.getParameter("propertyvalue"); //$NON-NLS-1$
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    if (name == null || name.trim().equals("")) throw new InvalidParametersException();
View Full Code Here

     if (instance == null){
       throw new ResourceNotFoundException();
     } else {
       // Check the API key matches
       String apiKey = request.getParameter("api_key");
       if (!instance.getApiKey().equals(apiKey)) throw new UnauthorizedAccessException();
       // Return the response XML
       checkProxy(request);
       String url = getUrl(request, instance);
       String locale = request.getParameter("locale");//$NON-NLS-1$
       response.setContentType(CONTENT_TYPE);
View Full Code Here

  @Override
  protected void update(String resourceId, HttpServletRequest request)
  throws ResourceNotFoundException, InvalidParametersException,
  UnauthorizedAccessException {
    if (!WidgetKeyManager.isValidRequest(request))
      throw new UnauthorizedAccessException();
    String requestId = request.getParameter("requestid"); //$NON-NLS-1$
    if (requestId == null || requestId.equals(""))
      throw new InvalidParametersException();
    if(requestId.equals("stopwidget")){ //$NON-NLS-1$
      doStopWidget(request);
View Full Code Here

   * @return the URL for the flatpack
   * @throws UnauthorizedAccessException if there is no valid API key supplied
   * @throws InvalidParametersException if there is no valid widget instance
   */
  private String createFlatpack(HttpServletRequest request) throws UnauthorizedAccessException, InvalidParametersException{
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    String path;
    try {
        //
        // Construct a FlatpackFactory for the instance identified in the request
        // If no instance can be found, throw an exception
View Full Code Here

TOP

Related Classes of org.apache.wookie.exceptions.UnauthorizedAccessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.