BrightSide Workbench Full Report + Source Code
org.turro.elephant.cookies.CookieCtrl Class Reference
Inheritance diagram for org.turro.elephant.cookies.CookieCtrl:
Collaboration diagram for org.turro.elephant.cookies.CookieCtrl:

Public Member Functions

 CookieCtrl ()
 
String createPost (String type, boolean accept)
 
String getIdentifier ()
 
void doExecute (IConstructor constructor, KeyValueMap map)
 
Set< String > getTypes ()
 
String getMessage (String type)
 
CookieManager getManager ()
 
boolean anyUnset ()
 
boolean unset (String type)
 
boolean decline (String type)
 
boolean allow (String type)
 
- Public Member Functions inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
 AbstractDirectContentCtrl (String tmplRoot)
 
String createFormAction ()
 
String createPOST (String values)
 
String getAjaxSubmitUrl (String containerId)
 
String getAjaxUrl (String containerId, String values)
 
String getAjaxUrl (String containerId, KeyValueMap values)
 
String getAjaxEvalUrl (KeyValueMap values)
 
String createRightNowURL (String values)
 
String createRightNowURL (KeyValueMap values)
 
String createLinkTo (String link, KeyValueMap values)
 
String createURL ()
 
String createURL (IConstructor constructor, String values)
 
String createURL (IConstructor constructor, String values, int daysValid)
 
String createURL (IConstructor constructor, String values, int daysValid, boolean withDomain)
 
String createURL (IConstructor constructor, IContact recipe, String values, int daysValid, boolean withDomain)
 
String createURL (IConstructor constructor, IContact recipe, KeyValueMap values, int daysValid, boolean withDomain)
 
void setTemplate (String template)
 
void render (IConstructor constructor)
 
String parse (IConstructor constructor)
 
boolean itsMe (String id)
 
boolean myTurn (HttpServletRequest request)
 
void execute (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 
void execute (IConstructor constructor)
 

Protected Member Functions

void prepareCleanMarker (ElephantMarker em, KeyValueMap kvm)
 
void prepareMarker (ElephantMarker marker)
 
- Protected Member Functions inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
String getRedirContext (IConstructor constructor, boolean withDomain)
 
ElephantMarker getMarker (IConstructor constructor)
 
ElephantMarker getCleanMarkerFrom (IConstructor constructor)
 
void addContainerId (ElephantMarker marker, boolean container)
 
String getTmplRoot ()
 
String getTemplate ()
 
void writeMarkerToResponse (IConstructor constructor, KeyValueMap map)
 
void writeMarkerToResponse (IConstructor constructor, KeyValueMap map, Map extra)
 
void setNeedsUser (boolean needsUser)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
String template = "full"
 

Detailed Description

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

Definition at line 36 of file CookieCtrl.java.

Constructor & Destructor Documentation

◆ CookieCtrl()

org.turro.elephant.cookies.CookieCtrl.CookieCtrl ( )

Definition at line 38 of file CookieCtrl.java.

38  {
39  super("cookies");
40  }

Member Function Documentation

◆ allow()

boolean org.turro.elephant.cookies.CookieCtrl.allow ( String  type)

Definition at line 96 of file CookieCtrl.java.

96  {
97  return (type + "_allow").equals(Application.decryptCookieValue(type + "_allow"));
98  }
Here is the call graph for this function:

◆ anyUnset()

boolean org.turro.elephant.cookies.CookieCtrl.anyUnset ( )

Definition at line 82 of file CookieCtrl.java.

82  {
83  return CookieManager.load().keySet().stream().anyMatch(type -> {
84  return !decline((String) type) && !allow((String) type);
85  });
86  }
Here is the call graph for this function:

◆ createPost()

String org.turro.elephant.cookies.CookieCtrl.createPost ( String  type,
boolean  accept 
)

Definition at line 42 of file CookieCtrl.java.

42  {
43  return DirectContents.doCreatePOST(getIdentifier(),
44  "type=" + type +
45  ";accept=" + accept);
46  }
Here is the call graph for this function:

◆ decline()

boolean org.turro.elephant.cookies.CookieCtrl.decline ( String  type)

Definition at line 92 of file CookieCtrl.java.

92  {
93  return (type + "_decline").equals(Application.decryptCookieValue(type + "_decline"));
94  }
Here is the call graph for this function:

◆ doExecute()

void org.turro.elephant.cookies.CookieCtrl.doExecute ( IConstructor  constructor,
KeyValueMap  map 
)

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 64 of file CookieCtrl.java.

64  {
65  CookieManager.load().keySet().stream().forEach(type -> {
66  setType((String) type, "on".equals(map.get(type)));
67  });
68  }
Here is the call graph for this function:

◆ getIdentifier()

String org.turro.elephant.cookies.CookieCtrl.getIdentifier ( )

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 49 of file CookieCtrl.java.

49  {
50  return CookieCtrl.class.getAnnotation(DirectContent.class).identifier();
51  }

◆ getManager()

CookieManager org.turro.elephant.cookies.CookieCtrl.getManager ( )

Definition at line 78 of file CookieCtrl.java.

78  {
79  return CookieManager.load();
80  }
Here is the call graph for this function:

◆ getMessage()

String org.turro.elephant.cookies.CookieCtrl.getMessage ( String  type)

Definition at line 74 of file CookieCtrl.java.

74  {
75  return I_.get(CookieManager.load().getProperty(type));
76  }
Here is the call graph for this function:

◆ getTypes()

Set<String> org.turro.elephant.cookies.CookieCtrl.getTypes ( )

Definition at line 70 of file CookieCtrl.java.

70  {
71  return CookieManager.load().stringPropertyNames();
72  }
Here is the call graph for this function:

◆ prepareCleanMarker()

void org.turro.elephant.cookies.CookieCtrl.prepareCleanMarker ( ElephantMarker  em,
KeyValueMap  kvm 
)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 54 of file CookieCtrl.java.

54  {
55  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
56  }

◆ prepareMarker()

void org.turro.elephant.cookies.CookieCtrl.prepareMarker ( ElephantMarker  marker)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 59 of file CookieCtrl.java.

59  {
60  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
61  }

◆ unset()

boolean org.turro.elephant.cookies.CookieCtrl.unset ( String  type)

Definition at line 88 of file CookieCtrl.java.

88  {
89  return !decline(type) && !allow(type);
90  }

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