Examples of PID


Examples of io.fathom.auto.processes.Pid

    }

    public static CloudServerProcess find(FathomCloudConfig config) throws IOException {
        File pidFile = getPidFile(config.getInstanceDir());

        Pid pid = Pid.read(pidFile);
        if (pid == null) {
            return null;
        }

        CloudServerProcess process = new CloudServerProcess(config, pid);
View Full Code Here

Examples of io.fathom.auto.processes.Pid

        } else {
            if (execution.getExitCode() == 0) {
                log.info("Zookeeper started OK");

                File pidFile = getPidFile(instanceDir);
                Pid pid = Pid.read(pidFile);
                if (pid == null) {
                    throw new IOException("Zookeeper started, but could not read pid from file");
                }

                return new ZookeeperProcess(config, pid);
View Full Code Here

Examples of io.fathom.auto.processes.Pid

    public static ZookeeperProcess find(ZookeeperConfig config) throws IOException {
        File instanceDir = config.getInstanceDir();
        File pidFile = getPidFile(instanceDir);

        Pid pid = Pid.read(pidFile);
        if (pid == null) {
            log.info("No zookeeper pid");
            return null;
        }
View Full Code Here

Examples of org.fcrepo.common.PID

     * Set the Fedora Object properties from the Feed metadata.
     *
     * @throws ObjectIntegrityException
     */
    private void addObjectProperties() throws ObjectIntegrityException {
        PID pid;
        try {
            pid = new PID(m_feed.getId().toString());
        } catch (MalformedPIDException e) {
            throw new ObjectIntegrityException(e.getMessage(), e);
        }

        String label = m_feed.getTitle();
        String state =
                m_xpath.valueOf("/a:feed/a:category[@scheme='"
                        + MODEL.STATE.uri + "']/@term", m_feed);
        String createDate =
                m_xpath.valueOf("/a:feed/a:category[@scheme='"
                        + MODEL.CREATED_DATE.uri + "']/@term", m_feed);

        m_obj.setPid(pid.toString());

        try {
            m_obj.setState(DOTranslationUtility.readStateAttribute(state));
        } catch (ParseException e) {
            throw new ObjectIntegrityException("Could not read object state", e);
View Full Code Here

Examples of org.fcrepo.common.PID

            logger.debug("in BackendPolicies.newWritePolicies() id=" + id);
            logger.debug("in BackendPolicies.newWritePolicies() " + filename1
                    + " " + filename2);
            String filename = filename1 + filename2; //was id.replace(':','-');
            logger.debug("in BackendPolicies.newWritePolicies() " + filename);
            PID tempPid = new PID(filename);
            logger.debug("in BackendPolicies.newWritePolicies() got PID "
                    + tempPid);
            filename = tempPid.toFilename();
            logger.debug("in BackendPolicies.newWritePolicies() filename="
                    + filename);
            sb
                    .append("<Policy xmlns=\"urn:oasis:names:tc:xacml:1.0:policy\" PolicyId=\""
                            + id + "\">\n");
View Full Code Here

Examples of org.fcrepo.common.PID

                                                false);
    }


    private Foxml11Document createFoxmlObject(String spid, String contentLocation) throws Exception {
        PID pid = PID.getInstance(spid);
        Date date = new Date(1);

        Foxml11Document doc = new Foxml11Document(pid.toString());
        doc.addObjectProperty(Property.STATE, "A");

        if (contentLocation != null && contentLocation.length() > 0) {
            String ds = "DS";
            String dsv = "DS1.0";
View Full Code Here

Examples of org.fcrepo.common.PID

    }

    private Foxml11Document createFoxmlObject(String spid,
                                              String contentLocation)
            throws Exception {
        PID pid = PID.getInstance(spid);
        Date date = new Date(1);

        Foxml11Document doc = new Foxml11Document(pid.toString());
        doc.addObjectProperty(Property.STATE, "A");

        if (contentLocation != null && contentLocation.length() > 0) {
            String ds = "DS";
            String dsv = "DS1.0";
View Full Code Here

Examples of org.fcrepo.common.PID

     */
    private static URI getBlobId(String token) {
        try {
            int i = token.indexOf('+');
            if (i == -1) {
                return new URI(new PID(token).toURI());
            } else {
                String[] dsParts = token.substring(i + 1).split("\\+");
                if (dsParts.length != 2) {
                    throw new IllegalArgumentException(
                            "Malformed datastream token: " + token);
View Full Code Here

Examples of org.fcrepo.common.PID

            if (parentRelationships.contains(rel)) {
                Set<String> parents = allRelationships.get(rel);
                if (parents != null) {
                    for (String parent : parents) {
                        try {
                        PID parentPID = new PID(parent);
                        // we want the parents in demo:123 form, not info:fedora/demo:123
                        parentPIDs.add(parentPID.toString());
                        if (logger.isDebugEnabled()) {
                            logger.debug("added parent " + parentPID.toString());
                        }
                        } catch (MalformedPIDException e) {
                            // target of relationship isn't a PID
                            logger.warn("Triple " + pid + " " + rel + " " + parent + " does not have a digital object as its target");
View Full Code Here

Examples of org.fcrepo.common.PID

                    while (tuples.hasNext()) {
                        Node parent = tuples.next().get("parent");
                        if (parent != null) {
                            if (parent.isURIReference()) {
                                try {
                                    PID parentPID = new PID(parent.stringValue());
                                    logger.debug("Found parent " + parentPID.toString());
                                    parentPIDs.add(parentPID.toString());
                                } catch (MalformedPIDException e) {
                                    logger.warn("parent/child relationship target is not a Fedora object" + parent.stringValue());
                                }
                            } else {
                                logger.warn("parent/child query result is not a Fedora object " + parent.stringValue());
                            }
                        } else {
                            logger.error("parent/child tuple result did not contain parent variable");
                        }
                    }
                    logger.debug("Query result count: " + tuples.count());

                } else {
                    logger.debug("Query returned 0 results");
                }

            } catch (TrippiException e) {
                logger.error("Error running TQL query " + e.getMessage(), e);
                return parentPIDs;
            }


        } else if (verifyTripleLanguage(SPO)) {
            // gets all relationships for pid, then filters results
            // rather than executing separate queries for each relationship

            // parent relationships
            Map<String, Set<String>> pRels = null;
            if (parentRelationships.size() == 1) {
                pRels= getRelationships(pidUri, parentRelationships.get(0));
            } else {
                pRels = getRelationships(pidUri);
            }

           for (String rel : pRels.keySet()) {
               if (parentRelationships.contains(rel)) {
                   for (String parent : pRels.get(rel)) {
                       PID parentPid;
                    try {
                        parentPid = new PID(parent);
                        parentPIDs.add(parentPid.toString());
                    } catch (MalformedPIDException e) {
                        logger.warn("Parent of " + pid + " through relationship " + rel + " is not a Fedora resource");
                    }
                   }
               }
           }
           // child relationships
           if (childRelationships != null && !childRelationships.isEmpty()) {
               Map<String, Set<String>> cRels = null;
               if (childRelationships.size() == 1) {
                   cRels= getReverseRelationships(pidUri, childRelationships.get(0));
               } else {
                   cRels = getReverseRelationships(pidUri);
               }
               for (String rel : cRels.keySet()) {
                   if (childRelationships.contains(rel)) {
                       for (String parent : cRels.get(rel)) {
                           PID parentPid;
                        try {
                            parentPid = new PID(parent);
                            parentPIDs.add(parentPid.toString());
                        } catch (MalformedPIDException e) {
                            logger.warn("Parent of " + pid + " through relationship " + rel + " is not a Fedora resource");
                        }
                       }
                   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.