-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement client special registers for Mapepire server
- Loading branch information
Showing
7 changed files
with
67 additions
and
29 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/com/github/ibm/mapepire/ClientSpecialRegisters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.github.ibm.mapepire; | ||
|
||
import java.util.Properties; | ||
|
||
public interface ClientSpecialRegisters { | ||
static final String CLIENT_APP_NAME = "ApplicationName"; // AS400JDBCConnectionImpl.applicationNamePropertyName_ | ||
static final String CLIENT_USER = "ClientUser"; // AS400JDBCConnectionImpl.clientUserPropertyName_ | ||
static final String CLIENT_HOST_NAME = "ClientHostname"; // AS400JDBCConnectionImpl.clientHostnamePropertyName_ | ||
static final String CLIENT_ACCOUNTING = "ClientAccounting"; // AS400JDBCConnectionImpl.clientAccountingPropertyName_ | ||
static final String CLIENT_PGM_ID = "ClientProgramID"; // AS400JDBCConnectionImpl.clientProgramIDPropertyName_ | ||
|
||
public Properties getProperties(final String _applicationName); | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/github/ibm/mapepire/ClientSpecialRegistersRemote.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.github.ibm.mapepire; | ||
|
||
import java.util.Properties; | ||
|
||
public class ClientSpecialRegistersRemote implements ClientSpecialRegisters { | ||
|
||
final String m_clientIP; | ||
final String m_accountingString; | ||
private String m_user; | ||
|
||
public ClientSpecialRegistersRemote(final String _clientHost, final String _clientIP, final String _user) { | ||
m_clientIP = _clientIP; | ||
m_user = _user; | ||
m_accountingString = "hostname: " + _clientHost; | ||
} | ||
|
||
@Override | ||
public Properties getProperties(final String _applicationName) { | ||
Properties ret = new Properties(); | ||
ret.put(CLIENT_USER, m_user); | ||
ret.put(CLIENT_APP_NAME, _applicationName); | ||
ret.put(CLIENT_HOST_NAME, m_clientIP); | ||
ret.put(CLIENT_PGM_ID, getProgramString()); | ||
ret.put(CLIENT_ACCOUNTING, m_accountingString); | ||
return ret; | ||
} | ||
|
||
private String getProgramString() { | ||
return String.format("Mapepire server connector | Version %s", Version.s_version); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters