Package org.gatein.management.api

Examples of org.gatein.management.api.PathAddress


      // Validate request
      Response response = validateRequest(request);
      if (response != null) return response;

      String operationName = request.getOperationName();
      PathAddress address = request.getAddress();
      try
      {
         ManagedResponse resp = controller.execute(request);
         if (resp == null)
         {
View Full Code Here


               resolveLinks(mo.get(name), uriInfo);
            }
            break;
         case REFERENCE:
            ModelReference ref = value.asValue(ModelReference.class);
            PathAddress address = ref.getValue();
            ref.remove("_ref");
            LinkBuilder linkBuilder = new LinkBuilder(uriInfo.getBaseUriBuilder());
            linkBuilder.path(RestApplication.API_ENTRY_POINT).path(address.toString());
            ref.get("url").set(linkBuilder.build().getHref());
            break;
         case LIST:
            for (ModelValue mv : value.asValue(ModelList.class))
            {
View Full Code Here

         path = path.substring(0, path.lastIndexOf(".zip"));
         operationName = OperationNames.EXPORT_RESOURCE;
         contentType = ContentType.ZIP;
      }

      PathAddress address = PathAddress.pathAddress(path);
      if (contentType == null)
      {
         contentType = ContentType.JSON; // default to JSON
      }
View Full Code Here

public abstract class AbstractMopOperationHandler implements OperationHandler {
    @Override
    public final void execute(OperationContext operationContext, ResultHandler resultHandler) throws ResourceNotFoundException,
            OperationException {
        String operationName = operationContext.getOperationName();
        PathAddress address = operationContext.getAddress();

        String siteType = address.resolvePathTemplate("site-type");
        if (siteType == null)
            throw new OperationException(operationName, "Site type was not specified.");

        ObjectType<Site> objectType = Utils.getObjectType(Utils.getSiteType(siteType));
        if (objectType == null) {
View Full Code Here

    protected void execute(OperationContext operationContext, ResultHandler resultHandler, PathTemplateFilter filter) {
        BindingProvider bindingProvider = operationContext.getBindingProvider();
        Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

        final ManagedResource resource = operationContext.getManagedResource();
        final PathAddress address = operationContext.getAddress();
        final String operationName = operationContext.getOperationName();

        StepResultHandler<PageNavigation> stepResultHandler = new StepResultHandler<PageNavigation>(address) {
            @Override
            public void failed(String failureDescription) {
                if (address.equals(getCurrentAddress())) {
                    throw new OperationException(operationName, "Navigation export failed. Reason: " + failureDescription);
                } else {
                    throw new OperationException(operationName, "Navigation export failed. Reason: " + failureDescription
                            + " [Step Address: " + getCurrentAddress() + "]");
                }
View Full Code Here

                throw new RuntimeException("Was expecting " + ReadResourceModel.class + " to be returned for operation "
                        + OperationNames.READ_RESOURCE + " at address " + address);
            }

            for (String child : ((ReadResourceModel) model).getChildren()) {
                final PathAddress childAddress = address.append(child);
                OperationContext childContext = new OperationContextDelegate(operationContext) {
                    @Override
                    public PathAddress getAddress() {
                        return childAddress;
                    }
View Full Code Here

    protected void execute(OperationContext operationContext, ResultHandler resultHandler, PathTemplateFilter filter) {
        BindingProvider bindingProvider = operationContext.getBindingProvider();
        Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

        final ManagedResource resource = operationContext.getManagedResource();
        final PathAddress address = operationContext.getAddress();
        final String operationName = operationContext.getOperationName();

        StepResultHandler<PageNavigation> stepResultHandler = new StepResultHandler<PageNavigation>(address) {
            @Override
            public void failed(String failureDescription) {
                if (address.equals(getCurrentAddress())) {
                    throw new OperationException(operationName, "Navigation export failed. Reason: " + failureDescription);
                } else {
                    throw new OperationException(operationName, "Navigation export failed. Reason: " + failureDescription
                            + " [Step Address: " + getCurrentAddress() + "]");
                }
View Full Code Here

                throw new RuntimeException("Was expecting " + ReadResourceModel.class + " to be returned for operation "
                        + OperationNames.READ_RESOURCE + " at address " + address);
            }

            for (String child : ((ReadResourceModel) model).getChildren()) {
                final PathAddress childAddress = address.append(child);
                OperationContext childContext = new OperationContextDelegate(operationContext) {
                    @Override
                    public PathAddress getAddress() {
                        return childAddress;
                    }
View Full Code Here

public abstract class AbstractMopOperationHandler extends SecureOperationHandler implements OperationHandler {
    @Override
    public final void doExecute(OperationContext operationContext, ResultHandler resultHandler) throws ResourceNotFoundException,
            OperationException {
        String operationName = operationContext.getOperationName();
        PathAddress address = operationContext.getAddress();

        String siteType = address.resolvePathTemplate("site-type");
        if (siteType == null)
            throw new OperationException(operationName, "Site type was not specified.");

        ObjectType<Site> objectType = Utils.getObjectType(Utils.getSiteType(siteType));
        if (objectType == null) {
View Full Code Here

public abstract class AbstractSiteOperationHandler extends AbstractMopOperationHandler {
    @Override
    protected final void execute(OperationContext operationContext, ResultHandler resultHandler, Workspace workspace,
            ObjectType<Site> siteType) throws ResourceNotFoundException, OperationException {
        String operationName = operationContext.getOperationName();
        PathAddress address = operationContext.getAddress();

        String siteName = address.resolvePathTemplate("site-name");
        if (siteName == null)
            throw new OperationException(operationName, "No site name specified.");

        SiteKey siteKey = getSiteKey(siteType, siteName);
View Full Code Here

TOP

Related Classes of org.gatein.management.api.PathAddress

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.