BrightSide Workbench Full Report + Source Code
org.turro.contacts.service.ServiceContext Class Reference

Public Member Functions

String getAttribute (String attribute)
 
String getAttribute (String attribute, String defaultValue)
 

Static Public Member Functions

static String getServiceContextAttribute (String attribute, String defaultValue)
 
static List< String > getServiceTypeList ()
 
static List< String > getServiceThematicList ()
 
static boolean getAllowSingle ()
 
static boolean getAllowNew (IConstructor constructor)
 
static boolean getAllowQuestion (IConstructor constructor)
 
static List< String > getRecipients (IConstructor constructor)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 31 of file ServiceContext.java.

Member Function Documentation

◆ getAllowNew()

static boolean org.turro.contacts.service.ServiceContext.getAllowNew ( IConstructor  constructor)
static

Definition at line 61 of file ServiceContext.java.

61  {
62  String marketRoles = getServiceContextAttribute("market-roles", "@partner:on");
63  return constructor.isInRole("marketplace:new") ||
64  (Strings.isBlank(marketRoles) ? false : constructor.isInRole(marketRoles));
65  }
static String getServiceContextAttribute(String attribute, String defaultValue)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllowQuestion()

static boolean org.turro.contacts.service.ServiceContext.getAllowQuestion ( IConstructor  constructor)
static

Definition at line 67 of file ServiceContext.java.

67  {
68  String questionRoles = getServiceContextAttribute("question-roles", "@partner:on|@patron:on");
69  return constructor.isInRole("marketplace:new") ||
70  (Strings.isBlank(questionRoles) ? false : constructor.isInRole(questionRoles));
71  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllowSingle()

static boolean org.turro.contacts.service.ServiceContext.getAllowSingle ( )
static

Definition at line 57 of file ServiceContext.java.

57  {
58  return "true".equals(getServiceContextAttribute("allow-single", "false"));
59  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttribute() [1/2]

String org.turro.contacts.service.ServiceContext.getAttribute ( String  attribute)

Definition at line 33 of file ServiceContext.java.

33  {
34  return getAttribute(attribute, null);
35  }

◆ getAttribute() [2/2]

String org.turro.contacts.service.ServiceContext.getAttribute ( String  attribute,
String  defaultValue 
)

Definition at line 37 of file ServiceContext.java.

37  {
38  return getServiceContextAttribute(attribute, defaultValue);
39  }
Here is the call graph for this function:

◆ getRecipients()

static List<String> org.turro.contacts.service.ServiceContext.getRecipients ( IConstructor  constructor)
static

Definition at line 73 of file ServiceContext.java.

73  {
74  String recipients = getServiceContextAttribute("recipients", "contacts_admin,partner,patron,guest");
75  return Arrays.asList(recipients.split("\\s*,\\s*"));
76  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getServiceContextAttribute()

static String org.turro.contacts.service.ServiceContext.getServiceContextAttribute ( String  attribute,
String  defaultValue 
)
static

Definition at line 45 of file ServiceContext.java.

45  {
46  return ElephantProperties.getContextProperty(SERVICE_CONTEXT, attribute, defaultValue);
47  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getServiceThematicList()

static List<String> org.turro.contacts.service.ServiceContext.getServiceThematicList ( )
static

Definition at line 53 of file ServiceContext.java.

53  {
54  return ElephantProperties.getContextPrefixedProperties(SERVICE_CONTEXT, "thematic_");
55  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getServiceTypeList()

static List<String> org.turro.contacts.service.ServiceContext.getServiceTypeList ( )
static

Definition at line 49 of file ServiceContext.java.

49  {
50  return ElephantProperties.getContextPrefixedProperties(SERVICE_CONTEXT, "type_");
51  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: