All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudimpl.outstack.spring.service.iam.UpdatePolicy Maven / Gradle / Ivy

There is a newer version: 4.0.551
Show newest version
package com.cloudimpl.outstack.spring.service.iam;

import com.cloudimpl.outstack.core.Inject;
import com.cloudimpl.outstack.runtime.EntityCommandHandler;
import com.cloudimpl.outstack.runtime.EntityContext;
import com.cloudimpl.outstack.runtime.ResourceHelper;
import com.cloudimpl.outstack.runtime.domain.Policy;
import com.cloudimpl.outstack.runtime.domain.PolicyCreateRequest;
import com.cloudimpl.outstack.runtime.domain.PolicyUpdated;

public class UpdatePolicy extends EntityCommandHandler {

    @Inject
    private ResourceHelper helper;

    @Override
    protected Policy execute(EntityContext context, PolicyCreateRequest command) {
        return context.update(command.getPolicyName(), new PolicyUpdated(command.getPolicyName(), command.getPolicyContext(), helper.getDomainOwner(), helper.getDomainContext(), helper.getApiContext(), command.getBoundary(), command.getDependentPolicies()));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy