Package org.cedj.geekseek.web.rest.core

Examples of org.cedj.geekseek.web.rest.core.ResourceMetadata$NamedRelation


    }

    @PostConstruct
    public void initialize() {
        for(MetadataResource resource : resources) {
            ResourceMetadata meta = resource.getResourceMetadata();
            this.metadata.put(meta.getModel(), meta);
        }
    }
View Full Code Here


        }
    }

    public Collection<RelationMatch> getMatchingRelations(Class<?> sourceType) {
        List<RelationMatch> result = new ArrayList<RelationMatch>();
        ResourceMetadata sourceMeta = this.metadata.get(sourceType);
        for(ResourceMetadata targetMeta : this.metadata.values()) {
            if(targetMeta.getModel() == sourceType) {
                continue;
            }
            for(NamedRelation match : targetMeta.match(sourceMeta)) {
                result.add(new RelationMatch(
                    sourceMeta.getModel(), match, targetMeta.getModel()));
            }
        }
        return result;
    }
View Full Code Here

        return new String[]{USER_XML_MEDIA_TYPE, USER_JSON_MEDIA_TYPE};
    }

    @Override
    public ResourceMetadata getResourceMetadata() {
        return new ResourceMetadata(User.class)
            .incoming(new Relation("presented_by"))
            .incoming(new Relation("tracked_by"))
            .incoming(new Relation("attended_by"))
            .outgoing(new NamedRelation("attachments", "attached_to"))
            .outgoing(new NamedRelation("sessions", "presented_by"));
View Full Code Here

@Path("target")
public class TargetResource implements MetadataResource {

    @Override
    public ResourceMetadata getResourceMetadata() {
        return new ResourceMetadata(TargetObject.class)
            .incoming(new Relation("connected_to"));
    }
View Full Code Here

        return Response.ok(converter.from(uriInfo, repo.get(id))).build();
    }

    @Override
    public ResourceMetadata getResourceMetadata() {
        return new ResourceMetadata(SourceObject.class)
            .outgoing(new NamedRelation("connections", "connected_to"))
            .outgoing(new NamedRelation("notdeployed", "no_matching_relation"));
    }
View Full Code Here

        return new String[]{ATTACHMENT_XML_MEDIA_TYPE, ATTACHMENT_JSON_MEDIA_TYPE};
    }

    @Override
    public ResourceMetadata getResourceMetadata() {
        return new ResourceMetadata(Attachment.class)
            .incoming(new Relation("attached_to"));
    }
View Full Code Here

        return new String[] {SESSION_XML_MEDIA_TYPE, SESSION_JSON_MEDIA_TYPE};
    }

    @Override
    public ResourceMetadata getResourceMetadata() {
        return new ResourceMetadata(Session.class)
            .incoming(new Relation("presented_by"))
            .outgoing(new NamedRelation("attachments", "attached_to"))
            .outgoing(new NamedRelation("speakers", "presented_by"))
            .outgoing(new NamedRelation("attendees", "attended_by"))
            .outgoing(new NamedRelation("locations", "located_in"));
View Full Code Here

        return new String[]{CONFERENCE_XML_MEDIA_TYPE, CONFERENCE_JSON_MEDIA_TYPE};
    }

    @Override
    public ResourceMetadata getResourceMetadata() {
        return new ResourceMetadata(Conference.class)
            .outgoing(new NamedRelation("attachments", "attached_to"))
            .outgoing(new NamedRelation("trackers", "tracked_by"))
            .outgoing(new NamedRelation("attendees", "attended_by"))
            .outgoing(new NamedRelation("locations", "located_at"));
    }
View Full Code Here

TOP

Related Classes of org.cedj.geekseek.web.rest.core.ResourceMetadata$NamedRelation

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.