Search in sources :

Example 1 with BinaryStore

use of com.dexels.navajo.resource.binarystore.BinaryStore in project navajo by Dexels.

the class BinaryStoreValue method evaluate.

@Override
public Object evaluate() {
    String tenant = super.getInstance();
    String resourceName = getStringOperand(0);
    BinaryDigest binaryDigest = getBinaryDigestOperand(1);
    BinaryStore os = BinaryStoreFactory.getInstance().getBinaryStore(resourceName, tenant);
    return os.resolve(binaryDigest);
}
Also used : BinaryDigest(com.dexels.navajo.document.types.BinaryDigest) BinaryStore(com.dexels.navajo.resource.binarystore.BinaryStore)

Example 2 with BinaryStore

use of com.dexels.navajo.resource.binarystore.BinaryStore in project navajo by Dexels.

the class BinaryStoreAdapter method getResolve.

public Binary getResolve(BinaryDigest digest) {
    logger.info("Getting: {} from resource: {} with tenant: {}", name, resource, tenant);
    BinaryStore os = BinaryStoreFactory.getInstance().getBinaryStore(resource, tenant);
    return os.resolve(digest);
}
Also used : BinaryStore(com.dexels.navajo.resource.binarystore.BinaryStore)

Example 3 with BinaryStore

use of com.dexels.navajo.resource.binarystore.BinaryStore in project navajo by Dexels.

the class BinaryStoreAdapter method store.

@Override
public void store() throws MappableException, UserException {
    if (value != null) {
        BinaryStore os = BinaryStoreFactory.getInstance().getBinaryStore(resource, tenant);
        if (os == null) {
            logger.warn("Can not find swift resource: {} for tenant: {}", resource, tenant);
            throw new UserException(-1, "Can not find binary store resource");
        }
        os.store(this.value);
    }
}
Also used : BinaryStore(com.dexels.navajo.resource.binarystore.BinaryStore) UserException(com.dexels.navajo.script.api.UserException)

Aggregations

BinaryStore (com.dexels.navajo.resource.binarystore.BinaryStore)3 BinaryDigest (com.dexels.navajo.document.types.BinaryDigest)1 UserException (com.dexels.navajo.script.api.UserException)1