/hazelcast/src/main/java/com/hazelcast/impl/management/MemberConfigRequest.java

https://bitbucket.org/gabral6_gmailcom/hazelcast · Java · 53 lines · 27 code · 10 blank · 16 comment · 0 complexity · db43a979303e1b0226b3c5d54cf5199d MD5 · raw file

  1. /*
  2. * Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.hazelcast.impl.management;
  17. import com.hazelcast.config.ConfigXmlGenerator;
  18. import com.hazelcast.core.Hazelcast;
  19. import com.hazelcast.core.HazelcastInstance;
  20. import java.io.DataInput;
  21. import java.io.DataOutput;
  22. import java.io.IOException;
  23. // author: sancar - 11.12.2012
  24. public class MemberConfigRequest implements ConsoleRequest{
  25. public MemberConfigRequest(){
  26. super();
  27. }
  28. public int getType() {
  29. return ConsoleRequestConstants.REQUEST_TYPE_MEMBER_CONFIG;
  30. }
  31. public Object readResponse(DataInput in) throws IOException {
  32. return in.readUTF();
  33. }
  34. public void writeResponse(ManagementCenterService mcs, DataOutput dos) throws Exception {
  35. String clusterXml;
  36. clusterXml = new ConfigXmlGenerator(true).generate(mcs.getHazelcastInstance().getConfig());
  37. dos.writeUTF(clusterXml);
  38. }
  39. public void writeData(DataOutput out) throws IOException {
  40. }
  41. public void readData(DataInput in) throws IOException {
  42. }
  43. }