BrightSide Workbench Full Report + Source Code
org.turro.ws.WsMember Class Reference
Inheritance diagram for org.turro.ws.WsMember:
Collaboration diagram for org.turro.ws.WsMember:

Public Member Functions

Long getMemberId ()
 
void setMemberId (Long memberId)
 
String getContactId ()
 
void setContactId (String contactId)
 
String getMemberDomain ()
 
void setMemberDomain (String memberDomain)
 
String getService ()
 
void setService (String service)
 
boolean isValidIP (String ip)
 
String getMemberUrl ()
 
String getName ()
 
ServiceNamePair getServiceName ()
 
void setServiceName (ServiceNamePair serviceName)
 
IContact getContact ()
 
void setContact (IContact contact)
 
Object entityId ()
 
boolean isEmpty ()
 
void prepareSave ()
 
String toJson ()
 
String toJson (Map< String, Object > properties)
 
- Public Member Functions inherited from org.turro.jpa.entity.IDaoEntity
default boolean isNew ()
 
default void prepareDelete ()
 
default void removeEmpties ()
 
default Collection< Collection > collections ()
 

Static Public Member Functions

static WsMember from (String memberDomain, String service)
 

Detailed Description

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

Definition at line 48 of file WsMember.java.

Member Function Documentation

◆ entityId()

Object org.turro.ws.WsMember.entityId ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 141 of file WsMember.java.

141  {
142  return memberId;
143  }

◆ from()

static WsMember org.turro.ws.WsMember.from ( String  memberDomain,
String  service 
)
static

Definition at line 172 of file WsMember.java.

172  {
173  WsMember member = new WsMember();
174  member.setMemberDomain(memberDomain);
175  member.setService(service);
176  return member;
177  }
Here is the call graph for this function:

◆ getContact()

IContact org.turro.ws.WsMember.getContact ( )

Definition at line 130 of file WsMember.java.

130  {
131  return Contacts.getContactById(contactId);
132  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContactId()

String org.turro.ws.WsMember.getContactId ( )

Definition at line 67 of file WsMember.java.

67  {
68  return contactId;
69  }

◆ getMemberDomain()

String org.turro.ws.WsMember.getMemberDomain ( )

Definition at line 75 of file WsMember.java.

75  {
76  return memberDomain;
77  }
Here is the caller graph for this function:

◆ getMemberId()

Long org.turro.ws.WsMember.getMemberId ( )

Definition at line 59 of file WsMember.java.

59  {
60  return memberId;
61  }
Here is the caller graph for this function:

◆ getMemberUrl()

String org.turro.ws.WsMember.getMemberUrl ( )

Definition at line 103 of file WsMember.java.

103  {
104  if(memberDomain.contains("localhost")) {
105  return "http://" + memberDomain;
106  } else {
107  return "https://" + memberDomain;
108  }
109  }
Here is the caller graph for this function:

◆ getName()

String org.turro.ws.WsMember.getName ( )

Definition at line 111 of file WsMember.java.

111  {
112  return Phrases.start(getContact().getName(), Chars.forward().toString(), getService()).toString();
113  }
IContact getContact()
Definition: WsMember.java:130
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getService()

String org.turro.ws.WsMember.getService ( )

Definition at line 83 of file WsMember.java.

83  {
84  return service;
85  }
Here is the caller graph for this function:

◆ getServiceName()

ServiceNamePair org.turro.ws.WsMember.getServiceName ( )

Definition at line 119 of file WsMember.java.

119  {
120  return serviceName == null ? new ServiceNamePair(service, service) : serviceName;
121  }

◆ isEmpty()

boolean org.turro.ws.WsMember.isEmpty ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 146 of file WsMember.java.

146  {
147  return Strings.isBlank(contactId) || Strings.isBlank(memberDomain);
148  }

◆ isValidIP()

boolean org.turro.ws.WsMember.isValidIP ( String  ip)

Definition at line 93 of file WsMember.java.

93  {
94  try {
95  String[] parts = memberDomain.split("[\\:\\/]");
96  return URIs.validIP(parts[0], ip);
97  } catch (UnknownHostException ex) {
98  Logger.getLogger(WsMember.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
99  return false;
100  }
101  }
Here is the call graph for this function:

◆ prepareSave()

void org.turro.ws.WsMember.prepareSave ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 151 of file WsMember.java.

151  {
152  IDaoEntity.super.prepareSave();
153  if(Zero.orNull(memberId)) {
154  memberId = IdUtils.getNewLongIdFromLong(new ElephantPU(), "WsMember", "memberId");
155  }
156  }
Here is the call graph for this function:

◆ setContact()

void org.turro.ws.WsMember.setContact ( IContact  contact)

Definition at line 134 of file WsMember.java.

134  {
135  contactId = contact == null ? null : contact.getId();
136  }
Here is the call graph for this function:

◆ setContactId()

void org.turro.ws.WsMember.setContactId ( String  contactId)

Definition at line 71 of file WsMember.java.

71  {
72  this.contactId = contactId;
73  }

◆ setMemberDomain()

void org.turro.ws.WsMember.setMemberDomain ( String  memberDomain)

Definition at line 79 of file WsMember.java.

79  {
80  this.memberDomain = memberDomain;
81  }
Here is the caller graph for this function:

◆ setMemberId()

void org.turro.ws.WsMember.setMemberId ( Long  memberId)

Definition at line 63 of file WsMember.java.

63  {
64  this.memberId = memberId;
65  }

◆ setService()

void org.turro.ws.WsMember.setService ( String  service)

Definition at line 87 of file WsMember.java.

87  {
88  this.service = service;
89  }
Here is the caller graph for this function:

◆ setServiceName()

void org.turro.ws.WsMember.setServiceName ( ServiceNamePair  serviceName)

Definition at line 123 of file WsMember.java.

123  {
124  this.serviceName = serviceName;
125  this.service = serviceName.getService();
126  }
Here is the call graph for this function:

◆ toJson() [1/2]

String org.turro.ws.WsMember.toJson ( )

Definition at line 161 of file WsMember.java.

161  {
162  return toJson(this);
163  }
Here is the caller graph for this function:

◆ toJson() [2/2]

String org.turro.ws.WsMember.toJson ( Map< String, Object >  properties)

Definition at line 166 of file WsMember.java.

166  {
167  return toJson(this, properties);
168  }
Here is the call graph for this function:

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