/** * Check if we have a master phase. * * @param repo * @param bsn * @param v * @return * @throws Exception */ private boolean isMaster(InfoRepository repo, String bsn, Version v) throws Exception { ResourceDescriptor descriptor = repo.getDescriptor(bsn, v); if (descriptor == null) return false; return descriptor.phase == Phase.MASTER; }
/** * Dispatch the events * * @param type * @param rds * @param exception */ private void event(TYPE type, ResourceDescriptor rds, Exception exception) { for (Listener l : listeners) { try { l.events(new ResourceRepositoryEvent(type, rds, exception)); } catch (Exception e) { logger.debug("listener {} throws exception", l, e); } } }
public List<RepositoryPlugin> getRepositories() throws Exception { if (data.repositories == null) { data.repositories = getPlugins(RepositoryPlugin.class); for (RepositoryPlugin repo : data.repositories) { if (repo instanceof Prepare) { ((Prepare) repo).prepare(); } } } return data.repositories; }
private ResourceDescriptor buildDescriptor(File f, Jar jar, byte[] digest, String bsn, Version version) throws NoSuchAlgorithmException, Exception { init(); Jar tmpjar = jar; if (jar == null) tmpjar = new Jar(f); try { Manifest m = tmpjar.getManifest(); ResourceDescriptor rd = new ResourceDescriptor(); rd.bsn = bsn; rd.version = version; rd.description = m.getMainAttributes().getValue(Constants.BUNDLE_DESCRIPTION); rd.id = digest; if (rd.id == null) rd.id = SHA1.digest(f).digest(); rd.sha256 = SHA256.digest(f).digest(); rd.url = f.toURI(); return rd; } finally { if (tmpjar != null) tmpjar.close(); } } }
try { if (repo instanceof RepositoryDigest) { byte[] digest = ((RepositoryDigest) repo).getDigest(); digests.add(Hex.toHexString(digest)); } else {
/** * Dispatch the events * * @param type * @param rds * @param exception */ private void event(TYPE type, ResourceDescriptor rds, Exception exception) { for (Listener l : listeners) { try { l.events(new ResourceRepositoryEvent(type, rds, exception)); } catch (Exception e) { logger.debug("listener {} throws exception", l, e); } } }
/** * Check if we have a master phase. * * @param repo * @param bsn * @param v * @throws Exception */ private boolean isMaster(InfoRepository repo, String bsn, Version v) throws Exception { ResourceDescriptor descriptor = repo.getDescriptor(bsn, v); // // If not there, we assume that is master // if (descriptor == null) return true; return descriptor.phase == Phase.MASTER; }
private ResourceDescriptor buildDescriptor(File f, Jar jar, byte[] digest, String bsn, Version version) throws NoSuchAlgorithmException, Exception { init(); Jar tmpjar = jar; if (jar == null) tmpjar = new Jar(f); try { Manifest m = tmpjar.getManifest(); ResourceDescriptor rd = new ResourceDescriptor(); rd.bsn = bsn; rd.version = version; rd.description = m.getMainAttributes() .getValue(Constants.BUNDLE_DESCRIPTION); rd.id = digest; if (rd.id == null) rd.id = SHA1.digest(f) .digest(); rd.sha256 = SHA256.digest(f) .digest(); rd.url = f.toURI(); return rd; } finally { if (tmpjar != null) tmpjar.close(); } }
try { if (repo instanceof RepositoryDigest) { byte[] digest = ((RepositoryDigest) repo).getDigest(); digests.add(Hex.toHexString(digest)); } else {
public List<RepositoryPlugin> getRepositories() throws Exception { if (data.repositories == null) { data.repositories = getPlugins(RepositoryPlugin.class); for (RepositoryPlugin repo : data.repositories) { if (repo instanceof Prepare) { ((Prepare) repo).prepare(); } } } return data.repositories; }
/** * Dispatch the events * * @param type * @param rds * @param exception */ private void event(TYPE type, ResourceDescriptor rds, Exception exception) { for (Listener l : listeners) { try { l.events(new ResourceRepositoryEvent(type, rds, exception)); } catch (Exception e) { reporter.trace("listener %s throws exception %s", l, e); } } }
/** * Check if we have a master phase. * * @param repo * @param bsn * @param v * @return * @throws Exception */ private boolean isMaster(InfoRepository repo, String bsn, Version v) throws Exception { ResourceDescriptor descriptor = repo.getDescriptor(bsn, v); if (descriptor == null) return false; return descriptor.phase == Phase.MASTER; }
private ResourceDescriptor buildDescriptor(File f, Jar jar, byte[] digest, String bsn, Version version) throws NoSuchAlgorithmException, Exception { init(); Jar tmpjar = jar; if (jar == null) tmpjar = new Jar(f); try { Manifest m = tmpjar.getManifest(); ResourceDescriptor rd = new ResourceDescriptor(); rd.bsn = bsn; rd.version = version; rd.description = m.getMainAttributes().getValue(Constants.BUNDLE_DESCRIPTION); rd.id = digest; if (rd.id == null) rd.id = SHA1.digest(f).digest(); rd.sha256 = SHA256.digest(f).digest(); rd.url = f.toURI(); return rd; } finally { if (tmpjar != null) tmpjar.close(); } } }
try { if (repo instanceof RepositoryDigest) { byte[] digest = ((RepositoryDigest) repo).getDigest(); digests.add(Hex.toHexString(digest)); } else {
/** * Dispatch the events * * @param type * @param rds * @param exception */ private void event(TYPE type, ResourceDescriptor rds, Exception exception) { for (Listener l : listeners) { try { l.events(new ResourceRepositoryEvent(type, rds, exception)); } catch (Exception e) { reporter.trace("listener %s throws exception %s", l, e); } } }
/** * Check if we have a master phase. * * @param repo * @param bsn * @param v * @throws Exception */ private boolean isMaster(InfoRepository repo, String bsn, Version v) throws Exception { ResourceDescriptor descriptor = repo.getDescriptor(bsn, v); // // If not there, we assume that is master // if (descriptor == null) return true; return descriptor.phase == Phase.MASTER; }
private ResourceDescriptor buildDescriptor(File f, Jar jar, byte[] digest, String bsn, Version version) throws NoSuchAlgorithmException, Exception { init(); Jar tmpjar = jar; if (jar == null) tmpjar = new Jar(f); try { Manifest m = tmpjar.getManifest(); ResourceDescriptor rd = new ResourceDescriptor(); rd.bsn = bsn; rd.version = version; rd.description = m.getMainAttributes() .getValue(Constants.BUNDLE_DESCRIPTION); rd.id = digest; if (rd.id == null) rd.id = SHA1.digest(f) .digest(); rd.sha256 = SHA256.digest(f) .digest(); rd.url = f.toURI(); return rd; } finally { if (tmpjar != null) tmpjar.close(); } }
try { if (repo instanceof RepositoryDigest) { byte[] digest = ((RepositoryDigest) repo).getDigest(); digests.add(Hex.toHexString(digest)); } else {
RepositoryPlugin rr = getBaselineRepo(); if (rr instanceof InfoRepository) { ResourceDescriptor descriptor = ((InfoRepository) rr).getDescriptor(getBsn(), older); if (descriptor != null && descriptor.phase != Phase.STAGING) { error("Baselining %s against same version %s but the repository says the older repository version is not the required %s but is instead %s",
RepositoryPlugin rr = getBaselineRepo(); if (rr instanceof InfoRepository) { ResourceDescriptor descriptor = ((InfoRepository) rr).getDescriptor(getBsn(), older); if (descriptor != null && descriptor.phase != Phase.STAGING) { error("Baselining %s against same version %s but the repository says the older repository version is not the required %s but is instead %s",