Package org.wso2.carbon.registry.core.config

Examples of org.wso2.carbon.registry.core.config.RegistryContext$RegURLSupplier


* /projects/ids/config.xml;ratings:foo
*/
public class RatingURLHandler extends Handler {

    public Resource get(RequestContext requestContext) throws RegistryException {
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (registryContext == null) {
            registryContext = RegistryContext.getBaseInstance();
        }
        ResourceDAO resourceDAO = registryContext.getDataAccessManager().getDAOManager().
                getResourceDAO();
        RatingsDAO ratingsDAO = registryContext.getDataAccessManager().getDAOManager().
                getRatingsDAO(StaticConfiguration.isVersioningRatings());

        ResourcePath resourcePath = requestContext.getResourcePath();

        String ratedUserName = resourcePath.getParameterValue("ratings");
View Full Code Here


public class CommentURLHandler extends Handler {

    private static final Log log = LogFactory.getLog(CommentURLHandler.class);

    public Resource get(RequestContext requestContext) throws RegistryException {
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (registryContext == null) {
            registryContext = RegistryContext.getBaseInstance();
        }
        CommentsDAO commentsDAO = registryContext.getDataAccessManager().getDAOManager().
                getCommentsDAO(StaticConfiguration.isVersioningComments());
        ResourcePath resourcePath = requestContext.getResourcePath();

        String commentID = resourcePath.getParameterValue("comments");
        if (commentID != null) {
View Full Code Here

        return null;
    }

    public void delete(RequestContext requestContext) throws RegistryException {
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (registryContext == null) {
            registryContext = RegistryContext.getBaseInstance();
        }
        CommentsDAO commentsDAO = registryContext.getDataAccessManager().getDAOManager().
                getCommentsDAO(StaticConfiguration.isVersioningComments());
        requestContext.setProcessingComplete(false);
        ResourcePath resourcePath = requestContext.getResourcePath();

        String commentID = resourcePath.getParameterValue("comments");
View Full Code Here

     * @param abdera the abdera instance.
     *
     * @throws Exception if an exception occurs.
     */
    public RegistryProvider(Abdera abdera) throws Exception {
        RegistryContext context = RegistryContext.getBaseInstance();
        if (context == null) {

            String msg = "Registry is not properly initialized. Registry context is not found.";
            log.error(msg);
            throw new RegistryException(msg);

            //InputStream is = null;
            //try {
            //    is = new FileInputStream("registry.xml");
            //} catch (FileNotFoundException e) {
            //    // no problem
            //}
            //context = new RegistryContext(is);
            //RegistryContext.setSingleton(context);
        }
        TargetType[] types = {RegistryResolver.TAGS_TYPE, RegistryResolver.LOGS_TYPE,
                RegistryResolver.RATINGS_TYPE, RegistryResolver.COMMENTS_TYPE,
                RegistryResolver.RENAME_TYPE, RegistryResolver.COPY_TYPE,
                RegistryResolver.MOVE_TYPE, RegistryResolver.TAG_URL_TYPE,
                RegistryResolver.ASSOCIATIONS_TYPE, RegistryResolver.RESTORE_TYPE,
                RegistryResolver.VERSIONS_TYPE, RegistryResolver.CHECKPOINT_TYPE,
                RegistryResolver.QUERY_TYPE, RegistryResolver.IMPORT_TYPE,
                RegistryResolver.DUMP_TYPE, RegistryResolver.COLLECTION_CUSTOM_TYPE,
                RegistryResolver.DELETE_TYPE, RegistryResolver.ASPECT_TYPE,
                ResponseTarget.RESPONSE_TYPE};
        RequestProcessor processor = new RegistryRequestProcessor();
        for (TargetType type : types) {
            this.requestProcessors.put(type, processor);
        }

        EmbeddedRegistryService embeddedRegistryService;
        try {
            embeddedRegistryService = Utils.getEmbeddedRegistryService();
        } catch (RegistryException e) {
            embeddedRegistryService = context.getEmbeddedRegistryService();
        }

        RegistryResolver resolver = new RegistryResolver(embeddedRegistryService, BASE_CONTEXT);
        adapter = new RegistryAdapter();

View Full Code Here

* /projects/ids/config.xml;tags:foo:bar
*/
public class TagURLHandler extends Handler {

    public Resource get(RequestContext requestContext) throws RegistryException {
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (registryContext == null) {
            registryContext = RegistryContext.getBaseInstance();
        }
        ResourceDAO resourceDAO = registryContext.getDataAccessManager().getDAOManager().
                getResourceDAO();
        TagsDAO tagsDAO = registryContext.getDataAccessManager().getDAOManager().
                getTagsDAO(StaticConfiguration.isVersioningTags());

        ResourcePath resourcePath = requestContext.getResourcePath();

        String tagDetails = resourcePath.getParameterValue("tags");
View Full Code Here

*/
@Deprecated
public class TagCollectionURLHandler extends Handler {

    public Resource get(RequestContext requestContext) throws RegistryException {
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (registryContext == null) {
            registryContext = RegistryContext.getBaseInstance();
        }
        ResourceDAO resourceDAO = registryContext.getDataAccessManager().getDAOManager().
                getResourceDAO();
        TagsDAO tagsDAO = registryContext.getDataAccessManager().getDAOManager().
                getTagsDAO(StaticConfiguration.isVersioningTags());

        ResourcePath resourcePath = requestContext.getResourcePath();

        if (resourcePath.parameterExists("tags") &&
View Full Code Here

    }

    public void delete(RequestContext requestContext) throws RegistryException {
        registerHandler(requestContext.getSystemRegistry());
        String fullPath = requestContext.getResourcePath().getPath();
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (fullPath.equals(this.mountPoint)) {
            requestContext.getRegistry().removeLink(fullPath);
            if (registryContext != null) {
                HandlerManager hm = registryContext.getHandlerManager();
                hm.removeHandler(this,
                        HandlerLifecycleManager.TENANT_SPECIFIC_SYSTEM_HANDLER_PHASE);
            }
        } else {
            String subPath = fullPath.substring(this.mountPoint.length(), fullPath.length());
View Full Code Here

    public String rename(RequestContext requestContext) throws RegistryException {
        registerHandler(requestContext.getSystemRegistry());
        String fullResourcePath = requestContext.getSourcePath();
        String fullTargetPath = requestContext.getTargetPath();
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (fullResourcePath.equals(this.mountPoint)) {
            requestContext.getRegistry().removeLink(this.mountPoint);
            if (registryContext != null) {
                HandlerManager hm = registryContext.getHandlerManager();
                hm.removeHandler(this,
                        HandlerLifecycleManager.TENANT_SPECIFIC_SYSTEM_HANDLER_PHASE);
            }
            requestContext.getRegistry().createLink(fullTargetPath, this.targetPoint);
        } else {
View Full Code Here

    public String move(RequestContext requestContext) throws RegistryException {
        registerHandler(requestContext.getSystemRegistry());
        String fullResourcePath = requestContext.getSourcePath();
        String fullTargetPath = requestContext.getTargetPath();
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (fullResourcePath.equals(this.mountPoint)) {
            requestContext.getRegistry().removeLink(this.mountPoint);
            if (registryContext != null) {
                HandlerManager hm = registryContext.getHandlerManager();
                hm.removeHandler(this,
                        HandlerLifecycleManager.TENANT_SPECIFIC_SYSTEM_HANDLER_PHASE);
            }
            requestContext.getRegistry().createLink(fullTargetPath, this.targetPoint);
        } else if (fullResourcePath.startsWith(this.mountPoint)) {
View Full Code Here

* Handles paths of the form <b>pure resource path</b>;ratings e.g. /projects/ids/config.xml;ratings
*/
public class RatingCollectionURLHandler extends Handler {

    public Resource get(RequestContext requestContext) throws RegistryException {
        RegistryContext registryContext = requestContext.getRegistryContext();
        if (registryContext == null) {
            registryContext = RegistryContext.getBaseInstance();
        }

        ResourceDAO resourceDAO = registryContext.getDataAccessManager().getDAOManager().
                getResourceDAO();
        RatingsDAO ratingsDAO = registryContext.getDataAccessManager().getDAOManager().
                getRatingsDAO(StaticConfiguration.isVersioningRatings());

        ResourcePath resourcePath = requestContext.getResourcePath();

        if (resourcePath.parameterExists("ratings") &&
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.config.RegistryContext$RegURLSupplier

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.