-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session wrapper and license interface #619
Changes from all commits
307e2ec
0043da2
0746320
65a05e8
0732e44
e9a5741
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package zingg.common.client; | ||
|
||
import zingg.common.client.license.IZinggLicense; | ||
|
||
public interface ZSession<S> { | ||
|
||
public S getSession(); | ||
|
||
public void setSession(S session); | ||
|
||
public IZinggLicense getLicense(); | ||
|
||
public void setLicense(IZinggLicense license); | ||
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package zingg.common.client.license; | ||
|
||
public interface ILicenseValidator { | ||
|
||
public String getName(); | ||
|
||
public boolean validate(); | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package zingg.common.client.license; | ||
|
||
public interface IZinggLicense { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its not clear to me how this will evolve to reading, loading and passing the license constraints to the validators. If that's clear to you, please ignore and we can discuss during the implementation of the concrete classes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's discuss during the implementation of the concrete classes |
||
|
||
public ILicenseValidator getValidator(String name); | ||
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package zingg.spark.client; | ||
import org.apache.spark.sql.SparkSession; | ||
|
||
import zingg.common.client.ZSession; | ||
import zingg.common.client.license.IZinggLicense; | ||
|
||
public class ZSparkSession implements ZSession<SparkSession> { | ||
|
||
private SparkSession session; | ||
|
||
private IZinggLicense license; | ||
|
||
public ZSparkSession(SparkSession session, IZinggLicense license) { | ||
super(); | ||
this.session = session; | ||
this.license = license; | ||
} | ||
|
||
@Override | ||
public SparkSession getSession() { | ||
return session; | ||
} | ||
|
||
@Override | ||
public void setSession(SparkSession session) { | ||
this.session = session; | ||
} | ||
|
||
@Override | ||
public IZinggLicense getLicense() { | ||
return license; | ||
} | ||
|
||
@Override | ||
public void setLicense(IZinggLicense license) { | ||
this.license = license; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will probably need a name by which it will be looked up in the IZinggLicense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added getName method in commit e9a5741