public RemoteDomainProvider() { // equivalent to this(false) but without IOException super(CACHE_FILE_NAME); disableCache(); scop = ScopFactory.getSCOP(); pdp = new RemotePDPProvider(); }
/** * initialize this provider with caching enabled * * @param cache * @throws IOException */ public RemoteDomainProvider(boolean cache) throws IOException { super(CACHE_FILE_NAME); if (!cache) { disableCache(); // } else if ( serializedCache.keySet().size() < 20000){ } else { // always load the representative assignments from server... // this makes sure we always have the latest assignments loadRepresentativeDomainAssignments(); } scop = ScopFactory.getSCOP(); pdp = new RemotePDPProvider(cache); }
/** * Send a signal to the cache that the system is shutting down. Notifies underlying * SerializableCache instances to flush themselves... */ public void notifyShutdown() { // System.out.println(" AtomCache got notify shutdown.."); if (pdpprovider != null) { if (pdpprovider instanceof RemotePDPProvider) { RemotePDPProvider remotePDP = (RemotePDPProvider) pdpprovider; remotePDP.flushCache(); } } // todo: use a SCOP implementation that is backed by SerializableCache ScopDatabase scopInstallation = ScopFactory.getSCOP(); if (scopInstallation != null) { if (scopInstallation instanceof CachedRemoteScopInstallation) { CachedRemoteScopInstallation cacheScop = (CachedRemoteScopInstallation) scopInstallation; cacheScop.flushCache(); } } }
/** * Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object. * * @param scopId a SCOP Id * @return a Structure object * @throws IOException * @throws StructureException */ public Structure getStructureForDomain(String scopId) throws IOException, StructureException { return getStructureForDomain(scopId, ScopFactory.getSCOP()); }
/** * Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object. * * @param domain a SCOP domain * @return a Structure object * @throws IOException * @throws StructureException */ public Structure getStructureForDomain(ScopDomain domain) throws IOException, StructureException { return getStructureForDomain(domain, ScopFactory.getSCOP()); }