Skip to content

Instantly share code, notes, and snippets.

@sgaem
Created July 30, 2017 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgaem/87e74af1544bf317653c15390370f020 to your computer and use it in GitHub Desktop.
Save sgaem/87e74af1544bf317653c15390370f020 to your computer and use it in GitHub Desktop.
This interface is used as an OSGi annotations in AEM 6.3
package com.poc.osgiannotation.core.servlets;
import org.osgi.service.metatype.annotations.AttributeDefinition;
import org.osgi.service.metatype.annotations.AttributeType;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.osgi.service.metatype.annotations.Option;
@ObjectClassDefinition(name = "SGAEM User Account Configuration", description = "Configure the user Details")
public @interface UserConfiguration {
@AttributeDefinition(name = "user.name", description = "User Name")
String getUserName() default "";
@AttributeDefinition(name = "userpassword", description = "Password of the user account", type = AttributeType.PASSWORD)
String getPassword() default "";
@AttributeDefinition(name = "user.isAdminUser", description = "is it admin user or not?")
boolean isAdminUser() default false;
@AttributeDefinition(name = "user.environments", description = "Define the all environment where this user will be available")
String[] getEnvironments() default {};
@AttributeDefinition(name = "user.validity", description ="Validity of user account", defaultValue = "10", required = true, type = AttributeType.INTEGER, min = "10")
int getValidity() default 10;
@AttributeDefinition(name = "memberof.name", description = "Member of the group", options = {
@Option(label = "Approval", value = "approve"),
@Option(label = "Editor", value = "editor"),
@Option(label = "Workflow Editor", value = "workflow.editor"),
@Option(label = "Administrator", value = "admin")})
String getMemberOf() default "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment