use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class ResourceGroupService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument td = super.getDocumentTemplate();
// enable metadata indexing
td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
ServiceUtils.setRetentionLimit(td);
ResourceGroupState template = (ResourceGroupState) td;
template.name = "resource-group-1";
return template;
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class ResourceMetricsService method handleDelete.
@Override
public void handleDelete(Operation delete) {
if (delete.hasBody()) {
ServiceDocument state = delete.getBody(ServiceDocument.class);
if (state != null && state.documentExpirationTimeMicros != 0) {
ResourceMetrics body = getState(delete);
body.documentExpirationTimeMicros = state.documentExpirationTimeMicros;
}
}
super.handleDelete(delete);
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class InMemoryResourceMetricService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument template = super.getDocumentTemplate();
com.vmware.photon.controller.model.ServiceUtils.setRetentionLimit(template);
return template;
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class DiskService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument td = super.getDocumentTemplate();
// enable metadata indexing
td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
ServiceUtils.setRetentionLimit(td);
DiskState template = (DiskState) td;
template.id = UUID.randomUUID().toString();
template.type = DiskType.SSD;
template.status = DiskStatus.DETACHED;
template.capacityMBytes = 2 ^ 32L;
template.name = "disk01";
return template;
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class FirewallService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument td = super.getDocumentTemplate();
// enable metadata indexing
td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
ServiceUtils.setRetentionLimit(td);
FirewallState template = (FirewallState) td;
template.id = UUID.randomUUID().toString();
template.name = "firewall-one";
return template;
}
Aggregations