Skip to content

Commit

Permalink
💥 stripping storable creators from false extension points
Browse files Browse the repository at this point in the history
Signed-off-by: dseurotech <[email protected]>
  • Loading branch information
dseurotech committed Jan 22, 2025
1 parent b543bff commit a37a6f5
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 346 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@
import org.eclipse.kapua.service.KapuaService;
import org.eclipse.kapua.service.authorization.role.Role;
import org.eclipse.kapua.service.authorization.role.RoleCreator;
import org.eclipse.kapua.service.authorization.role.RoleFactory;
import org.eclipse.kapua.service.authorization.role.RoleListResult;
import org.eclipse.kapua.service.authorization.role.RoleQuery;
import org.eclipse.kapua.service.authorization.role.RoleService;
import org.eclipse.kapua.service.user.User;
import org.eclipse.kapua.service.user.UserFactory;
import org.eclipse.kapua.service.user.UserListResult;
import org.eclipse.kapua.service.user.UserQuery;
import org.eclipse.kapua.service.user.UserService;
Expand All @@ -59,11 +57,7 @@ public class Roles extends AbstractKapuaResource {
@Inject
public RoleService roleService;
@Inject
public RoleFactory roleFactory;
@Inject
public UserService userService;
@Inject
public UserFactory userFactory;

/**
* Gets the {@link Role} list in the scope.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,39 @@
* <p>
* It is the base {@code interface} for all {@link Object} creators that are {@link Storable}.
*
* @param <E> The {@link Storable} for which this is a {@link StorableCreator} for.
* @param <E>
* The {@link Storable} for which this is a {@link StorableCreator} for.
* @since 1.0.0
*/
public interface StorableCreator<E extends Storable> {
public class StorableCreator<E extends Storable> {

private KapuaId scopeId;

public StorableCreator() {
}

public StorableCreator(KapuaId scopeId) {
this.scopeId = scopeId;
}

/**
* Gets the scope {@link KapuaId}.
*
* @return The scope {@link KapuaId}.
* @since 1.0.0
*/
KapuaId getScopeId();
public KapuaId getScopeId() {
return scopeId;
}

/**
* Sets the scope {@link KapuaId}.
*
* @param scopeId The scope {@link KapuaId}.
* @param scopeId
* The scope {@link KapuaId}.
* @since 1.3.0
*/
void setScopeId(KapuaId scopeId);
public void setScopeId(KapuaId scopeId) {
this.scopeId = scopeId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,77 +12,107 @@
*******************************************************************************/
package org.eclipse.kapua.service.datastore.model;

import java.util.Date;

import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.service.storable.model.StorableCreator;
import org.eclipse.kapua.service.storable.model.id.StorableId;

import java.util.Date;

/**
* Channel information schema creator definition
*
* @since 1.0.0
*/
public interface ChannelInfoCreator extends StorableCreator<ChannelInfo> {
public class ChannelInfoCreator extends StorableCreator<ChannelInfo> {

private String clientId;
private String name;
private StorableId messageId;
private Date messageTimestamp;

public ChannelInfoCreator() {
}

public ChannelInfoCreator(KapuaId scopeId) {
super(scopeId);
}

/**
* Get the client identifier
*
* @return
* @since 1.0.0
*/
String getClientId();
public String getClientId() {
return this.clientId;
}

/**
* @param clientId
* @since 1.3.0
*/
void setClientId(String clientId);
public void setClientId(String clientId) {
this.clientId = clientId;
}

/**
* Get the name
*
* @return
* @since 1.0.0
*/
String getName();
public String getName() {
return name;
}

/**
* Set the channel name
*
* @param name
* @since 1.0.0
*/
void setName(String name);
public void setName(String name) {
this.name = name;
}

/**
* Get the message identifier (of the first message published on this channel)
*
* @return
* @since 1.0.0
*/
StorableId getMessageId();
public StorableId getMessageId() {
return messageId;
}

/**
* Set the message identifier (of the first message published on this channel)
*
* @param messageId
* @since 1.0.0
*/
void setMessageId(StorableId messageId);
public void setMessageId(StorableId messageId) {
this.messageId = messageId;
}

/**
* Get the message timestamp (of the first message published on this channel)
*
* @return
* @since 1.0.0
*/
Date getMessageTimestamp();
public Date getMessageTimestamp() {
return messageTimestamp;
}

/**
* Set the message timestamp (of the first message published on this channel)
*
* @param messageTimestamp
* @since 1.0.0
*/
void setMessageTimestamp(Date messageTimestamp);
public void setMessageTimestamp(Date messageTimestamp) {
this.messageTimestamp = messageTimestamp;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,95 @@
*******************************************************************************/
package org.eclipse.kapua.service.datastore.model;

import java.util.Date;

import org.eclipse.kapua.model.id.KapuaId;
import org.eclipse.kapua.service.storable.model.StorableCreator;
import org.eclipse.kapua.service.storable.model.id.StorableId;

import java.util.Date;

/**
* Client information schema creator definition
*
* @since 1.0.0
*/
public interface ClientInfoCreator extends StorableCreator<ClientInfo> {
public class ClientInfoCreator extends StorableCreator<ClientInfo> {

private String clientId;
private StorableId messageId;
private Date messageTimestamp;

public ClientInfoCreator() {
}

/**
* Get the account
* Construct a client information creator for the given account
*
* @return
* @param scopeId
* The scope {@link KapuaId}
* @since 1.0.0
*/
KapuaId getScopeId();
public ClientInfoCreator(KapuaId scopeId) {
super(scopeId);
}

/**
* Get the client identifier
*
* @return
* @since 1.0.0
*/
String getClientId();
public String getClientId() {
return clientId;
}

/**
* Set the client identifier
*
* @param clientId
* @since 1.0.0
*/
void setClientId(String clientId);
public void setClientId(String clientId) {
this.clientId = clientId;
}

/**
* Get the message identifier (of the first message published by this client)
*
* @return
* @since 1.0.0
*/
StorableId getMessageId();
public StorableId getMessageId() {
return messageId;
}

/**
* Set the message identifier (of the first message published by this client)
*
* @param messageId
* @since 1.0.0
*/
void setMessageId(StorableId messageId);
public void setMessageId(StorableId messageId) {
this.messageId = messageId;
}

/**
* Get the message timestamp (of the first message published by this client)
*
* @return
* @since 1.0.0
*/
Date getMessageTimestamp();
public Date getMessageTimestamp() {
return messageTimestamp;
}

/**
* Set the message timestamp (of the first message published by this client)
*
* @param messageTimestamp
* @since 1.0.0
*/
void setMessageTimestamp(Date messageTimestamp);
public void setMessageTimestamp(Date messageTimestamp) {
this.messageTimestamp = messageTimestamp;
}

}
Loading

0 comments on commit a37a6f5

Please sign in to comment.