public static PID getPID(String pidString) throws MalformedPidException { try { return new PID(pidString); } catch (MalformedPIDException e) { throw new MalformedPidException(e.getMessage()); } }
public static PID pidFromFilename(String filename) throws MalformedPidException { try { return PID.fromFilename(filename); } catch (MalformedPIDException e) { throw new MalformedPidException(e.getMessage()); } }
public static PID pidFromFilename(String filename) throws MalformedPidException { try { return PID.fromFilename(filename); } catch (MalformedPIDException e) { throw new MalformedPidException(e.getMessage()); } }
public static PID getPID(String pidString) throws MalformedPidException { try { return new PID(pidString); } catch (MalformedPIDException e) { throw new MalformedPidException(e.getMessage()); } }
/** * Factory method that throws an unchecked exception if it's not * well-formed. * @param pidString the String value of the PID * @return PID */ public static PID getInstance(String pidString) { try { return new PID(pidString); } catch (MalformedPIDException e) { throw new FaultException("Malformed PID: " + e.getMessage(), e); } }
/** * Factory method that throws an unchecked exception if it's not * well-formed. * @param pidString the String value of the PID * @return PID */ public static PID getInstance(String pidString) { try { return new PID(pidString); } catch (MalformedPIDException e) { throw new FaultException("Malformed PID: " + e.getMessage(), e); } }
/** * Generate a new pid that is guaranteed to be unique, within the given * namespace. */ public synchronized PID generatePID(String namespace) throws IOException { int i = getHighestID(namespace); i++; try { m_lastPID = new PID(namespace + ":" + i); } catch (MalformedPIDException e) { throw new IOException(e.getMessage()); } setHighestID(namespace, i); return m_lastPID; }
/** * Generate a new pid that is guaranteed to be unique, within the given * namespace. */ public synchronized PID generatePID(String namespace) throws IOException { int i = getHighestID(namespace); i++; try { m_lastPID = new PID(namespace + ":" + i); } catch (MalformedPIDException e) { throw new IOException(e.getMessage()); } setHighestID(namespace, i); return m_lastPID; }
/** * Cause the given PID to never be generated by the PID generator. */ public synchronized void neverGeneratePID(String pid) throws IOException { logger.debug("Never generating PID: {}", pid); try { PID p = new PID(pid); String ns = p.getNamespaceId(); int id = Integer.parseInt(p.getObjectId()); if (id > getHighestID(ns)) { setHighestID(ns, id); } } catch (MalformedPIDException mpe) { throw new IOException(mpe.getMessage()); } catch (NumberFormatException nfe) { // if the id part is not numeric, we already know we'll // never generate that id because all generated ids are numeric. } }
} catch (MalformedPIDException e) { throw new PolicyStoreException("Invalid policy name '" + name + "'. Could not create a valid PID from this name: " + e.getMessage(), e);
/** * Cause the given PID to never be generated by the PID generator. */ public synchronized void neverGeneratePID(String pid) throws IOException { logger.debug("Never generating PID: {}", pid); try { PID p = new PID(pid); String ns = p.getNamespaceId(); int id = Integer.parseInt(p.getObjectId()); if (id > getHighestID(ns)) { setHighestID(ns, id); } } catch (MalformedPIDException mpe) { throw new IOException(mpe.getMessage()); } catch (NumberFormatException nfe) { // if the id part is not numeric, we already know we'll // never generate that id because all generated ids are numeric. } }
System.out.println("ERROR: " + e.getMessage());
System.out.println("ERROR: " + e.getMessage());
pid = new PID(feed.getId().toString()); } catch (MalformedPIDException e) { throw new ObjectIntegrityException(e.getMessage(), e);
pid = new PID(feed.getId().toString()); } catch (MalformedPIDException e) { throw new ObjectIntegrityException(e.getMessage(), e);