Package org.rhq.core.clientapi.server.content

Examples of org.rhq.core.clientapi.server.content.ContentServerService


                }
            }
        }

        // Contact the server service if one exists
        ContentServerService serverService = contentManager.getContentServerService();
        if (serverService != null) {
            serverService.completeDeletePackageRequest(response);
        }
    }
View Full Code Here


    @Override
    public long downloadPackageBitsForChildResource(ContentContext context, String childResourceTypeName,
        PackageDetailsKey key, OutputStream outputStream) {

        ContentContextImpl contextImpl = (ContentContextImpl) context;
        ContentServerService serverService = getContentServerService();
        outputStream = remoteOutputStream(outputStream);

        long count = serverService.downloadPackageBitsForChildResource(contextImpl.getResourceId(),
            childResourceTypeName, key, outputStream);

        return count;
    }
View Full Code Here

    @Override
    public long downloadPackageBits(ContentContext context, PackageDetailsKey packageDetailsKey,
        OutputStream outputStream, boolean resourceExists) {
        ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be of this type, we gave it to the plugin
        ContentServerService serverService = getContentServerService();

        // we need to load the content to server before we will start download the content
        // it is because of timeout on remoteStreams
        serverService.preLoadRemoteContent(contextImpl.getResourceId(), packageDetailsKey);

        outputStream = remoteOutputStream(outputStream);
        long count = 0;
        if (resourceExists) {
            count = serverService.downloadPackageBitsGivenResource(contextImpl.getResourceId(), packageDetailsKey,
                outputStream);
        } else {
            // TODO: Figure out how to support this; the APIs require the resource to get the bits
        }
        return count;
View Full Code Here

    @Override
    public long downloadPackageBitsRange(ContentContext context, PackageDetailsKey packageDetailsKey,
        OutputStream outputStream, long startByte, long endByte, boolean resourceExists) {
        ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be of this type, we gave it to the plugin
        ContentServerService serverService = getContentServerService();
        outputStream = remoteOutputStream(outputStream);
        long count = 0;
        if (resourceExists) {
            count = serverService.downloadPackageBitsRangeGivenResource(contextImpl.getResourceId(), packageDetailsKey,
                outputStream, startByte, endByte);
        } else {
            // TODO: Figure out how to support this; the APIs require the resource to get the bits
        }
        return count;
View Full Code Here

    }

    @Override
    public long getPackageBitsLength(ContentContext context, PackageDetailsKey packageDetailsKey) {
        ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be of this type, we gave it to the plugin
        ContentServerService serverService = getContentServerService();
        long size = serverService.getPackageBitsLength(contextImpl.getResourceId(), packageDetailsKey);
        return size;
    }
View Full Code Here

    }

    @Override
    public PageList<PackageVersionMetadataComposite> getPackageVersionMetadata(ContentContext context, PageControl pc) {
        ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be of this type, we gave it to the plugin
        ContentServerService serverService = getContentServerService();
        PageList<PackageVersionMetadataComposite> metadata = serverService.getPackageVersionMetadata(contextImpl
            .getResourceId(), pc);
        return metadata;
    }
View Full Code Here

    }

    @Override
    public String getResourceSubscriptionMD5(ContentContext context) {
        ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be of this type, we gave it to the plugin
        ContentServerService serverService = getContentServerService();
        String metadataMD5 = serverService.getResourceSubscriptionMD5(contextImpl.getResourceId());
        return metadataMD5;
    }
View Full Code Here

     * Returns the server handle to use to complete requests.
     *
     * @return server service implementation if one is registered; <code>null</code> otherwise
     */
    ContentServerService getContentServerService() {
        ContentServerService serverService = null;
        ServerServices serverServices = configuration.getServerServices();
        if (serverServices != null) {
            serverService = serverServices.getContentServerService();
        }
        return serverService;
View Full Code Here

        // Package and send to server
        ContentDiscoveryReport report = new ContentDiscoveryReport();
        report.addAllDeployedPackages(existingInstalledPackagesSet);
        report.setResourceId(resourceId);

        ContentServerService contentServerService = getContentServerService();
        if (contentServerService != null) {
            // if there are 1+ installed packages to report OR there are 0 but there used to be packages installed,
            // then send up the report to be merged
            if (!existingInstalledPackagesSet.isEmpty() || originalPackageCount != 0) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Merging [" + existingInstalledPackagesSet.size()
                        + "] discovered packages for resource id [" + resourceId + "] with Server");
                }
                contentServerService.mergeDiscoveredPackages(report);
            }
        }

        return report;
    }
View Full Code Here

                }
            }
        }

        // Contact the server service if one exists
        ContentServerService serverService = contentManager.getContentServerService();
        if (serverService != null) {
            serverService.completeDeployPackageRequest(response);
        }

        // Trigger a resource discovery to pick up on any potential changes to the resource that occurred by
        // this package deployment
        if (response.getOverallRequestResult() == ContentResponseResult.SUCCESS) {
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.server.content.ContentServerService

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.