org.linkedopenactors.rdfpub.domain.RdfPubRequestInfoDefault Maven / Gradle / Ivy
The newest version!
package org.linkedopenactors.rdfpub.domain;
import java.util.Optional;
import lombok.Data;
/**
* Default implementation of {@link RdfPubRequestInfo}.
* @author [email protected]
*/
@Data
class RdfPubRequestInfoDefault implements RdfPubRequestInfo {
private ActorProfile actorProfile;
private InstanceProfile instanceProfile;
private String identityManagementUserId;
private String identityManagementPreferredUsername;
/**
* Constructing a RdfPubRequestInfo instance for a anonymous request.
* @param instanceProfile
*/
public RdfPubRequestInfoDefault(InstanceProfile instanceProfile) {
this.instanceProfile = instanceProfile;
}
/**
* Constructing a RdfPubRequestInfo instance for a request form an logged in actor.
* @param actorProfile
* @param instanceProfile
* @param identityManagementPreferredUsername
* @param identityManagementUserId
*/
public RdfPubRequestInfoDefault(ActorProfile actorProfile, InstanceProfile instanceProfile,
String identityManagementPreferredUsername, String identityManagementUserId) {
this.actorProfile = actorProfile;
this.instanceProfile = instanceProfile;
this.identityManagementPreferredUsername = identityManagementPreferredUsername;
this.identityManagementUserId = identityManagementUserId;
}
@Override
public Optional getActorProfile() {
return Optional.ofNullable(actorProfile);
}
@Override
public InstanceProfile getInstanceProfile() {
return instanceProfile;
}
@Override
public Optional getIdentityManagementPreferredUsername() {
return Optional.ofNullable(identityManagementPreferredUsername);
}
@Override
public Optional getIdentityManagementUserId() {
return Optional.ofNullable(identityManagementUserId);
}
}