com.emc.mongoose.api.model.io.task.token.BasicTokenIoTaskBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongoose-api-model Show documentation
Show all versions of mongoose-api-model Show documentation
Mongoose is a high-load storage performance testing tool
package com.emc.mongoose.api.model.io.task.token;
import com.emc.mongoose.api.model.io.task.BasicIoTaskBuilder;
import com.emc.mongoose.api.model.item.TokenItem;
import com.emc.mongoose.api.model.storage.Credential;
import java.io.IOException;
import java.util.List;
/**
Created by kurila on 14.07.16.
*/
public class BasicTokenIoTaskBuilder>
extends BasicIoTaskBuilder
implements TokenIoTaskBuilder {
@Override @SuppressWarnings("unchecked")
public O getInstance(final I item)
throws IOException {
final String uid;
return (O) new BasicTokenIoTask<>(
originCode, ioType, item, Credential.getInstance(uid = getNextUid(), getNextSecret(uid))
);
}
@Override @SuppressWarnings("unchecked")
public void getInstances(final List items, final List buff)
throws IOException {
String uid;
for(final I item : items) {
buff.add(
(O) new BasicTokenIoTask<>(
originCode, ioType, item,
Credential.getInstance(uid = getNextUid(), getNextSecret(uid))
)
);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy