Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
joram
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joram
joram
Commits
f28e9791
Commit
f28e9791
authored
Sep 07, 2020
by
Andre Freyssinet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JMQ-229: Allows to update the administrator password using the configuration update.
parent
14b323ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
34 deletions
+40
-34
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AdminTopic.java
...rc/main/java/org/objectweb/joram/mom/dest/AdminTopic.java
+6
-6
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/proxies/ConnectionManager.java
...va/org/objectweb/joram/mom/proxies/ConnectionManager.java
+34
-28
No files found.
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AdminTopic.java
View file @
f28e9791
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 20
19
ScalAgent Distributed Technologies
* Copyright (C) 2001 - 20
20
ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
...
...
@@ -334,16 +334,16 @@ public final class AdminTopic extends Topic implements AdminTopicMBean {
Identity
identity
=
adminNot
.
getIdentity
();
try
{
//identity.validate();
if
(
logger
.
isLoggable
(
BasicLevel
.
DEBUG
))
logger
.
log
(
BasicLevel
.
DEBUG
,
"AdminTopic store identity = "
+
identity
);
usersTable
.
put
(
identity
.
getUserName
(),
identity
);
if
(
adminNot
.
getProxyId
()
!=
null
)
{
// It's the first boot, registers the administrator proxy
proxiesTable
.
put
(
identity
.
getUserName
(),
adminNot
.
getProxyId
());
clients
.
put
(
adminNot
.
getProxyId
(),
new
Integer
(
READWRITE
));
}
if
(
logger
.
isLoggable
(
BasicLevel
.
DEBUG
))
logger
.
log
(
BasicLevel
.
DEBUG
,
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/proxies/ConnectionManager.java
View file @
f28e9791
...
...
@@ -316,8 +316,7 @@ public class ConnectionManager implements ConnectionManagerMBean {
logger
.
log
(
BasicLevel
.
DEBUG
,
"ConnectionManager.init("
+
args
+
','
+
firstTime
+
')'
);
// TODO (AF): Be careful, this default value is saved and retrieved by
// AdminTopic agent.
// TODO (AF): Be careful, this default value is saved and retrieved by AdminTopic agent.
Integer
delay
=
AgentServer
.
getInteger
(
AdminCommandConstant
.
REDELIVERY_DELAY
);
if
(
delay
!=
null
)
{
logger
.
log
(
BasicLevel
.
FATAL
,
...
...
@@ -325,16 +324,11 @@ public class ConnectionManager implements ConnectionManagerMBean {
Queue
.
setDefaultRedeliveryDelay
(
delay
);
}
if
(!
firstTime
)
return
;
AdminTopic
adminTopic
=
new
AdminTopic
();
adminTopic
.
deploy
();
inFlow
=
AgentServer
.
getInteger
(
"ConnectionManager.inFlow"
,
inFlow
).
intValue
();
if
(
args
!=
null
)
{
String
initialAdminName
=
null
;
String
initialAdminPass
=
null
;
if
(
args
!=
null
)
{
StringTokenizer
st
=
new
StringTokenizer
(
args
);
if
(
st
.
countTokens
()
>=
1
)
{
...
...
@@ -343,16 +337,14 @@ public class ConnectionManager implements ConnectionManagerMBean {
if
(
st
.
hasMoreTokens
())
{
initialAdminPass
=
st
.
nextToken
();
}
// AF: deprecated, will be deleted.
if
(
st
.
hasMoreTokens
())
{
try
{
inFlow
=
Integer
.
parseInt
(
st
.
nextToken
());
}
catch
(
Exception
exc
)
{
inFlow
=
-
1
;
}
logger
.
log
(
BasicLevel
.
INFO
,
"ConnectionManager.init admin=("
+
initialAdminName
+
','
+
initialAdminPass
+
')'
);
}
if
(
firstTime
)
{
AdminTopic
adminTopic
=
new
AdminTopic
();
adminTopic
.
deploy
();
if
(
initialAdminName
!=
null
)
{
UserAgent
userAgent
=
new
UserAgent
(
initialAdminName
,
AgentId
.
JoramAdminPxStamp
);
userAgent
.
deploy
();
...
...
@@ -362,8 +354,23 @@ public class ConnectionManager implements ConnectionManagerMBean {
Identity
.
getRootIdentityClass
(
initialAdminName
));
AdminNotification
adminNot
=
new
AdminNotification
(
userAgent
.
getId
(),
identity
);
logger
.
log
(
BasicLevel
.
INFO
,
"ConnectionManager.init send adminNot to "
+
adminTopic
.
getId
());
Channel
.
sendTo
(
adminTopic
.
getId
(),
adminNot
);
}
}
else
{
if
(
AgentServer
.
updatecfg
!=
null
)
{
// Updates the administrator identity.
Identity
identity
=
createIdentity
(
Identity
.
getRootName
(
initialAdminName
),
initialAdminPass
,
Identity
.
getRootIdentityClass
(
initialAdminName
));
AdminNotification
adminNot
=
new
AdminNotification
(
null
,
identity
);
AgentId
adminId
=
new
AgentId
(
AgentServer
.
getServerId
(),
AgentServer
.
getServerId
(),
AgentId
.
JoramAdminStamp
);
logger
.
log
(
BasicLevel
.
INFO
,
"ConnectionManager.init send adminNot to "
+
adminId
);
Channel
.
sendTo
(
adminId
,
adminNot
);
}
}
try
{
MXWrapper
.
registerMBean
(
getCurrentInstance
(),
"Joram#"
+
AgentServer
.
getServerId
(),
MBEAN_NAME
);
...
...
@@ -371,7 +378,6 @@ public class ConnectionManager implements ConnectionManagerMBean {
logger
.
log
(
BasicLevel
.
DEBUG
,
"registerMBean"
,
e
);
}
}
}
/**
* Create an admin Identity.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment