Package org.apache.abdera.protocol.server

Examples of org.apache.abdera.protocol.server.Transactional


            return ProviderHelper.notfound(request);
        }

        WorkspaceManager wm = getWorkspaceManager(request);
        CollectionAdapter adapter = wm.getCollectionAdapter(request);
        Transactional transaction = adapter instanceof Transactional ? (Transactional) adapter : null;
        ResponseContext response = null;
        try {
            transactionStart(transaction, request);
            response = processor.process(request, wm, adapter);
            response = response != null ? response : processExtensionRequest(request, adapter);           
View Full Code Here


            return ProviderHelper.notfound(request);
        }

        WorkspaceManager wm = getWorkspaceManager(request);
        CollectionAdapter adapter = wm.getCollectionAdapter(request);
        Transactional transaction = adapter instanceof Transactional ? (Transactional)adapter : null;
        ResponseContext response = null;
        try {
            transactionStart(transaction, request);
            response = processor.process(request, wm, adapter);
            response = response != null ? response : processExtensionRequest(request, adapter);
View Full Code Here

            return ProviderHelper.notfound(request);
        }

        WorkspaceManager wm = getWorkspaceManager(request);
        CollectionAdapter adapter = wm.getCollectionAdapter(request);
        Transactional transaction = adapter instanceof Transactional ? (Transactional) adapter
                : null;
        ResponseContext response = null;
        try {
            transactionStart(transaction, request);
            response = processor.process(request, wm, adapter);
View Full Code Here

      if (adapter == null) {
        return ProviderHelper.notfound(
          request);
      }
     
      Transactional transaction =
        adapter instanceof Transactional ?
          (Transactional)adapter : null;
      ResponseContext response = null;
      try {
        if (transaction != null) transaction.start(request);
        if (type == TargetType.TYPE_CATEGORIES) {
          if (method.equalsIgnoreCase("GET"))
            response = adapter.getCategories(request);
        } else if (type == TargetType.TYPE_COLLECTION) {
          if (method.equalsIgnoreCase("GET"))
            response = adapter.getFeed(request);
          else if (method.equalsIgnoreCase("POST")) {
            response = ProviderHelper.isAtom(request) ?
              adapter.postEntry(request) :
              adapter instanceof MediaCollectionAdapter ?
                ((MediaCollectionAdapter)adapter).postMedia(request) :
                ProviderHelper.notsupported(request);
          }
        } else if (type == TargetType.TYPE_ENTRY) {
          if (method.equalsIgnoreCase("GET"))
            response = adapter.getEntry(request);
          else if (method.equalsIgnoreCase("PUT"))
            response = adapter.putEntry(request);
          else if (method.equalsIgnoreCase("DELETE"))
            response = adapter.deleteEntry(request);
          else if (method.equalsIgnoreCase("HEAD"))
            response = adapter.headEntry(request);
          else if (method.equalsIgnoreCase("OPTIONS"))
            response = adapter.optionsEntry(request);
        } else if (type == TargetType.TYPE_MEDIA) {
          if (adapter instanceof MediaCollectionAdapter) {
            MediaCollectionAdapter mcadapter =
              (MediaCollectionAdapter) adapter;
            if (method.equalsIgnoreCase("GET"))
              response = mcadapter.getMedia(request);
            else if (method.equalsIgnoreCase("PUT"))
              response = mcadapter.putMedia(request);
            else if (method.equalsIgnoreCase("DELETE"))
              response = mcadapter.deleteMedia(request);  
            else if (method.equalsIgnoreCase("HEAD"))
              response = mcadapter.headMedia(request);  
            else if (method.equalsIgnoreCase("OPTIONS"))
              response = mcadapter.optionsMedia(request);       
          } else {
            response = ProviderHelper.notsupported(request);
          }
        } else if (type == TargetType.TYPE_NOT_FOUND) {
          response = ProviderHelper.notfound(request);
        } else {
          response = adapter.extensionRequest(request);
        }
        if (response == null)
          response = ProviderHelper.notsupported(request);
        return response;
      } catch (Throwable e) {
        log.error(e);
        if (transaction != null)
          transaction.compensate(request,e);
        response = ProviderHelper.servererror(request, e);
        return response;
      } finally {
        if (transaction != null)
          transaction.end(request, response);
      }
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.server.Transactional

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.