Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
*
* * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com)
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
* * For more information: http://www.orientechnologies.com
*
*/
package com.orientechnologies.orient.core.db;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.Callable;
import com.orientechnologies.orient.core.Orient;
import com.orientechnologies.orient.core.cache.OLocalRecordCache;
import com.orientechnologies.orient.core.command.OCommandOutputListener;
import com.orientechnologies.orient.core.config.OContextConfiguration;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.tool.ODatabaseImport;
import com.orientechnologies.orient.core.exception.ODatabaseException;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.intent.OIntent;
import com.orientechnologies.orient.core.metadata.security.OToken;
import com.orientechnologies.orient.core.storage.ORecordMetadata;
import com.orientechnologies.orient.core.storage.OStorage;
@SuppressWarnings("unchecked")
public abstract class ODatabaseWrapperAbstract implements ODatabaseInternal {
protected DB underlying;
protected ODatabaseInternal databaseOwner;
public ODatabaseWrapperAbstract(final DB iDatabase) {
underlying = iDatabase;
databaseOwner = this;
Orient.instance().getDatabaseFactory().register(databaseOwner);
}
public THISDB open(final String iUserName, final String iUserPassword) {
underlying.open(iUserName, iUserPassword);
return (THISDB) this;
}
public THISDB open(final OToken iToken) {
underlying.open(iToken);
Orient.instance().getDatabaseFactory().register(databaseOwner);
return (THISDB) this;
}
public THISDB create() {
return create(null);
}
public THISDB create(final Map iInitialSettings) {
underlying.create(iInitialSettings);
return (THISDB) this;
}
public boolean exists() {
return underlying.exists();
}
public void reload() {
underlying.reload();
}
@Override
public OContextConfiguration getConfiguration() {
return underlying.getConfiguration();
}
/**
* Executes a backup of the database. During the backup the database will be frozen in read-only mode.
*
* @param out
* OutputStream used to write the backup content. Use a FileOutputStream to make the backup persistent on disk
* @param options
* Backup options as Map object
* @param callable
* Callback to execute when the database is locked
* @param iListener
* Listener called for backup messages
* @param compressionLevel
* ZIP Compression level between 0 (no compression) and 9 (maximum). The bigger is the compression, the smaller will be
* the final backup content, but will consume more CPU and time to execute
* @param bufferSize
* Buffer size in bytes, the bigger is the buffer, the more efficient will be the compression
* @throws IOException
*/
@Override
public void backup(OutputStream out, Map options, Callable